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
au FileType text,markdown,mail,tex,gitcommit,mediawiki,vimwiki setlocal spell
au FileType text,markdown,mail,gitcommit,mediawiki,vimwiki set fo+=n
-au Filetype tex set shiftwidth=2
+au Filetype go set shiftwidth=8 tabstop=8 noexpandtab
+au Filetype tex set shiftwidth=2 tabstop=2
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
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:.'