nvim: fugitive: Add mapping to view file on another branch
This commit is contained in:
parent
036b6652a9
commit
bcfd9372dc
2 changed files with 6 additions and 0 deletions
|
@ -36,6 +36,7 @@ nnoremap <Leader>G :keepalt Git<SPACE>
|
|||
|
||||
nnoremap <Leader>gp :call git#git_push_to_upstream()<CR>
|
||||
nnoremap <expr> <Leader>gP git#git_push()
|
||||
nnoremap <expr> <Leader>gO git#git_show_file_on_branch()
|
||||
|
||||
augroup custom_fugitive
|
||||
autocmd!
|
||||
|
|
|
@ -289,6 +289,11 @@ function! git#git_review_fileview() abort
|
|||
execute "Git difftool -y " . default[3] . "..." . current
|
||||
endfunction
|
||||
|
||||
" Show file on another branch without changing current branch
|
||||
function! git#git_show_file_on_branch() abort
|
||||
return ":Git show :" . expand("%")
|
||||
endfunction
|
||||
|
||||
" Generate a helpful name when using Git stash
|
||||
function! git#git_stash() abort
|
||||
let current = trim(system("git branch --show-current"))
|
||||
|
|
Loading…
Reference in a new issue