05a7966e846bbeb8ac5319cc5b9c8cc323bf8580
[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 termguicolors
10 set number
11 set cursorline
12 set scrolloff=5
13
14 set encoding=utf-8
15
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 colorcolumn=+1
33 set mouse=a
34 set wildmode=longest,list:full
35
36 if has('nvim')
37 set guicursor=
38 end
39
40 syntax on
41
42
43 " Trailing whitespace
44 highlight default link TrailingWhitespace SpellCap
45 " Make trailing whitespace be flagged as bad.
46 au BufRead,BufNewFile * syn match TrailingWhitespace /\s\+$/ containedin=ALL
47
48
49 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
50 " Some global plugin settings
51
52 runtime plugsetup.vim
53
54 let g:airline_powerline_fonts=1
55 let g:airline#extensions#tabline#enabled=1
56 let g:airline#extensions#branch#enabled=1
57
58 let g:gruvbox_contrast_light='hard'
59 let g:gruvbox_contrast_dark='hard'
60 let g:gruvbox_italic = 1
61 set bg=dark
62 colorscheme gruvbox
63
64 " let NERDTreeWinPos="right"
65 let NERDTreeHijackNetrw=0
66 let NERDTreeWinSize=22
67 let NERDTreeQuitOnOpen=1
68 "au VimEnter * if !argc() | Startify | NERDTree | wincmd w
69
70 let g:neomake_c_enabled_makers = ['clangtidy', 'clangcheck']
71 let g:neomake_cpp_enabled_makers = ['clangtidy', 'clangcheck']
72
73 call neomake#configure#automake('w')
74 "let g:neomake_logfile = '/tmp/neomake.log'
75
76 let g:clang_compilation_database = '.'
77
78 " Speedup deoplete startup time, see deoplete FAQ
79 let g:python3_host_prog = '/usr/bin/python3'
80 " deoplete requires huge startuptime. Delay loading upon first InsertEnter.
81 let g:deoplete#enable_at_startup = 0
82 autocmd InsertEnter * call deoplete#enable()
83
84 "augroup pencil
85 "au!
86 "au FileType markdown,mkd call pencil#init()
87 "au FileType text call pencil#init()
88 "au FileType mail call pencil#init()
89 "au FileType tex call pencil#init()
90 "augroup END
91
92 let g:vim_markdown_folding_disabled=1
93 let g:vim_markdown_frontmatter=1
94 let g:vim_markdown_math=1
95
96
97 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
98 " Some filetype settings
99
100 " mutt and neomutt
101 au BufRead,BufNewFile ~/.mutt/tmp/*mutt-* set filetype=mail
102 au BufRead,BufNewFile *.muttrc set filetype=muttrc
103
104 au BufRead,BufNewFile *.cls set filetype=tex
105
106
107 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
108 " Some filetype-specific settings
109
110 au FileType text,markdown,mail,tex,gitcommit,mediawiki,vimwiki setlocal spell
111 au FileType text,markdown,mail,gitcommit,mediawiki,vimwiki set fo+=n
112
113 au Filetype tex set shiftwidth=2
114
115 au FileType mediawiki setlocal wrap linebreak tw=0
116
117 "git scissor line
118 au Filetype mail syn match Statement /^\s*-*\s*>8\s*-*\s*$/
119 au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/
120
121
122 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
123 " Some plugin-specific settings
124
125 au FileType markdown call RagtagInit()
126
127 let g:guesslang_langs=[ 'en_US', 'de_AT']
128 au BufReadPost * :DetectIndent
129
130 au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.'
131 au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.'
132
133 au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh'
134 au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp'
135
136 :let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'],
137 \ ['|', 'OBSOLETE(o)', 'WONT(n)'],
138 \ ['CANCELED(c)']]
139
140 let g:vimwiki_list = [{'path': '~/.vimwiki/',
141 \ 'template_path': '~/.vim/vimwiki/templates',
142 \ 'template_default': 'default',
143 \ 'template_ext': '.html'}]
144
145
146 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
147
148 runtime macros.vim
149 runtime keymaps.vim
150
151 if filereadable($HOME . '/.vim/init-local.vim')
152 source ~/.vim/init-local.vim
153 endif