First commit
[vimconf.git] / init.vim
1 " My personal vim, nvim, gvim configuration
2 " Author: Stefan Huber <shuber@sthu.org>
3
4 set nocompatible
5 set termguicolors
6 set number
7 set cursorline
8 set scrolloff=5
9
10
11 set encoding=utf-8
12
13 set listchars=tab:»­,trail:·,eol:$
14 set virtualedit=block
15
16 set tabstop=4
17 set shiftwidth=4
18 set expandtab
19 set smarttab
20
21 set incsearch
22 set hlsearch
23
24 set colorcolumn=+1
25 set mouse=a
26 set wildmode=longest,list:full
27
28 if has('nvim')
29 set guicursor=
30 end
31
32 syntax on
33 filetype plugin indent on
34 runtime plugsetup.vim
35
36 let g:airline_powerline_fonts=1
37 let g:airline#extensions#tabline#enabled=1
38 let g:airline#extensions#branch#enabled=1
39
40 let g:gruvbox_contrast_light='hard'
41 let g:gruvbox_contrast_dark='hard'
42 let g:gruvbox_italic = 1
43 set bg=dark
44 colorscheme gruvbox
45
46 " let NERDTreeWinPos="right"
47 let NERDTreeHijackNetrw=0
48 let NERDTreeWinSize=22
49 let NERDTreeQuitOnOpen=1
50 "au VimEnter * if !argc() | Startify | NERDTree | wincmd w
51
52 let g:neomake_c_enabled_makers = ['clangtidy', 'clangcheck']
53 let g:neomake_cpp_enabled_makers = ['clangtidy', 'clangcheck']
54
55 call neomake#configure#automake('w')
56 "let g:neomake_logfile = '/tmp/neomake.log'
57
58 let g:clang_compilation_database = '.'
59
60 let g:deoplete#enable_at_startup=1
61
62 "augroup pencil
63 "au!
64 "au FileType markdown,mkd call pencil#init()
65 "au FileType text call pencil#init()
66 "au FileType mail call pencil#init()
67 "au FileType tex call pencil#init()
68 "augroup END
69
70 let g:vim_markdown_folding_disabled=1
71 let g:vim_markdown_frontmatter=1
72 let g:vim_markdown_math=1
73
74 let g:guesslang_langs=[ 'en_US', 'de_AT']
75 au FileType text,markdown,mail,tex setlocal spell
76 au BufReadPost * :DetectIndent
77
78 au BufEnter *.c* let b:fswitchlocs='reg:/lib/include/,rel:.'
79 au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.'
80
81 au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh'
82 au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp'
83
84
85 "git scissor line
86 au Filetype mail syn match Statement /^\s*-*\s*>8\s*-*\s*$/
87 au Filetype mail syn match Statement /^\s*-*\s*8<\s*-*\s*$/
88
89 "mutt and neomutt
90 au BufRead,BufNewFile ~/.mutt/tmp/*mutt-* set filetype=mail
91 au BufRead,BufNewFile *.muttrc set filetype=muttrc
92
93 " Some settings for tex files
94 au BufRead,BufNewFile *.cls set filetype=tex
95 au Filetype tex set shiftwidth=2
96
97 au BufRead,BufNewFile *.plt set filetype=gnuplot
98
99 :let g:org_todo_keywords = [['TODO(t)', 'WAITING(w)', '|', 'DONE(d)'],
100 \ ['|', 'OBSOLETE(o)'],
101 \ ['CANCELED(c)']]
102
103 " Trailing whitespace
104 highlight default link TrailingWhitespace SpellCap
105 " Make trailing whitespace be flagged as bad.
106 au BufRead,BufNewFile * syn match TrailingWhitespace /\s\+$/ containedin=ALL
107
108 runtime macros.vim
109 runtime keymaps.vim
110
111 if filereadable($HOME . '/.vim/init-local.vim')
112 source ~/.vim/init-local.vim
113 endif