X-Git-Url: https://git.sthu.org/?p=vimconf.git;a=blobdiff_plain;f=init.vim;h=ff6dcd8b928ac588727f6c16c9068dd2be793d17;hp=bd44c548a27c725ae3d72609cb51868e96fcfc60;hb=bdcf462cdf79322d74e09c3547ae77bdd5155b25;hpb=d874d9c1be1862c6af8bef5e62e186ba364ef1ef diff --git a/init.vim b/init.vim index bd44c54..ff6dcd8 100644 --- a/init.vim +++ b/init.vim @@ -47,9 +47,24 @@ runtime plugsetup.vim " Attention: Must be run after plugsetup.vim " Trailing whitespace -highlight default link TrailingWhitespace SpellCap +highlight default link BadWhitespace SpellCap + +" Setup BadWhitespace syntax match expressions. +function SetBadWhitespaceSyntax() + " Do not expose bad whitespace in help buffers or for man pages. Or, more + " generally, if we open the file readonly. + "if &ft != "help" && &ft != "man" + if !&readonly + " Make trailing whitespace be flagged as bad. + syn match BadWhitespace /\s\+$/ containedin=ALL + " Make space before tab be flagged as bad and vice versa + syn match BadWhitespace / \+\t/ containedin=ALL + syn match BadWhitespace /\t \+/ containedin=ALL + endif +endfunction + " Make trailing whitespace be flagged as bad. -au BufRead,BufNewFile * syn match TrailingWhitespace /\s\+$/ containedin=ALL +au BufRead,BufNewFile * call SetBadWhitespaceSyntax() let g:airline_powerline_fonts=1 let g:airline#extensions#tabline#enabled=1 @@ -128,7 +143,8 @@ au Filetype man set nonumber au FileType markdown call RagtagInit() -let g:guesslang_langs=[ 'en_US', 'de_AT'] +let g:detectspelllang_langs = {} +let g:detectspelllang_langs.aspell =[ 'en_US', 'de_AT'] au BufReadPost * :DetectIndent au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.'