From 2de245f6cee6463943d12b29e6ef8ce260568c95 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Fri, 28 Apr 2017 15:25:51 +0200 Subject: Mainly whitespace and indentation fixes --- vimrc | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/vimrc b/vimrc index ab22a28..78f34a1 100644 --- a/vimrc +++ b/vimrc @@ -17,6 +17,7 @@ Plug 'jlanzarotta/bufexplorer' " Plug 'wting/gitsessions.vim' Plug 'rkitover/vimpager' Plug 'mtth/scratch.vim' +Plug 'airblade/vim-rooter' | " makes :lcd changes to projects (git-)root (code-completion, gf, grep, find) nnoremap :ToggleBufExplorer nnoremap :ScratchPreview @@ -123,6 +124,8 @@ nnoremap :TagbarToggle| " bind TagBar to Hotkey Ct " Autocompleter: =====================================. Plug 'Valloric/MatchTagAlways' " highlights the closing tag/brace/... Plug 'Valloric/YouCompleteMe' +let g:ycm_add_preview_to_completeopt = 1 " reuse existing preview window +let g:ycm_autoclose_preview_window_after_insertion = 1 let g:ycm_collect_identifiers_from_tags_files = 1 " Let YCM read tags from Ctags file let g:ycm_seed_identifiers_with_syntax = 1 " Completion for programming language's keyword let g:ycm_complete_in_comments = 1 " Completion in comments @@ -134,7 +137,9 @@ let g:ycm_warning_symbol = '➔' " insert this as a warni let g:ycm_confirm_extra_conf = 0 " security is overrated let g:ycm_key_list_select_completion = [''] let g:ycm_key_list_previous_completion = [''] -let g:ycm_global_ycm_extra_conf = '~/src/.ycm_extra_conf.py' +let g:ycm_global_ycm_extra_conf = '~/src/ycm_extra_conf.py' +let g:ycm_semantic_triggers = { 'c': [ 're!.' ] } +" 'cmake -D CMAKE_EXPORT_COMPILE_COMMANDS=1 ..' can be used to generate a .ycm-extra.conf compatible json file " disable -key for YCM so that it can be used with ultisnips " let g:ycm_key_list_select_completion=[] " let g:ycm_key_list_previous_completion=[] @@ -204,6 +209,7 @@ Plug 'SirVer/ultisnips' " replaces loremipsum (and " Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) " Plug 'tpope/vim-repeat' | " lets . (dot) repeat plugin macros as well, specifically vim-surround + call plug#end() | " all plugins are getting loaded on this line, don't remove! filetype on @@ -297,18 +303,23 @@ set ts=4 sts=4 sw=4 expandtab | " better done with a modeline set ttimeoutlen=10 | " set esc key timeout in ms- set updatetime=1000 | " updates the screen more often set writedelay=0 +set lcs+=space:· | " local space char if has("multi_byte") scriptencoding utf-8 | " tell vim that we are using utf-8 here set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) set termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those - set listchars=eol:↲ | " symbols used when using :set list (which displays non-printable chars) + + set listchars= | " initialize empty listchars set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) + set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars) set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) - set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) + set listchars+=eol:↲ | " symbols used when using :set list (which displays non-printable chars) + " set listchars+=space:· | " symbols used when using :set list (which displays non-printable chars) set showbreak+=› | " symbol used in the beginning of a wrapped line + set list end if has("gui_running") @@ -343,10 +354,10 @@ if has("autocmd") autocmd BufWritePost $MYVIMRC source $MYVIMRC augroup END " } - " augroup remove_whitespaces " { - " " automatically remove trailing white spaces on save.. - " autocmd BufWritePre * %s/\s\+$//e - " augroup END " } + augroup extra_whitespace + highlight ExtraWhitespace ctermbg=red guibg=red + syn match ExtraWhitespace /\s\+$/ + augroup END augroup set_window_title " { " autocmd BufWinEnter quickfix setl statusline=%t @@ -370,8 +381,8 @@ if has("autocmd") " set cursorline | " use setcursorline in order to highlight non printable chars in the current line autocmd ColorScheme * highlight normal ctermbg=NONE " set list | " shows unprinable characters in the current line - autocmd ColorScheme * highlight NonText ctermbg=NONE ctermfg=0 gui=bold guifg=NONE - autocmd ColorScheme * highlight SpecialKey ctermbg=NONE ctermfg=0 gui=bold guifg=NONE + " autocmd ColorScheme * highlight NonText ctermbg=NONE ctermfg=0 gui=bold guifg=NONE + " autocmd ColorScheme * highlight SpecialKey ctermbg=NONE ctermfg=0 gui=bold guifg=NONE " autocmd ColorScheme * highlight CursorLineNr term=bold ctermbg=NONE ctermfg=0 gui=bold guifg=Yellow " " -- cgit v1.2.3