citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

init.vim (1573B)


      1 inoremap <Esc> <Nop>
      2 inoremap <special> fd <Esc>
      3 
      4 set tabstop=8
      5 set shiftwidth=8
      6 set ai
      7 set hlsearch
      8 set colorcolumn=80
      9 set nowrap
     10 set hidden
     11 set rnu nu
     12 set wrap
     13 
     14 hi ColorColumn ctermbg=237
     15 "hi ColorColumn ctermbg=254
     16 "hi StatusLine ctermbg=254
     17 
     18 map Y y$
     19 
     20 syntax on
     21 
     22 set clipboard=unnamedplus
     23 
     24 let mapleader = "\\"
     25 let maplocalleader = "\\"
     26 nmap <Leader>xda ma:%s/\s\+$//g<CR>`a
     27 
     28 nmap <C-q> :q<CR>
     29 nmap <C-x> :x<CR>
     30 nmap <C-s> ^D
     31 nmap <C-n> :tn<CR>
     32 nmap <C-p> :tp<CR>
     33 
     34 " autoparens
     35 "ino " ""<left>
     36 "ino ' ''<left>
     37 "ino ( ()<left>
     38 "ino [ []<left>
     39 "ino { {}<left>
     40 "ino {<CR> {<CR>}<ESC>O
     41 
     42 imap <A-j> {
     43 imap <A-k> }
     44 imap <A-n> [
     45 imap <A-m> ]
     46 imap <A-h> (
     47 imap <A-l> )
     48 imap <A-u> _
     49 imap <A-i> -
     50 imap <A-o> +
     51 imap <A-,> =
     52 imap <A-Space> <CR>
     53 
     54 autocmd FileType go autocmd BufWritePre <buffer> execute "normal! mz:mkview\<esc>:%!fmtsafe gofmt\<esc>:loadview\<esc>`z"
     55 autocmd FileType go set wrap
     56 autocmd FileType rust autocmd BufWritePre <buffer> execute "normal! mz:mkview\<esc>:%!fmtsafe rustfmt\<esc>:loadview\<esc>`z"
     57 "autocmd FileType javascript autocmd BufWritePre <buffer> execute "normal! mz:mkview\<esc>:%!fmtsafe jsfmt\<esc>:loadview\<esc>`z"
     58 "autocmd BufEnter,BufNew *.js set sw=2 ts=2 expandtab
     59 
     60 "autocmd filetype html set sw=2 ts=2 expandtab
     61 
     62 autocmd BufEnter,BufNew *.nix set sw=2 ts=2 expandtab
     63 autocmd BufEnter,BufNew *.gmi set wrap linebreak
     64 
     65 au BufWritePost,FileWritePost ~/.Xdefaults,~/.Xresources silent! !xrdb -load % >/dev/null 2>&1
     66 
     67 if has("autocmd")
     68   au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
     69     \| exe "normal! g'\"" | endif
     70 endif