vim:keys: Add git bindings for add and commit

Also add `g` as prefix to the already existing `:Gcd` binding.
This commit is contained in:
2022-01-20 15:59:45 +01:00
parent 851674efeb
commit dcea7c9531

View File

@@ -106,7 +106,9 @@ vnoremap # y?\V<C-R>=escape(@",'?\')<CR><CR>
nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]' nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
if exists('g:loaded_fugitive') if exists('g:loaded_fugitive')
nnoremap <leader>cd :Gcd<CR> nnoremap <leader>ga :G add -p<CR>
nnoremap <leader>gcc :G commit<CR>
nnoremap <leader>gcd :Gcd<CR>
else else
" only works if a file is already opened " only works if a file is already opened
nnoremap <leader>cd :cd %:h <Bar> cd `git rev-parse --show-toplevel`<CR> nnoremap <leader>cd :cd %:h <Bar> cd `git rev-parse --show-toplevel`<CR>