6d8e56ed07ea93d53e229f6a146b07733b707da0
[vimconf.git] / init.vim
1 " My personal vim, nvim, gvim configuration
2 " Author: Stefan Huber <shuber@sthu.org>
3
4 set nocompatible
5 set termguicolors
6 set number
7 set cursorline
8 set scrolloff=5
9
10 set encoding=utf-8
11
12 set listchars=tab:»­,trail:·,eol:$
13 set virtualedit=block
14
15 filetype plugin indent on
16
17 set tabstop=4
18 set shiftwidth=4
19 set expandtab
20 set smarttab
21
22 set autoindent
23 set smartindent
24
25 set incsearch
26 set hlsearch
27
28 set colorcolumn=+1
29 set mouse=a
30 set wildmode=longest,list:full
31
32 if has('nvim')
33 set guicursor=
34 end
35
36 syntax on
37 runtime plugsetup.vim
38
39 let g:airline_powerline_fonts=1
40 let g:airline#extensions#tabline#enabled=1
41 let g:airline#extensions#branch#enabled=1
42
43 let g:gruvbox_contrast_light='hard'
44 let g:gruvbox_contrast_dark='hard'
45 let g:gruvbox_italic = 1
46 set bg=dark
47 colorscheme gruvbox
48
49 " let NERDTreeWinPos="right"
50 let NERDTreeHijackNetrw=0
51 let NERDTreeWinSize=22
52 let NERDTreeQuitOnOpen=1
53 "au VimEnter * if !argc() | Startify | NERDTree | wincmd w
54
55 let g:neomake_c_enabled_makers = ['clangtidy', 'clangcheck']
56 let g:neomake_cpp_enabled_makers = ['clangtidy', 'clangcheck']
57
58 call neomake#configure#automake('w')
59 "let g:neomake_logfile = '/tmp/neomake.log'
60
61 let g:clang_compilation_database = '.'
62
63 " Speedup deoplete startup time, see deoplete FAQ
64 let g:python3_host_prog = '/usr/bin/python3'
65 " deoplete requires huge startuptime. Delay loading upon first InsertEnter.
66 let g:deoplete#enable_at_startup = 0
67 autocmd InsertEnter * call deoplete#enable()
68
69 "augroup pencil
70 "au!
71 "au FileType markdown,mkd call pencil#init()
72 "au FileType text call pencil#init()
73 "au FileType mail call pencil#init()
74 "au FileType tex call pencil#init()
75 "augroup END
76
77 let g:vim_markdown_folding_disabled=1
78 let g:vim_markdown_frontmatter=1
79 let g:vim_markdown_math=1
80
81 let g:guesslang_langs=[ 'en_US', 'de_AT']
82 au FileType text,markdown,mail,tex,gitcommit setlocal spell
83 au BufReadPost * :DetectIndent
84
85 au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.'
86 au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.'
87
88 au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh'
89 au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp'
90
91
92 "git scissor line
93 au Filetype mail syn match Statement /^\s*-*\s*>8\s*-*\s*$/
94 au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/
95
96 "mutt and neomutt
97 au BufRead,BufNewFile ~/.mutt/tmp/*mutt-* set filetype=mail
98 au BufRead,BufNewFile *.muttrc set filetype=muttrc
99
100 " Some settings for tex files
101 au BufRead,BufNewFile *.cls set filetype=tex
102 au Filetype tex set shiftwidth=2
103
104 au BufRead,BufNewFile *.plt set filetype=gnuplot
105
106 :let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'],
107 \ ['|', 'OBSOLETE(o)', 'WONT(n)'],
108 \ ['CANCELED(c)']]
109
110 " Trailing whitespace
111 highlight default link TrailingWhitespace SpellCap
112 " Make trailing whitespace be flagged as bad.
113 au BufRead,BufNewFile * syn match TrailingWhitespace /\s\+$/ containedin=ALL
114
115 runtime macros.vim
116 runtime keymaps.vim
117
118 if filereadable($HOME . '/.vim/init-local.vim')
119 source ~/.vim/init-local.vim
120 endif