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