add common vim bindings

* set up beggining/end of line with H/L
* set surround current word/visually selected word with <leader>"
* set text expansion for @@ marty.oehme@gmail.com - email
* set text expansion for ccopy - copyright notice
* set common typos autocorrection
This commit is contained in:
Marty Oehme 2019-05-21 13:44:44 +02:00
parent 54e31a85ac
commit d3cc983eff

View File

@ -312,13 +312,15 @@ nnoremap <tab> %
nnoremap <tab> %
" select the whole buffer with <leader>-a
map <leader>a ggVG
nnoremap <leader>a ggVG
" quickly edit vimrc with leader+V
map <leader>V :vsp ~/.config/nvim/init.vim<cr>
nnoremap <leader>V :vsp $MYVIMRC<cr>
" 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 <leader>VV :source $MYVIMRC<cr>
" since u undoes, would it not make sense that U redoes?
nnoremap U <C-r>
@ -338,15 +340,11 @@ nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
" 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 <leader>t :vsp .<cr>
nnoremap <leader>T :tabedit .<cr>
" save current buffer with Ctrl-s
" TODO do I need this? I reflexively use :w
nnoremap <C-s> :w<cr>
" open/close NERDtree with leader-e
" whatever method tree has been opened by, leader-e closes it again
nnoremap <leader>e :NERDTreeToggle<CR>