dotfiles/nvim/.config/nvim/after/plugin/fugitive.vim
Sanchayan Maity f05e5bcd5d nvim: after/plugin: fugitive: Add a key mapping for Gedit
Gedit is helpful to open up previous versions of the file. For example,
:Gedit HEAD~3:% loads the current file as it existed 3 commits ago.
2021-05-18 13:11:23 +05:30

32 lines
1.2 KiB
VimL

nnoremap <Leader>ga :Git fetch --all<CR>
xnoremap <Leader>gb :Git blame<CR>
nnoremap <Leader>gb :Git branch -a<CR>
nnoremap <Leader>gB :Git branch<SPACE>
nnoremap <Leader>gc :Git checkout -b<SPACE>
nnoremap <Leader>gC :Git checkout<SPACE>
nnoremap <Leader>gd :Ghdiffsplit!<CR>
nnoremap <Leader>gD :Gvdiffsplit!<CR>
nnoremap <Leader>ge :sp<CR>:Gedit HEAD~:%<Left><Left>
nnoremap <Leader>gE :sp<CR>:Gedit<SPACE>
nnoremap <Leader>gl :Git log --stat %<CR>
nnoremap <Leader>gL :Git log --stat -n 100<CR>
xnoremap <Leader>gl :<C-U>call git#git_log_range()<CR>
xnoremap <Leader>gL :call git#git_log_named_block()<CR>
nnoremap <Leader>gM :Git merge origin/
nnoremap <Leader>go :call git#git_log_compare()<CR>
nnoremap <Leader>gp :Git push<CR>
nnoremap <Leader>gP :Git push -u<SPACE>
nnoremap <Leader>gr :Git rebase origin/master<CR>
nnoremap <Leader>gR :Git rebase origin/main<CR>
nnoremap <Leader>g- :Git stash<CR>:e<CR>
nnoremap <Leader>g+ :Git stash pop<CR>:e<CR>
nnoremap <Leader>gs :Git<CR>
nnoremap <Leader>gS :Git<SPACE>
nnoremap <Leader>gw :Gwrite<CR>
augroup custom_fugitive
autocmd!
autocmd FileType fugitive nnoremap <buffer><silent> q :bwipeout!<CR>
autocmd BufReadPost fugitive:// setlocal bufhidden=delete
augroup END