1 " My personal vim, nvim, gvim configuration
2 " Author: Stefan Huber <shuber@sthu.org>
5 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
15 set fillchars=vert:│,fold:\
16 set listchars=tab:»,trail:·,eol:$
19 filetype plugin indent on
38 set wildmode=longest,list:full
44 if filereadable($HOME . '/.vim/lowendbox')
55 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
56 " Some filetype-specific settings
58 au FileType text,markdown,asciidoc,mail,gitcommit,mediawiki,vimwiki,tex setlocal spell
59 au FileType text,markdown,asciidoc,mail,gitcommit,mediawiki,vimwiki setlocal formatoptions+=n
60 au Filetype mail setlocal formatoptions+=o
61 " Add | for block quotation, such that gq respects it
62 au Filetype mail setlocal comments+=n:\|,
64 au Filetype go setlocal shiftwidth=8 tabstop=8 noexpandtab
65 au Filetype tex setlocal shiftwidth=2 tabstop=2
67 au FileType mediawiki setlocal wrap linebreak textwidth=0
70 au Filetype mail syn match Statement /^\s*-*\s*>8\s*-*\s*$/
71 au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/
73 " Line wrap crippled with numbers shown
74 au Filetype man setlocal nonumber
76 au BufNewFile *.{h,hpp,hxx} call AddIncludeGuards()
78 au FileType cpp,c packadd termdebug
80 augroup autofoldcolumn
82 au CursorHold,BufWinEnter * AutoOrigamiFoldColumn
86 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
90 " Attention: Must be run after plugsetup.vim
92 highlight default link BadWhitespace SpellCap
94 " Setup BadWhitespace syntax match expressions.
95 function SetBadWhitespaceSyntax()
96 " Do not expose bad whitespace in help buffers or for man pages. Or, more
97 " generally, if we open the file readonly.
98 "if &ft != "help" && &ft != "man"
100 " Make trailing whitespace be flagged as bad.
101 syn match BadWhitespace /\s\+$/ containedin=ALL
102 " Make space before tab be flagged as bad and vice versa
103 syn match BadWhitespace / \+\t/ containedin=ALL
104 syn match BadWhitespace /\t \+/ containedin=ALL
108 " Make trailing whitespace be flagged as bad.
109 au BufRead,BufNewFile * call SetBadWhitespaceSyntax()
111 " termdebug split windows
112 let g:termdebug_wide = 1
113 let termdebugger = $HOME . '/.vim/gdb.sh'