From c4bfb14842799a07a3fb391ee8a654e1c340228e Mon Sep 17 00:00:00 2001 From: johannst Date: Sun, 2 Apr 2017 12:55:07 +0200 Subject: vimrc: disabled swapfile for async buffer; added keymap to quickly switch to async buffer; minor changes --- vimrc | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 433cc6a..db20001 100644 --- a/vimrc +++ b/vimrc @@ -1,7 +1,7 @@ " dotfiles -- vimrc " author: johannst -set nocompatible +set nocompatible inoremap jj let mapleader=";" @@ -30,8 +30,9 @@ Plugin 'majutsushi/tagbar' Plugin 'ctrlpvim/ctrlp.vim' "Plugin 'vim-scripts/OmniCppComplete' Plugin 'vim-scripts/YankRing.vim' +Plugin 'vim-scripts/Clever-Tabs' -call vundle#end() +call vundle#end() "}}} "{{{ Plugin Config @@ -150,12 +151,21 @@ set relativenumber " display relative line numbers set cursorline " cursor line highlighting set cursorcolumn " cursor column highlighting +set virtualedit=block -"set list " show invisible character -set listchars=tab:>-,eol:$,trail:-,precedes:<,extends:> +set list " show invisible character +set listchars=tab:>-,trail:-,precedes:<,extends:> "}}} -"{{{ Basic Movement +"{{{ Default Keymap Shadow + +" lookup word under cursor in man pages +nnoremap +" move current lint at the end of previous line +nnoremap + +"}}} +"{{{ Basic Movement augroup aug:HelpPageKeyMaps autocmd! @@ -182,14 +192,14 @@ cnoremap set foldlevel=0 set foldcolumn=1 -set foldmethod=marker +set foldmethod=marker set foldmarker={{{,}}} augroup aug:FileTypeCommentString autocmd! autocmd FileType vim execute "let b:comment_symbol=\"\\\"\"" autocmd FileType c,cpp execute "let b:comment_symbol=\"//\"" - autocmd FileType sh,config,make,python execute "let b:comment_symbol=\"#\"" + autocmd FileType sh,config,make,python,tcl execute "let b:comment_symbol=\"#\"" autocmd FileType tex,bib execute "let b:comment_symbol=\"%\"" augroup end @@ -203,8 +213,8 @@ augroup end "}}} "{{{ Tabwidth -set expandtab " expand tabs to spaces -set tabstop=8 " number of columns a tab counts +"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 softtabstop=3 " number of columns tab counts in insert mode set shiftround " rounds indent to a multiple of shiftwidth @@ -221,7 +231,7 @@ set matchtime=5 " how many tenths of a second to blink when matchi set matchpairs+=<:> " show matching <> as well nnoremap n :noh -vnoremap r "hy:%s/h/h/gc +execute "vnoremap r \"hy:%s/h/h/gc"repeat('', 4) "}}} "{{{ Buffer & Splits @@ -291,7 +301,7 @@ function! DynamicStatuslineHighlighting() return '' endfunction -let &statusline='' +let &statusline='' let &statusline.='%{DynamicStatuslineHighlighting()}' let &statusline.='[%{g:ModeMap[mode()]}]' let &statusline.=' %t' " file name @@ -406,10 +416,11 @@ if v:version>=800 endfunction let s:gAsyncJobRunning=0 + let g:gAsyncBuffer=0 function! s:AsyncCmdProcessor(...) if a:0 == 0 echom 'AsyncCmdProcessor: no cmd specified' - return + return endif if s:gAsyncJobRunning == 1 @@ -420,7 +431,7 @@ if v:version>=800 let s:gAsyncJobRunning=1 let l:current_buffer = bufnr('%') - let s:async_buffer = s:CreateLogBuffer('async_buffer') + let g:gAsyncBuffer = s:CreateLogBuffer('async_buffer') execute 'b ' . l:current_buffer " concatenate command string @@ -432,11 +443,11 @@ if v:version>=800 let s:gAsyncJob = job_start(l:cmd, { \ 'out_io': 'buffer', - \ 'out_buf': s:async_buffer, + \ 'out_buf': g:gAsyncBuffer, \ 'out_cb': function('s:StdOutCB'), \ 'out_msg': '0', \ 'err_io': 'buffer', - \ 'err_buf': s:async_buffer, + \ 'err_buf': g:gAsyncBuffer, \ 'err_cb': function('s:StdErrCB'), \ 'err_msg': '0', \ 'exit_cb': function('s:JobExitCB') @@ -448,7 +459,7 @@ if v:version>=800 if exists('s:gAsyncJob') return job_status(s:gAsyncJob) . ':' . s:gAsyncJobReturnStatus endif - return '*:*' + return '*:*' endfunction function! s:KillAsyncJob() @@ -493,6 +504,7 @@ if v:version>=800 execute '%d' execute 'setlocal buflisted' execute 'setlocal buftype=nofile' + execute 'setlocal noswapfile' execute 'setlocal wrap' nnoremap :call OpenFirstFileNameMatch() return l:buffer_num @@ -500,8 +512,9 @@ if v:version>=800 command! -complete=file -nargs=* Async call s:AsyncCmdProcessor() nnoremap a :Async + nnoremap ab :execute ':buffer ' . g:gAsyncBuffer nnoremap ak :call KillAsyncJob() - nnoremap fg :Async find . -type f -exec grep -nH {} + + execute "nnoremap fg :Async find . -type f -exec grep -nH {} +"repeat('', 6) endif "}}} -- cgit v1.2.3