-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
226 lines (193 loc) · 7.11 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
"colorscheme Tomorrow-Night-Eighties
"colorscheme Monokai
"colorscheme molokai_dark
colorscheme murphy
filetype indent plugin on
syntax enable
" set leader key
" german keyboard -> ä is easy to reach and should not be mapped for anything
" other because it is a weird letter
let mapleader="ä"
" tmux support
set term=xterm-256color
set ttymouse=sgr
" indentation and formatting
"set autoindent
set number
set tabstop=4
set shiftwidth=4
set softtabstop=4
set noexpandtab
set smarttab
set list
set listchars=tab:>-,trail:.,space:·
" number formats: only detect bin and hex - not oct!
set nrformats="bin,hex"
" UI
set termguicolors
" highlight current cursor line
set cursorline
" highlight column of cursor
" set cursorcolumn
" stuff...
set wrap
set showcmd
" Synatx folding is extremely slow...
set foldmethod=manual
" open file unfoleded
set foldlevelstart=200
" activate mouse support
set mouse=a
" smoother scrolling
set ttyfast
set lazyredraw
" search
set incsearch
set hlsearch
" generally ignore case when searching
set ignorecase
" switch to case sensitive search when using a upper case letter
set smartcase
"""""""""""""""""""""
" TagList
let Tlist_Compact_Format = 1
let Tlist_GainFocus_On_ToggleOpen = 1
let Tlist_Close_On_Select = 1
nnoremap <C-l> :TlistToggle<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" airline
" always show status line
set laststatus=2
let g:airline#extensions#tabline#enabled=1
"let g:airline#extensions#hunks#enabled=0
let g:airline#extensions#branch#enabled=1
let g:airline#extensions#syntastic#enabled=1
let g:airline#extensions#syntastic#error_symbol= 'E:'
let g:airline#extensions#syntastic#stl_format_err = '%E{[%e(#%fe)]}'
let g:airline#extensions#syntastic#warning_symbol = 'W:'
let g:airline#extensions#syntastic#stl_format_err = '%W{[%w(#%fw)]}'
"let g:airline_theme='powerlineish'
let g:airline_theme='molokai'
let g:airline_powerline_fonts = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""
" syntastic
"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*
"let g:syntastic_always_populate_loc_list = 1
"let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 1
"let g:syntastic_check_on_wq = 0
"" pylint settings
"let g:syntastic_python_pylint_post_args="--disable=broad-except,import-error,line-too-long,logging-format-interpolation,bad-whitespace,mixed-indentation,invalid-name,missing-docstring,bad-continuation"
""""""""""""""""""""""""""""""""""""
" powerline with pthon3
let g:powerline_pycmd="py3"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" YouCompleteMe settings
let g:ycm_show_diagnostics_ui = 1
"let g:ycm_autoclose_preview_window_after_completion = 1
"let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_max_num_candidates = 30
let g:ycm_max_num_identifier_candidates = 10
" set this to 1 to prevent ycm from starting
"let g:loaded_youcompleteme = 1
let g:ycm_server_python_interpreter="python3"
let g:ycm_python_binary_path="python3"
let g:ycm_global_ycm_extra_conf = "~/.vim/.ycm_extra_conf.py"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""
" command line completion
set wildmenu
set wildmode=list:longest,full
set wildignore=.git,*.pyc,*.o,*.a,*.swp
"""""""""""""""""""""""""""""""""""
" set dir for .swp files
" // means to use the absolute path to the file as the swap file name
" ^= prepends the path to the list of directories
"set dir^=/tmp//
""""""""""""""""""""""""""""""""""
" spell checking
if version >= 700
set spl=en spell
" spellcheck by default off
set nospell
endif
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
" some special key mappings etc.
" switch # and * for searching
nnoremap # *``
nnoremap * #``
" toggle NERDTree
nnoremap T <ESC><ESC>:NERDTreeToggle<CR>
" press <F12> to jump to end of file and add vim modeline - genius!
nmap <F12> Go<ESC>d0o<ESC>Ivim: tabstop=4 shiftwidth=4 noexpandtab<ESC><ESC>äcc0<RIGHT>i <ESC>
" YCM FixIt
nnoremap <Leader>f :YcmCompleter FixIt<CR>
" navigation of splits
nnoremap <C-Up> <C-W><Up>
nnoremap <C-Down> <C-W><Down>
nnoremap <C-Right> <C-W><Right>
nnoremap <C-Left> <C-W><Left>
""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""
" WORKAROUNDS
"""""""""""""""""""""""""""""""""""""""""""""""""""""
augroup Gui
autocmd!
" special keys should only be very subtle (colorized)
autocmd BufEnter,BufRead,BufNewFile,ColorScheme * highlight SpecialKey ctermfg=8
"autocmd BufEnter,BufRead,BufNewFile,ColorScheme * highlight SpecialKey guifg=#505050
" adjust highlight of cursorline
" autocmd BufEnter,Bufread,BufNewFile,ColorScheme * highlight CursorLine cterm=none term=none gui=none
" clear hi of CursorLine
autocmd BufEnter,Bufread,BufNewFile,ColorScheme * highlight clear CursorLine
autocmd BufEnter,Bufread,BufNewFile,ColorScheme * highlight CursorLineNr term=bold cterm=bold gui=bold guifg=#FF6347
" Transparent background!
autocmd BufEnter,BufRead,BufNewFile,ColorScheme * highlight LineNr guibg=NONE
autocmd BufEnter,BufRead,BufNewFile,ColorScheme * highlight Normal guibg=NONE
""""""""""""""""""""""""""""""""""
" CHANGES ONLY FOR COLORSCHEME MONOKAI
"""""""""""""""""""""""""""""""""""
autocmd BufEnter,BufRead,BufNewFile,ColorScheme * highlight Comment guifg=#907d57
autocmd BufEnter,BufRead,BufNewFile,ColorScheme * highlight Special guifg=#8ad000
"""""""""""""""""""""""""""""""""""
" nicer parentheses matching color
autocmd BufEnter,BufRead,BufNewFile,ColorScheme * highlight MatchParen guifg=#FF6347 guibg=#EAEAEA
"autocmd BufEnter,BufRead,BufNewFile,ColorScheme * highlight MatchParen gui=reverse term=reverse cterm=reverse
" detect .c files as cpp because we compile everything as cpp source
autocmd BufNewFile,BufRead *.c set filetype=cpp
augroup END
"""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""
augroup SaveCursor
autocmd!
autocmd BufReadPost * call setpos(".", getpos("'\""))
augroup END
augroup PythonCustom
autocmd!
" (syntax) highlight for keyword 'self'
autocmd FileType python syn match pythonStatement "\(\W\|^\)\@<=self\([\.,)]\)\@="
augroup END
augroup Automation
autocmd!
" automatically remove tailing spaces / tabs when saving
" ! limit this to files where i am sure this will not do harm!
autocmd BufWritePre *.cxx,*.cpp,*.h,*.hpp,*.tpp,*.hxx,*.py %s/\s\+$//e
augroup END
augroup Templates
autocmd!
autocmd BufNewFile *.cxx,*.cpp 0r ~/.vim/vwd_templates/vwd_template.cxx
autocmd BufNewFile *.h 0r ~/.vim/vwd_templates/vwd_template.h
autocmd BufNewFile process_*.py 0r ~/.vim/vwd_templates/process_template.py
autocmd BufNewFile *poll*.json 0r ~/.vim/vwd_templates/poller_template.json
autocmd BufNewFile *dispatch*.json 0r ~/.vim/vwd_templates/dispatcher_template.json
" clear autocmd buffer
" because we might match a second time (already matched with *.cxx or
" *.cpp
" autocmd BufNewFile test.cxx,test.cpp,main.cxx,main.cpp 0r ~/.vim/my_templates/test.cpp
augroup END
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim: tabstop=4 shiftwidth=4 noexpandtab