From d3cc983eff21f5db20c262613bb0990d75e177ff Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 21 May 2019 13:44:44 +0200 Subject: [PATCH] add common vim bindings * set up beggining/end of line with H/L * set surround current word/visually selected word with " * set text expansion for @@ marty.oehme@gmail.com - email * set text expansion for ccopy - copyright notice * set common typos autocorrection --- .config/nvim/init.vim | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 8a79965..69d69b7 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -312,13 +312,15 @@ nnoremap % nnoremap % " select the whole buffer with -a -map a ggVG +nnoremap a ggVG " quickly edit vimrc with leader+V -map V :vsp ~/.config/nvim/init.vim +nnoremap V :vsp $MYVIMRC " automatically source the vimrc file whenever it is saved (causes slowdown " when done in MANY successions) " au BufWritePost init.vim so ~/.config/nvim/init.vim +" source vimrc with keystroke combination +nnoremap VV :source $MYVIMRC " since u undoes, would it not make sense that U redoes? nnoremap U @@ -338,15 +340,11 @@ nnoremap W :%s/\s\+$//:let @/='' " automatically on saving " autocmd BufWritePre * :%s/\s\+$//e -" 'open new tab' with leader-t (opens new buffer and switches to it) +" 'open new buffer' with leader-t (opens new buffer and switches to it) " open actual new tab with leader-T nnoremap t :vsp . nnoremap T :tabedit . -" save current buffer with Ctrl-s -" TODO do I need this? I reflexively use :w -nnoremap :w - " open/close NERDtree with leader-e " whatever method tree has been opened by, leader-e closes it again nnoremap e :NERDTreeToggle