X-Git-Url: https://git.sthu.org/?p=vimconf.git;a=blobdiff_plain;f=init.vim;h=17ed253a14c19622a4dd56b85cb84e69c5ef4eb5;hp=3255e3322a503d45f5163506cfb447da63908e7b;hb=078426c90148ec7d67d02d0d1b1fb3e25af502da;hpb=65b54e4bbdc1527c39189abe439fb9b09ad690ad diff --git a/init.vim b/init.vim index 3255e33..17ed253 100644 --- a/init.vim +++ b/init.vim @@ -40,17 +40,32 @@ end syntax on -" Trailing whitespace -highlight default link TrailingWhitespace SpellCap -" Make trailing whitespace be flagged as bad. -au BufRead,BufNewFile * syn match TrailingWhitespace /\s\+$/ containedin=ALL - - """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Some global plugin settings runtime plugsetup.vim +" Attention: Must be run after plugsetup.vim +" Trailing whitespace +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 * call SetBadWhitespaceSyntax() + let g:airline_powerline_fonts=1 let g:airline#extensions#tabline#enabled=1 let g:airline#extensions#branch#enabled=1 @@ -119,6 +134,9 @@ au FileType mediawiki setlocal wrap linebreak tw=0 au Filetype mail syn match Statement /^\s*-*\s*>8\s*-*\s*$/ au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/ +" Line wrap crippled with numbers shown +au Filetype man set nonumber + """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Some plugin-specific settings