diff options
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 29 |
1 files changed, 20 insertions, 9 deletions
@@ -17,6 +17,7 @@ Plug 'jlanzarotta/bufexplorer' | |||
17 | " Plug 'wting/gitsessions.vim' | 17 | " Plug 'wting/gitsessions.vim' |
18 | Plug 'rkitover/vimpager' | 18 | Plug 'rkitover/vimpager' |
19 | Plug 'mtth/scratch.vim' | 19 | Plug 'mtth/scratch.vim' |
20 | Plug 'airblade/vim-rooter' | " makes :lcd changes to projects (git-)root (code-completion, gf, grep, find) | ||
20 | 21 | ||
21 | nnoremap <F12> :ToggleBufExplorer<CR> | 22 | nnoremap <F12> :ToggleBufExplorer<CR> |
22 | nnoremap <F2> :ScratchPreview<CR> | 23 | nnoremap <F2> :ScratchPreview<CR> |
@@ -123,6 +124,8 @@ nnoremap <F9> :TagbarToggle<CR>| " bind TagBar to Hotkey Ct | |||
123 | " Autocompleter: =====================================. | 124 | " Autocompleter: =====================================. |
124 | Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... | 125 | Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... |
125 | Plug 'Valloric/YouCompleteMe' | 126 | Plug 'Valloric/YouCompleteMe' |
127 | let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window | ||
128 | let g:ycm_autoclose_preview_window_after_insertion = 1 | ||
126 | let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file | 129 | let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file |
127 | let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword | 130 | let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword |
128 | let g:ycm_complete_in_comments = 1 " Completion in comments | 131 | let g:ycm_complete_in_comments = 1 " Completion in comments |
@@ -134,7 +137,9 @@ let g:ycm_warning_symbol = '➔' " insert this as a warni | |||
134 | let g:ycm_confirm_extra_conf = 0 " security is overrated | 137 | let g:ycm_confirm_extra_conf = 0 " security is overrated |
135 | let g:ycm_key_list_select_completion = ['<Down>'] | 138 | let g:ycm_key_list_select_completion = ['<Down>'] |
136 | let g:ycm_key_list_previous_completion = ['<Up>'] | 139 | let g:ycm_key_list_previous_completion = ['<Up>'] |
137 | let g:ycm_global_ycm_extra_conf = '~/src/.ycm_extra_conf.py' | 140 | let g:ycm_global_ycm_extra_conf = '~/src/ycm_extra_conf.py' |
141 | let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } | ||
142 | " 'cmake -D CMAKE_EXPORT_COMPILE_COMMANDS=1 ..' can be used to generate a .ycm-extra.conf compatible json file | ||
138 | " disable <tab>-key for YCM so that it can be used with ultisnips | 143 | " disable <tab>-key for YCM so that it can be used with ultisnips |
139 | " let g:ycm_key_list_select_completion=[] | 144 | " let g:ycm_key_list_select_completion=[] |
140 | " let g:ycm_key_list_previous_completion=[] | 145 | " let g:ycm_key_list_previous_completion=[] |
@@ -204,6 +209,7 @@ Plug 'SirVer/ultisnips' " replaces loremipsum (and | |||
204 | " Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) | 209 | " Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) |
205 | " Plug 'tpope/vim-repeat' | " lets . (dot) repeat plugin macros as well, specifically vim-surround | 210 | " Plug 'tpope/vim-repeat' | " lets . (dot) repeat plugin macros as well, specifically vim-surround |
206 | 211 | ||
212 | |||
207 | call plug#end() | " all plugins are getting loaded on this line, don't remove! | 213 | call plug#end() | " all plugins are getting loaded on this line, don't remove! |
208 | 214 | ||
209 | filetype on | 215 | filetype on |
@@ -297,18 +303,23 @@ set ts=4 sts=4 sw=4 expandtab | " better done with a modeline | |||
297 | set ttimeoutlen=10 | " set esc key timeout in ms- | 303 | set ttimeoutlen=10 | " set esc key timeout in ms- |
298 | set updatetime=1000 | " updates the screen more often | 304 | set updatetime=1000 | " updates the screen more often |
299 | set writedelay=0 | 305 | set writedelay=0 |
306 | set lcs+=space:· | " local space char | ||
300 | 307 | ||
301 | if has("multi_byte") | 308 | if has("multi_byte") |
302 | scriptencoding utf-8 | " tell vim that we are using utf-8 here | 309 | scriptencoding utf-8 | " tell vim that we are using utf-8 here |
303 | set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) | 310 | set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) |
304 | set termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those | 311 | set termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those |
305 | set listchars=eol:↲ | " symbols used when using :set list (which displays non-printable chars) | 312 | |
313 | set listchars= | " initialize empty listchars | ||
306 | set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) | 314 | set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) |
307 | set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) | 315 | set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) |
316 | |||
308 | set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars) | 317 | set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars) |
309 | set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) | 318 | set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) |
310 | set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) | 319 | set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars) |
320 | " set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) | ||
311 | set showbreak+=› | " symbol used in the beginning of a wrapped line | 321 | set showbreak+=› | " symbol used in the beginning of a wrapped line |
322 | set list | ||
312 | end | 323 | end |
313 | 324 | ||
314 | if has("gui_running") | 325 | if has("gui_running") |
@@ -343,10 +354,10 @@ if has("autocmd") | |||
343 | autocmd BufWritePost $MYVIMRC source $MYVIMRC | 354 | autocmd BufWritePost $MYVIMRC source $MYVIMRC |
344 | augroup END " } | 355 | augroup END " } |
345 | 356 | ||
346 | " augroup remove_whitespaces " { | 357 | augroup extra_whitespace |
347 | " " automatically remove trailing white spaces on save.. | 358 | highlight ExtraWhitespace ctermbg=red guibg=red |
348 | " autocmd BufWritePre * %s/\s\+$//e | 359 | syn match ExtraWhitespace /\s\+$/ |
349 | " augroup END " } | 360 | augroup END |
350 | 361 | ||
351 | augroup set_window_title " { | 362 | augroup set_window_title " { |
352 | " autocmd BufWinEnter quickfix setl statusline=%t | 363 | " autocmd BufWinEnter quickfix setl statusline=%t |
@@ -370,8 +381,8 @@ if has("autocmd") | |||
370 | " set cursorline | " use setcursorline in order to highlight non printable chars in the current line | 381 | " set cursorline | " use setcursorline in order to highlight non printable chars in the current line |
371 | autocmd ColorScheme * highlight normal ctermbg=NONE | 382 | autocmd ColorScheme * highlight normal ctermbg=NONE |
372 | " set list | " shows unprinable characters in the current line | 383 | " set list | " shows unprinable characters in the current line |
373 | autocmd ColorScheme * highlight NonText ctermbg=NONE ctermfg=0 gui=bold guifg=NONE | 384 | " autocmd ColorScheme * highlight NonText ctermbg=NONE ctermfg=0 gui=bold guifg=NONE |
374 | autocmd ColorScheme * highlight SpecialKey ctermbg=NONE ctermfg=0 gui=bold guifg=NONE | 385 | " autocmd ColorScheme * highlight SpecialKey ctermbg=NONE ctermfg=0 gui=bold guifg=NONE |
375 | " autocmd ColorScheme * highlight CursorLineNr term=bold ctermbg=NONE ctermfg=0 gui=bold guifg=Yellow | 386 | " autocmd ColorScheme * highlight CursorLineNr term=bold ctermbg=NONE ctermfg=0 gui=bold guifg=Yellow |
376 | " | 387 | " |
377 | " | 388 | " |