Merge branch 'master' of github.com:dopefishh/dotfiles
[dotfiles.git] / vim / .vimrc
1 " Automaticly source some files after writing
2 autocmd! bufwritepost .vimrc source %
3 autocmd! bufwritepost .bashrc !source %
4 autocmd! bufwritepost .Xresources !xrdb -merge %
5
6 " Some general options
7 syntax enable
8 filetype indent plugin on
9 color torte
10 set encoding=utf-8
11 set history=1000
12 set number
13 set ruler
14 set backspace=eol,start,indent
15 set whichwrap+=<,>,h,l
16 set incsearch
17 set noerrorbells
18 set novisualbell
19 set nobackup
20 set nowritebackup
21 set noswapfile
22 set colorcolumn=80
23 set textwidth=79
24 set shiftwidth=4
25 set tabstop=4
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 " Fold settings
46 set foldmethod=syntax
47 set foldlevelstart=99
48
49 " Unbind arrow keys, who has them anyways on the keyboard...
50 for prefix in ['i', 'n', 'v']
51 for key in ['<UP>', '<DOWN>', '<LEFT>', '<RIGHT>']
52 exe prefix . "noremap " . key . " <Nop>"
53 endfor
54 endfor
55
56 " GPG options
57 let g:GPGPreferArmor=1
58 let g:GPGPreferSign=1
59
60 " Syntastic options
61 set statusline+=%#warningmsg#
62 set statusline+=%{SyntasticStatuslineFlag()}
63 set statusline+=%*
64
65 let g:syntastic_always_populate_loc_list = 1
66 let g:syntastic_auto_loc_list = 1
67 let g:syntastic_check_on_open = 0
68 let g:syntastic_check_on_wq = 0