update i3 and vimrc
[dotfiles.git] / .vimrc
diff --git a/.vimrc b/.vimrc
index 5b1c832..bf5bb9c 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -1,9 +1,14 @@
+" Package manager
 execute pathogen#infect()
-syntax enable
-filetype indent plugin on
 
+" Automaticly source some files after writing
 autocmd! bufwritepost .vimrc source %
+autocmd! bufwritepost .bashrc !source %
+autocmd! bufwritepost .Xresources !xrdb -merge %
 
+" Some general options
+syntax enable
+filetype indent plugin on
 set encoding=utf-8
 set history=1000
 set number
@@ -14,26 +19,48 @@ set incsearch
 set noerrorbells
 set novisualbell
 set nobackup
-set nowb
+set nowritebackup
 set noswapfile
-set shiftwidth=2
-set tabstop=2
-set cc=80
+set colorcolumn=80
 set textwidth=79
+set shiftwidth=4
+set tabstop=4
 
+" List characters to mark trailing whitespace etc
+set listchars=nbsp:¬,tab:▸\ ,eol:↩,extends:»,precedes:«,trail:•
+set nolist
+
+" Move through long lines as they were short multiple lines
+map j gj
+map k gk
+
+" Custom split switching using tab
 map <TAB>l <C-W>l
 map <TAB>h <C-W>h
 map <TAB>j <C-W>j
 map <TAB>k <C-W>k
 
+" Center the search results
 nnoremap n nzzzv
 nnoremap N Nzzzv
 
+" Unbind arrow keys, who has them anyways on the keyboard...
 for prefix in ['i', 'n', 'v']
-       for key in ['<UP', '<DOWN>', '<LEFT>', '<RIGHT>']
+       for key in ['<UP>', '<DOWN>', '<LEFT>', '<RIGHT>']
                exe prefix . "noremap " . key . " <Nop>"
        endfor
 endfor
 
+" GPG options
 let g:GPGPreferArmor=1
 let g:GPGPreferSign=1
+
+" Syntastic options
+set statusline+=%#warningmsg#
+set statusline+=%{SyntasticStatuslineFlag()}
+set statusline+=%*
+
+let g:syntastic_always_populate_loc_list = 1
+let g:syntastic_auto_loc_list = 1
+let g:syntastic_check_on_open = 0
+let g:syntastic_check_on_wq = 0