1 " My personal vim, nvim, gvim configuration
2 " Author: Stefan Huber <shuber@sthu.org>
5 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
16 set listchars=tab:»,trail:·,eol:$
19 filetype plugin indent on
34 set wildmode=longest,list:full
43 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
44 " Some global plugin settings
48 " Attention: Must be run after plugsetup.vim
50 highlight default link BadWhitespace SpellCap
51 " Make trailing whitespace be flagged as bad.
52 au BufRead,BufNewFile * syn match BadWhitespace /\s\+$/ containedin=ALL
53 " Make space before tab be flagged as bad and vice versa
54 au BufRead,BufNewFile * syn match BadWhitespace / \+\t/ containedin=ALL
55 au BufRead,BufNewFile * syn match BadWhitespace /\t \+/ containedin=ALL
57 let g:airline_powerline_fonts=1
58 let g:airline#extensions#tabline#enabled=1
59 let g:airline#extensions#branch#enabled=1
61 let g:gruvbox_contrast_light='hard'
62 let g:gruvbox_contrast_dark='hard'
63 let g:gruvbox_italic = 1
67 " let NERDTreeWinPos="right"
68 let NERDTreeHijackNetrw=0
69 let NERDTreeWinSize=22
70 let NERDTreeQuitOnOpen=1
71 "au VimEnter * if !argc() | Startify | NERDTree | wincmd w
73 let g:neomake_c_enabled_makers = ['clangtidy', 'clangcheck']
74 let g:neomake_cpp_enabled_makers = ['clangtidy', 'clangcheck']
76 call neomake#configure#automake('w')
77 "let g:neomake_logfile = '/tmp/neomake.log'
79 let g:clang_compilation_database = '.'
81 " Speedup deoplete startup time, see deoplete FAQ
82 let g:python3_host_prog = '/usr/bin/python3'
83 " deoplete requires huge startuptime. Delay loading upon first InsertEnter.
84 let g:deoplete#enable_at_startup = 0
85 autocmd InsertEnter * call deoplete#enable()
89 "au FileType markdown,mkd call pencil#init()
90 "au FileType text call pencil#init()
91 "au FileType mail call pencil#init()
92 "au FileType tex call pencil#init()
95 let g:vim_markdown_folding_disabled=1
96 let g:vim_markdown_frontmatter=1
97 let g:vim_markdown_math=1
100 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
101 " Some filetype settings
104 au BufRead,BufNewFile ~/.mutt/tmp/*mutt-* set filetype=mail
105 au BufRead,BufNewFile *.muttrc set filetype=muttrc
107 au BufRead,BufNewFile *.cls set filetype=tex
110 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
111 " Some filetype-specific settings
113 au FileType text,markdown,mail,tex,gitcommit,mediawiki,vimwiki setlocal spell
114 au FileType text,markdown,mail,gitcommit,mediawiki,vimwiki set fo+=n
116 au Filetype go set shiftwidth=8 tabstop=8 noexpandtab
117 au Filetype tex set shiftwidth=2 tabstop=2
119 au FileType mediawiki setlocal wrap linebreak tw=0
122 au Filetype mail syn match Statement /^\s*-*\s*>8\s*-*\s*$/
123 au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/
125 " Line wrap crippled with numbers shown
126 au Filetype man set nonumber
129 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
130 " Some plugin-specific settings
132 au FileType markdown call RagtagInit()
134 let g:guesslang_langs=[ 'en_US', 'de_AT']
135 au BufReadPost * :DetectIndent
137 au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.'
138 au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.'
140 au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh'
141 au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp'
143 :let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'],
144 \ ['|', 'OBSOLETE(o)', 'WONT(n)'],
147 let g:vimwiki_list = [{'path': '~/.vimwiki/',
148 \ 'template_path': '~/.vim/vimwiki/templates',
149 \ 'template_default': 'default',
150 \ 'template_ext': '.html'}]
153 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
158 if filereadable($HOME . '/.vim/init-local.vim')
159 source ~/.vim/init-local.vim