d2a798ee842f3bf867d6ac78421c7f2433270a3a
[dotfiles.git] / vim / .vimrc
1 " Some general options
2 syntax enable
3 filetype indent plugin on
4 color torte
5
6 " Settings
7 set encoding=utf-8
8 set history=1000
9 set number
10 set ruler
11 set backspace=eol,start,indent
12 set whichwrap+=<,>,h,l
13 set incsearch
14 set noerrorbells
15 set novisualbell
16 set nobackup
17 set nowritebackup
18 set noswapfile
19 set colorcolumn=80
20 set textwidth=79
21 set shiftwidth=4
22 set tabstop=4
23 set nowrap
24 set lazyredraw
25 set smartcase
26 set ignorecase
27 set scrolloff=1
28 set sidescrolloff=1
29 set listchars=nbsp:¬,tab:▸\ ,eol:↩,extends:»,precedes:«,trail:•
30 set list
31
32 " Make sure the last line is shown as much as possible
33 set display+=lastline
34
35 " Move through long lines as they were short multiple lines
36 map j gj
37 map k gk
38
39 " Custom split and tabswitching using tab
40 map <TAB>l <C-PageDown>
41 map <TAB>h <C-PageUp>
42 map <TAB><TAB>l <C-W>l
43 map <TAB><TAB>h <C-W>h
44 map <TAB>j <C-W>j
45 map <TAB>k <C-W>k
46
47 " Center the search results
48 nnoremap n nzzzv
49 nnoremap N Nzzzv
50
51 " Allow yanking to the clipboards in visual mode
52 vnoremap sy :w ! xclip<enter><enter>
53 vnoremap cy :w ! xclip -sel clip<enter><enter>
54 " Allow pasting from the clipboards in normal mode
55 nnoremap sp :r ! xclip -o<enter>
56 nnoremap cp :r ! xclip -sel clip -o<enter>
57
58 " Disable ex mode
59 map Q <Nop>
60
61 " Fold settings
62 set foldmethod=marker
63 set foldlevelstart=99
64
65 " Unbind arrow keys, who has them anyway on the keyboard...
66 for prefix in ['i', 'n', 'v']
67 for key in ['<UP>', '<DOWN>', '<LEFT>', '<RIGHT>']
68 exe prefix . "noremap " . key . " <Nop>"
69 endfor
70 endfor
71
72 " GPG options
73 let g:GPGPreferArmor=1
74 let g:GPGPreferSign=1
75
76 " Syntastic options
77 set statusline+=%#warningmsg#
78 set statusline+=%{SyntasticStatuslineFlag()}
79 set statusline+=%*
80
81 let g:syntastic_always_populate_loc_list = 1
82 let g:syntastic_auto_loc_list = 1
83 let g:syntastic_check_on_open = 0
84 let g:syntastic_check_on_wq = 0
85
86 " Vimwiki
87 let g:vimwiki_list = [{'path': '~/projects/kaartenbak'}]