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