Add git key bindings
This commit is contained in:
13
init.vim
13
init.vim
@@ -136,9 +136,9 @@ nnoremap <c-f> /
|
|||||||
"Search within the whole project
|
"Search within the whole project
|
||||||
nnoremap <c-s-f> <cmd>Rg<cr>
|
nnoremap <c-s-f> <cmd>Rg<cr>
|
||||||
"Move line down (uses vim-unimpaired) (replaced move down, use "j")
|
"Move line down (uses vim-unimpaired) (replaced move down, use "j")
|
||||||
nnoremap <c-j> ddkP
|
nnoremap <c-j> <c-e>
|
||||||
"Move line up (uses vim-unimpaired) (replaced move up, use "k")
|
"Move line up (uses vim-unimpaired) (replaced move up, use "k")
|
||||||
nnoremap <c-k> ddp
|
nnoremap <c-k> <c-y>
|
||||||
"Does not work because of legacy reasons
|
"Does not work because of legacy reasons
|
||||||
" nnoremap <c-m>
|
" nnoremap <c-m>
|
||||||
"Search marks (replaced "j" clone)
|
"Search marks (replaced "j" clone)
|
||||||
@@ -169,9 +169,9 @@ inoremap <c-f> <Esc>/
|
|||||||
"Search within the whole project
|
"Search within the whole project
|
||||||
inoremap <c-s-f> <cmd>Rg<cr>
|
inoremap <c-s-f> <cmd>Rg<cr>
|
||||||
"Move line down (uses vim-unimpaired) (replaced <CR> clone)
|
"Move line down (uses vim-unimpaired) (replaced <CR> clone)
|
||||||
inoremap <c-j> <Esc>ddkPi
|
inoremap <c-j> <Esc>ddpi
|
||||||
"Move line up (uses vim-unimpaired) (replaced start digraph, use command instead)
|
"Move line up (uses vim-unimpaired) (replaced start digraph, use command instead)
|
||||||
inoremap <c-k> <Esc>ddpi
|
inoremap <c-k> <Esc>ddkPi
|
||||||
"Does not work because of legacy reasons
|
"Does not work because of legacy reasons
|
||||||
" inoremap <c-m> <cmd>Marks<cr>
|
" inoremap <c-m> <cmd>Marks<cr>
|
||||||
"Add line below (replaced execute single command in normal)
|
"Add line below (replaced execute single command in normal)
|
||||||
@@ -197,6 +197,11 @@ nnoremap <Leader><space> :nohlsearch<cr>
|
|||||||
"Convert tabs to spaces
|
"Convert tabs to spaces
|
||||||
nnoremap <Leader><Tab> :retab<cr>
|
nnoremap <Leader><Tab> :retab<cr>
|
||||||
|
|
||||||
|
"Git mappings
|
||||||
|
nnoremap ga :Git add %
|
||||||
|
nnoremap gb :Git blame
|
||||||
|
nnoremap gc :Git commit
|
||||||
|
|
||||||
"Map movement keys to Escape
|
"Map movement keys to Escape
|
||||||
inoremap jj <Esc>
|
inoremap jj <Esc>
|
||||||
inoremap jk <Esc>
|
inoremap jk <Esc>
|
||||||
|
|||||||
Reference in New Issue
Block a user