diff --git a/nvim/.config/nvim/after/plugin/fugitive.vim b/nvim/.config/nvim/after/plugin/fugitive.vim index fd6d9a1..e6b49d8 100644 --- a/nvim/.config/nvim/after/plugin/fugitive.vim +++ b/nvim/.config/nvim/after/plugin/fugitive.vim @@ -14,6 +14,8 @@ nnoremap gF :call git#git_fetch_origin_merge() nnoremap gg :Git nnoremap gh :Git log --grep= nnoremap gH :Git log -G +nnoremap gk :call git#git_review() +nnoremap gK :call git#git_review_fileview() nnoremap gl :Git log --stat % nnoremap gL :Git log --stat -n 100 xnoremap gl :call git#git_log_range() @@ -23,7 +25,7 @@ nnoremap gM :call git#git_merge_origin() nnoremap gn :Git branch -m nnoremap go :call git#git_log_compare() nnoremap gr :call git#git_rebase_origin() -nnoremap gR :call git#git_review() +nnoremap gR :Git rebase --abort nnoremap g- :call git#git_stash():e nnoremap g+ :Git stash pop stash@ nnoremap gs :Git stash list diff --git a/nvim/.config/nvim/autoload/git.vim b/nvim/.config/nvim/autoload/git.vim index d095dd4..364edb8 100644 --- a/nvim/.config/nvim/autoload/git.vim +++ b/nvim/.config/nvim/autoload/git.vim @@ -274,11 +274,19 @@ function! git#git_rebase_origin() abort execute "Git rebase origin/" . default[3] endfunction -" Opens the output of Git diff main... in a tab for review +" Opens the output of Git difftool main... for review function! git#git_review() abort let default = split(trim(system('git symbolic-ref refs/remotes/origin/HEAD')), '/') let current = trim(system("git branch --show-current")) - execute "Gtabedit | Git diff " . default[3] . "..." . current . "| only" + execute "Gtabedit | Git difftool " . default[3] . "..." . current +endfunction + +" Opens the output of Git difftool main... for review. Each +" file is opened in a tab. +function! git#git_review_fileview() abort + let default = split(trim(system('git symbolic-ref refs/remotes/origin/HEAD')), '/') + let current = trim(system("git branch --show-current")) + execute "Git difftool -y " . default[3] . "..." . current endfunction " Generate a helpful name when using Git stash