From 41024da277d5a4d3128f50b1b3f5e50ab0141b56 Mon Sep 17 00:00:00 2001 From: johannst Date: Mon, 1 May 2017 23:51:01 +0200 Subject: changed vim listchars colors, added autocmd to highlight trailing whitespaces --- vimrc | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index db20001..a52c4fc 100644 --- a/vimrc +++ b/vimrc @@ -38,12 +38,12 @@ call vundle#end() "{{{ Plugin Config let s:gEnabledPlugins = [] -function! s:ParseVimrcForEnabledPlugins() +function! s:ParseVimrcForEnabledPlugins() let l:vimrc = readfile($MYVIMRC) let l:i = 0 while 1 let l:i = match(l:vimrc, '^Plugin', l:i+1) - if l:i == -1 + if l:i == -1 break endif call add(s:gEnabledPlugins, split(l:vimrc[l:i], "'")[1]) @@ -149,12 +149,17 @@ set noautoread " don't automatically re-read changed files. set number " display line numbers set relativenumber " display relative line numbers -set cursorline " cursor line highlighting -set cursorcolumn " cursor column highlighting +"set cursorline " cursor line highlighting +"set cursorcolumn " cursor column highlighting set virtualedit=block set list " show invisible character set listchars=tab:>-,trail:-,precedes:<,extends:> +augroup aug:HighlightTrailingWhitespace + autocmd! + autocmd BufEnter * 2match Error /\s\+$/ + autocmd BufLeave * 2match none +augroup end "}}} "{{{ Default Keymap Shadow @@ -215,7 +220,7 @@ augroup end "set expandtab " expand tabs to spaces set tabstop=3 " number of columns a tab counts -set shiftwidth=3 " number of columns text is indented +set shiftwidth=3 " number of columns text is indented set softtabstop=3 " number of columns tab counts in insert mode set shiftround " rounds indent to a multiple of shiftwidth @@ -239,7 +244,7 @@ execute "vnoremap r \"hy:%s/h/h/gc"repeat('', 4) set hidden " do not unload abandoned buffers noremap q :bd -" navigate between different buffers +" navigate between different buffers nnoremap :bprevious nnoremap :bnext nnoremap :bprevious @@ -299,7 +304,7 @@ function! DynamicStatuslineHighlighting() execute 'hi! StatusLine ctermfg=NONE ctermbg=226 cterm=NONE' endif return '' -endfunction +endfunction let &statusline='' let &statusline.='%{DynamicStatuslineHighlighting()}' @@ -310,7 +315,7 @@ let &statusline.=' [%{&ft}]' "filetype let &statusline.='%=' " seperator between left and right alignment if v:version >= 800 - let &statusline.=' [A:%{GetAsyncJobStatus()}]' + let &statusline.=' [A:%{GetAsyncJobStatus()}]' endif let &statusline.=' [%b:0x%B]' " dec:hex ascii value of char under cursor let &statusline.=' [%l/%L -- %c]' " current line/num of lines -- current columen @@ -441,7 +446,7 @@ if v:version>=800 endfor echom l:cmd - let s:gAsyncJob = job_start(l:cmd, { + let s:gAsyncJob = job_start(l:cmd, { \ 'out_io': 'buffer', \ 'out_buf': g:gAsyncBuffer, \ 'out_cb': function('s:StdOutCB'), @@ -511,7 +516,7 @@ if v:version>=800 endfunction command! -complete=file -nargs=* Async call s:AsyncCmdProcessor() - nnoremap a :Async + nnoremap a :Async nnoremap ab :execute ':buffer ' . g:gAsyncBuffer nnoremap ak :call KillAsyncJob() execute "nnoremap fg :Async find . -type f -exec grep -nH {} +"repeat('', 6) @@ -521,7 +526,7 @@ endif "{{{ Sandbox let s:sandbox_enable = 1 -if s:sandbox_enable +if s:sandbox_enable " TODO: backup file creation " when opening file (of given filetype? maybe start with c/c++) create copy in this file in file_path/.bak/file_name -- cgit v1.2.3