]> git.sthu.org Git - vimconf.git/blob - init.vim
plugins: Add languagetool
[vimconf.git] / init.vim
1 " My personal vim, nvim, gvim configuration
2 " Author: Stefan Huber <shuber@sthu.org>
3
4
5 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
6 " Some global settings
7
8 set nocompatible
9 set number
10 set cursorline
11 set scrolloff=5
12
13 set encoding=utf-8
14
15 set fillchars=vert:│,fold:\
16 set listchars=tab:»­,trail:·,eol:$
17 set virtualedit=block
18
19 filetype plugin indent on
20
21 set tabstop=4
22 set shiftwidth=4
23 set expandtab
24 set smarttab
25
26 set autoindent
27 set smartindent
28
29 set incsearch
30 set hlsearch
31
32 set foldcolumn=4
33 set foldlevelstart=20
34
35 set colorcolumn=+1
36 set mouse=a
37 set wildmenu
38 set wildmode=longest,list:full
39 set showcmd
40
41 set tabpagemax=100
42
43 syntax on
44
45 if filereadable($HOME . '/.vim/lowendbox')
46 let g:lowendbox = 1
47 else
48 let g:lowendbox = 0
49 endif
50
51 runtime macros.vim
52 runtime keymaps.vim
53 runtime plugsetup.vim
54
55
56 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
57 " Some filetype-specific settings
58
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:\|,
64
65 au Filetype go setlocal shiftwidth=8 tabstop=8 noexpandtab
66 au Filetype tex setlocal shiftwidth=2 tabstop=2
67
68 au FileType mediawiki setlocal wrap linebreak textwidth=0
69
70 "git scissor line
71 au Filetype mail syn match Statement /^\s*-*\s*>8\s*-*\s*$/
72 au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/
73
74 " Line wrap crippled with numbers shown
75 au Filetype man setlocal nonumber
76
77 au BufNewFile *.{h,hpp,hxx} call AddIncludeGuards()
78
79 au FileType cpp,c packadd termdebug
80
81 augroup autofoldcolumn
82 au!
83 au CursorHold,BufWinEnter * AutoOrigamiFoldColumn
84 augroup END
85
86
87 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
88 " General settings
89
90
91 " Attention: Must be run after plugsetup.vim
92 " Trailing whitespace
93 highlight default link BadWhitespace SpellCap
94
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"
100 if !&readonly
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
106 endif
107 endfunction
108
109 " Make trailing whitespace be flagged as bad.
110 au BufRead,BufNewFile * call SetBadWhitespaceSyntax()
111
112 " termdebug split windows
113 let g:termdebug_wide = 1
114 let termdebugger = $HOME . '/.vim/gdb.sh'
115
116
117 if filereadable($HOME . '/.vim/init-local.vim')
118 source ~/.vim/init-local.vim
119 endif