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