bf5bb9c801b6d91ed5d16d0494140d422c8afb27
[dotfiles.git] / .vimrc
1 " Package manager
2 execute pathogen#infect()
3
4 " Automaticly source some files after writing
5 autocmd! bufwritepost .vimrc source %
6 autocmd! bufwritepost .bashrc !source %
7 autocmd! bufwritepost .Xresources !xrdb -merge %
8
9 " Some general options
10 syntax enable
11 filetype indent plugin on
12 set encoding=utf-8
13 set history=1000
14 set number
15 set ruler
16 set backspace=eol,start,indent
17 set whichwrap+=<,>,h,l
18 set incsearch
19 set noerrorbells
20 set novisualbell
21 set nobackup
22 set nowritebackup
23 set noswapfile
24 set colorcolumn=80
25 set textwidth=79
26 set shiftwidth=4
27 set tabstop=4
28
29 " List characters to mark trailing whitespace etc
30 set listchars=nbsp:¬,tab:▸\ ,eol:↩,extends:»,precedes:«,trail:•
31 set nolist
32
33 " Move through long lines as they were short multiple lines
34 map j gj
35 map k gk
36
37 " Custom split switching using tab
38 map <TAB>l <C-W>l
39 map <TAB>h <C-W>h
40 map <TAB>j <C-W>j
41 map <TAB>k <C-W>k
42
43 " Center the search results
44 nnoremap n nzzzv
45 nnoremap N Nzzzv
46
47 " Unbind arrow keys, who has them anyways on the keyboard...
48 for prefix in ['i', 'n', 'v']
49 for key in ['<UP>', '<DOWN>', '<LEFT>', '<RIGHT>']
50 exe prefix . "noremap " . key . " <Nop>"
51 endfor
52 endfor
53
54 " GPG options
55 let g:GPGPreferArmor=1
56 let g:GPGPreferSign=1
57
58 " Syntastic options
59 set statusline+=%#warningmsg#
60 set statusline+=%{SyntasticStatuslineFlag()}
61 set statusline+=%*
62
63 let g:syntastic_always_populate_loc_list = 1
64 let g:syntastic_auto_loc_list = 1
65 let g:syntastic_check_on_open = 0
66 let g:syntastic_check_on_wq = 0