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
46 " Enable loading of devicons
47 let g:enable_plugin_devicons = 1
51 " Attention: Must be run after plugsetup.vim
53 highlight default link BadWhitespace SpellCap
55 " Setup BadWhitespace syntax match expressions.
56 function SetBadWhitespaceSyntax()
57 " Do not expose bad whitespace in help buffers or for man pages. Or, more
58 " generally, if we open the file readonly.
59 "if &ft != "help" && &ft != "man"
61 " Make trailing whitespace be flagged as bad.
62 syn match BadWhitespace /\s\+$/ containedin=ALL
63 " Make space before tab be flagged as bad and vice versa
64 syn match BadWhitespace / \+\t/ containedin=ALL
65 syn match BadWhitespace /\t \+/ containedin=ALL
69 " Make trailing whitespace be flagged as bad.
70 au BufRead,BufNewFile * call SetBadWhitespaceSyntax()
72 let g:airline_powerline_fonts=1
73 let g:airline#extensions#tabline#enabled=1
74 let g:airline#extensions#branch#enabled=1
76 let g:gruvbox_contrast_light='hard'
77 let g:gruvbox_contrast_dark='hard'
78 let g:gruvbox_italic = 1
82 " let NERDTreeWinPos="right"
83 let NERDTreeHijackNetrw=0
84 let NERDTreeWinSize=22
85 let NERDTreeQuitOnOpen=1
86 "au VimEnter * if !argc() | Startify | NERDTree | wincmd w
88 let g:neomake_c_enabled_makers = ['clangtidy', 'clangcheck']
89 let g:neomake_cpp_enabled_makers = ['clangtidy', 'clangcheck']
91 call neomake#configure#automake('w')
92 "let g:neomake_logfile = '/tmp/neomake.log'
94 let g:clang_compilation_database = '.'
96 " Speedup deoplete startup time, see deoplete FAQ
97 let g:python3_host_prog = '/usr/bin/python3'
98 " deoplete requires huge startuptime. Delay loading upon first InsertEnter.
99 let g:deoplete#enable_at_startup = 0
100 let g:deoplete#enable_smart_case = 1
101 autocmd InsertEnter * call deoplete#enable()
105 "au FileType markdown,mkd call pencil#init()
106 "au FileType text call pencil#init()
107 "au FileType mail call pencil#init()
108 "au FileType tex call pencil#init()
111 let g:vim_markdown_folding_disabled=1
112 let g:vim_markdown_frontmatter=1
113 let g:vim_markdown_math=1
116 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
117 " Some filetype settings
120 au BufRead,BufNewFile ~/.mutt/tmp/*mutt-* set filetype=mail
121 au BufRead,BufNewFile *.muttrc set filetype=muttrc
123 au BufRead,BufNewFile *.cls set filetype=tex
126 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
127 " Some filetype-specific settings
129 au FileType text,markdown,mail,tex,gitcommit,mediawiki,vimwiki setlocal spell
130 au FileType text,markdown,mail,gitcommit,mediawiki,vimwiki set fo+=n
132 au Filetype go set shiftwidth=8 tabstop=8 noexpandtab
133 au Filetype tex set shiftwidth=2 tabstop=2
135 au FileType mediawiki setlocal wrap linebreak tw=0
138 au Filetype mail syn match Statement /^\s*-*\s*>8\s*-*\s*$/
139 au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/
141 " Line wrap crippled with numbers shown
142 au Filetype man set nonumber
145 au FileType java setlocal omnifunc=javacomplete#Complete
146 au FileType java JCEnable
147 " See https://github.com/artur-shaik/vim-Javacomplete2
149 nmap <F4> <Plug>(JavaComplete-Imports-AddSmart)
150 imap <F4> <Plug>(JavaComplete-Imports-AddSmart)
151 " <C-j>ii <leader>jii
152 nmap <F5> <Plug>(JavaComplete-Imports-Add)
153 imap <F5> <Plug>(JavaComplete-Imports-Add)
155 nmap <F6> <Plug>(JavaComplete-Imports-AddMissing)
156 imap <F6> <Plug>(JavaComplete-Imports-AddMissing)
158 nmap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
159 imap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
162 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
163 " Some plugin-specific settings
165 au FileType markdown call RagtagInit()
167 let g:detectspelllang_langs = {}
168 let g:detectspelllang_langs.aspell =[ 'en_US', 'de_AT']
169 au BufReadPost * :DetectIndent
171 au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.'
172 au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.'
174 au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh'
175 au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp'
177 :let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'],
178 \ ['|', 'OBSOLETE(o)', 'WONT(n)'],
181 let g:vimwiki_list = [{'path': '~/.vimwiki/',
182 \ 'template_path': '~/.vim/vimwiki/templates',
183 \ 'template_default': 'default',
184 \ 'template_ext': '.html'}]
187 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
192 if filereadable($HOME . '/.vim/init-local.vim')
193 source ~/.vim/init-local.vim