allow any format resize.sh
[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
9 " Settings
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 set lazyredraw
28 set smartcase
29 set ignorecase
30 set scrolloff=1
31 set sidescrolloff=1
32 set listchars=nbsp:¬,tab:▸\ ,eol:↩,extends:»,precedes:«,trail:•
33 set list
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 " Vimtex options
87 let g:vimtex_compiler_enabled = 0