Updates
[dotfiles.git] / vim / .vimrc
1 " Automaticly source some files after writing
2 autocmd! bufwritepost .vimrc source %
3
4 " Some general options
5 syntax enable
6 filetype indent plugin on
7 color torte
8 set encoding=utf-8
9 set history=1000
10 set number
11 set ruler
12 set backspace=eol,start,indent
13 set whichwrap+=<,>,h,l
14 set incsearch
15 set noerrorbells
16 set novisualbell
17 set nobackup
18 set nowritebackup
19 set noswapfile
20 set colorcolumn=80
21 set textwidth=79
22 set shiftwidth=4
23 set tabstop=4
24 set nowrap
25
26 " List characters to mark trailing whitespace etc
27 set listchars=nbsp:¬,tab:▸\ ,eol:↩,extends:»,precedes:«,trail:•
28 set list
29
30 " Move through long lines as they were short multiple lines
31 map j gj
32 map k gk
33
34 " Custom split and tabswitching using tab
35 map <TAB>l <C-PageDown>
36 map <TAB>h <C-PageUp>
37 map <TAB><TAB>l <C-W>l
38 map <TAB><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 " Allow yanking to the clipboards in visual mode
47 vnoremap sy :w ! xclip<enter><enter>
48 vnoremap cy :w ! xclip -sel clip<enter><enter>
49 " Allow pasting from the clipboards in normal mode
50 nnoremap sp :r ! xclip -o<enter>
51 nnoremap cp :r ! xclip -sel clip -o<enter>
52
53 " Disable ex mode
54 map Q <Nop>
55
56 " Fold settings
57 set foldmethod=marker
58 set foldlevelstart=99
59
60 " Unbind arrow keys, who has them anyways on the keyboard...
61 for prefix in ['i', 'n', 'v']
62 for key in ['<UP>', '<DOWN>', '<LEFT>', '<RIGHT>']
63 exe prefix . "noremap " . key . " <Nop>"
64 endfor
65 endfor
66
67 " GPG options
68 let g:GPGPreferArmor=1
69 let g:GPGPreferSign=1
70
71 " Syntastic options
72 set statusline+=%#warningmsg#
73 set statusline+=%{SyntasticStatuslineFlag()}
74 set statusline+=%*
75
76 let g:syntastic_always_populate_loc_list = 1
77 let g:syntastic_auto_loc_list = 1
78 let g:syntastic_check_on_open = 0
79 let g:syntastic_check_on_wq = 0
80
81 " Vimtex options
82 let g:vimtex_compiler_enabled = 0
83
84 " Background transparency
85 hi Normal guibg=NONE ctermbg=NONE