diff --git a/nvim/.config/nvim/after/ftplugin/git.vim b/nvim/.config/nvim/after/ftplugin/git.vim index 08b38fe..0e5233f 100644 --- a/nvim/.config/nvim/after/ftplugin/git.vim +++ b/nvim/.config/nvim/after/ftplugin/git.vim @@ -10,11 +10,11 @@ nnoremap gf :call git#git_format_patch() xnoremap gf :call git#git_format_patch_range() nnoremap gl :call git#git_branch_log() nnoremap gL :call git#git_branch_log_pretty() -nnoremap gr :call git#git_rebase_branch() nnoremap gR :call git#git_reflog_restore() nnoremap gn git#git_branch_rename() nnoremap gp git#git_push_commit() +nnoremap gr git#git_rebase_branch() " Jump to sections of diff nnoremap [c ?^@@ diff --git a/nvim/.config/nvim/autoload/git.vim b/nvim/.config/nvim/autoload/git.vim index 65f5e81..8f03ec3 100644 --- a/nvim/.config/nvim/autoload/git.vim +++ b/nvim/.config/nvim/autoload/git.vim @@ -237,14 +237,13 @@ function! git#git_rebase_branch() abort let branch = split(line, "/") if len(branch) == 1 " Handles the case for local branch - execute "keepalt Git rebase " . branch[0] + return ":Git rebase HEAD~" . " --onto " . branch[0] else " Handles the case for remote remotes/remote_name/branch_name let remote = branch[1] let branch = branch[2] - execute "keepalt Git rebase " . remote . "/" . branch + return ":Git rebase HEAD~" . " --onto " . remote . "/" . branch endif - silent execute "keepalt bw" endfunction " Git reflog should be run first before invoking this