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
45 if filereadable($HOME . '/.vim/lowendbox')
56 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
57 " Some filetype-specific settings
59 au FileType text,markdown,asciidoc,mail,gitcommit,mediawiki,vimwiki,tex setlocal spell
60 au FileType text,markdown,asciidoc,mail,gitcommit,mediawiki,vimwiki setlocal formatoptions+=n
61 au Filetype mail setlocal formatoptions+=o
62 " Add | for block quotation, such that gq respects it
63 au Filetype mail setlocal comments+=n:\|,
65 au Filetype go setlocal shiftwidth=8 tabstop=8 noexpandtab
66 au Filetype tex setlocal shiftwidth=2 tabstop=2
68 au FileType mediawiki setlocal wrap linebreak textwidth=0
71 au Filetype mail syn match Statement /^\s*-*\s*>8\s*-*\s*$/
72 au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/
74 " Line wrap crippled with numbers shown
75 au Filetype man setlocal nonumber
77 au BufNewFile *.{h,hpp,hxx} call AddIncludeGuards()
79 au FileType cpp,c packadd termdebug
81 augroup autofoldcolumn
83 au CursorHold,BufWinEnter * AutoOrigamiFoldColumn
87 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
91 " Attention: Must be run after plugsetup.vim
93 highlight default link BadWhitespace SpellCap
95 " Setup BadWhitespace syntax match expressions.
96 function SetBadWhitespaceSyntax()
97 " Do not expose bad whitespace in help buffers or for man pages. Or, more
98 " generally, if we open the file readonly.
99 "if &ft != "help" && &ft != "man"
101 " Make trailing whitespace be flagged as bad.
102 syn match BadWhitespace /\s\+$/ containedin=ALL
103 " Make space before tab be flagged as bad and vice versa
104 syn match BadWhitespace / \+\t/ containedin=ALL
105 syn match BadWhitespace /\t \+/ containedin=ALL
109 " Make trailing whitespace be flagged as bad.
110 au BufRead,BufNewFile * call SetBadWhitespaceSyntax()
112 " termdebug split windows
113 let g:termdebug_wide = 1
114 let termdebugger = $HOME . '/.vim/gdb.sh'
117 if filereadable($HOME . '/.vim/init-local.vim')
118 source ~/.vim/init-local.vim