init: Support laststatus=3
[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 " 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
23
24 set tabstop=4
25 set shiftwidth=4
26 set expandtab
27 set smarttab
28
29 set autoindent
30 set smartindent
31
32 set incsearch
33 set hlsearch
34
35 set foldcolumn=4
36 set foldlevelstart=20
37
38 set colorcolumn=+1
39 set mouse=a
40 set wildmenu
41 set wildmode=longest,list:full
42 set showcmd
43
44 set tabpagemax=100
45
46 if has('nvim-0.7')
47 set laststatus=3
48 endif
49
50 syntax on
51
52 if filereadable($HOME . '/.vim/lowendbox')
53 let g:lowendbox = 1
54 else
55 let g:lowendbox = 0
56 endif
57
58 runtime macros.vim
59 runtime keymaps.vim
60 runtime plugsetup.vim
61
62
63 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
64 " Some filetype-specific settings
65
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:\|,
71
72 au Filetype go setlocal shiftwidth=8 tabstop=8 noexpandtab
73 au Filetype tex setlocal shiftwidth=2 tabstop=2
74
75 au FileType mediawiki setlocal wrap linebreak textwidth=0
76
77 "git scissor line
78 au Filetype mail syn match Statement /^\s*-*\s*>8\s*-*\s*$/
79 au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/
80
81 " Line wrap crippled with numbers shown
82 au Filetype man setlocal nonumber
83
84 au BufNewFile *.{h,hpp,hxx} call AddIncludeGuards()
85
86 au FileType cpp,c packadd termdebug
87
88 augroup autofoldcolumn
89 au!
90 au CursorHold,BufWinEnter * AutoOrigamiFoldColumn
91 augroup END
92
93
94 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
95 " General settings
96
97
98 " Attention: Must be run after plugsetup.vim
99 " Trailing whitespace
100 highlight default link BadWhitespace SpellCap
101
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"
107 if !&readonly
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
113 endif
114 endfunction
115
116 " Make trailing whitespace be flagged as bad.
117 au BufRead,BufNewFile * call SetBadWhitespaceSyntax()
118
119 " termdebug split windows
120 let g:termdebug_wide = 1
121 let termdebugger = $HOME . '/.vim/gdb.sh'
122
123
124 if filereadable($HOME . '/.vim/init-local.vim')
125 source ~/.vim/init-local.vim
126 endif