X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/8bc36a1369024837a862421a6467bd9336a28070..0cd8afe62b57eb77797b72284be2c5b20cdd8b80:/vimrc diff --git a/vimrc b/vimrc index ceab90e..243745e 100644 --- a/vimrc +++ b/vimrc @@ -18,6 +18,8 @@ set hlsearch " highlight all matches for the last used search nmap n :silent nohl " use leader-# to display the number of matches for the last search nmap # :%s:/::gn +" center cursor after search +nnoremap n nzz set nostartofline " don't move the cursor to the first non-blank char of a line set path=.,** " current + subdirectory search for :find, :grep:, ... @@ -107,6 +109,18 @@ set nrformats=hex " number formats recognized for CTRL-A and CTRL- " whether to use a popup menu for Insert mode completion set completeopt=longest,menuone,preview +" Indent if we're at the beginning of a line. Else, do completion. +function! InsertTabWrapper() + let col = col('.') - 1 + if !col || getline('.')[col - 1] !~ '\k' + return "\" + else + return "\" +endif +endfunction +inoremap =InsertTabWrapper() +inoremap + " fix legacy vi inconsistency map Y y$ @@ -227,15 +241,3 @@ if !exists(":DiffOrig") command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis \ | wincmd p | diffthis endif - -" Indent if we're at the beginning of a line. Else, do completion0. -function! InsertTabWrapper() - let col = col('.') - 1 - if !col || getline('.')[col - 1] !~ '\k' - return "\" - else - return "\" -endif -endfunction -inoremap =InsertTabWrapper() -inoremap