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 " use filetype.lua and do not use filetype.vim for >=neovim-0.7.2
20 let g:do_filetype_lua = 1
21 let g:did_load_filetypes = 0
22 filetype plugin indent on
41 set wildmode=longest,list:full
52 if filereadable($HOME . '/.vim/lowendbox')
63 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
64 " Some filetype-specific settings
66 au FileType text,markdown,asciidoc,mail,gitcommit,mediawiki,vimwiki,tex setlocal spell
67 au FileType text,markdown,asciidoc,mail,gitcommit,mediawiki,vimwiki setlocal formatoptions+=n
68 au Filetype mail setlocal formatoptions+=o
69 " Add | for block quotation, such that gq respects it
70 au Filetype mail setlocal comments+=n:\|,
72 au Filetype go setlocal shiftwidth=8 tabstop=8 noexpandtab
73 au Filetype tex setlocal shiftwidth=2 tabstop=2
75 au FileType mediawiki setlocal wrap linebreak textwidth=0
78 au Filetype mail syn match Statement /^\s*-*\s*>8\s*-*\s*$/
79 au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/
81 " Line wrap crippled with numbers shown
82 au Filetype man setlocal nonumber
84 au BufNewFile *.{h,hpp,hxx} call AddIncludeGuards()
86 au FileType cpp,c packadd termdebug
88 augroup autofoldcolumn
90 au CursorHold,BufWinEnter * AutoOrigamiFoldColumn
94 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
98 " Attention: Must be run after plugsetup.vim
100 highlight default link BadWhitespace SpellCap
102 " Setup BadWhitespace syntax match expressions.
103 function SetBadWhitespaceSyntax()
104 " Do not expose bad whitespace in help buffers or for man pages. Or, more
105 " generally, if we open the file readonly.
106 "if &ft != "help" && &ft != "man"
108 " Make trailing whitespace be flagged as bad.
109 syn match BadWhitespace /\s\+$/ containedin=ALL
110 " Make space before tab be flagged as bad and vice versa
111 syn match BadWhitespace / \+\t/ containedin=ALL
112 syn match BadWhitespace /\t \+/ containedin=ALL
116 " Make trailing whitespace be flagged as bad.
117 au BufRead,BufNewFile * call SetBadWhitespaceSyntax()
119 " termdebug split windows
120 let g:termdebug_wide = 1
121 let termdebugger = $HOME . '/.vim/gdb.sh'
124 if filereadable($HOME . '/.vim/init-local.vim')
125 source ~/.vim/init-local.vim