4669c6c6b0b106c29a3f97b10b2803fe2c5e5acb
[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
27 " List characters to mark trailing whitespace etc
28 set listchars=nbsp:¬,tab:▸\ ,eol:↩,extends:»,precedes:«,trail:•
29 set list
30
31 " Move through long lines as they were short multiple lines
32 map j gj
33 map k gk
34
35 " Custom split switching using tab
36 map <TAB>l <C-W>l
37 map <TAB>h <C-W>h
38 map <TAB>j <C-W>j
39 map <TAB>k <C-W>k
40
41 " Center the search results
42 nnoremap n nzzzv
43 nnoremap N Nzzzv
44
45 " Unbind arrow keys, who has them anyways on the keyboard...
46 for prefix in ['i', 'n', 'v']
47 for key in ['<UP>', '<DOWN>', '<LEFT>', '<RIGHT>']
48 exe prefix . "noremap " . key . " <Nop>"
49 endfor
50 endfor
51
52 " GPG options
53 let g:GPGPreferArmor=1
54 let g:GPGPreferSign=1
55
56 " Syntastic options
57 set statusline+=%#warningmsg#
58 set statusline+=%{SyntasticStatuslineFlag()}
59 set statusline+=%*
60
61 let g:syntastic_always_populate_loc_list = 1
62 let g:syntastic_auto_loc_list = 1
63 let g:syntastic_check_on_open = 0
64 let g:syntastic_check_on_wq = 0