nvim: Switch back to gina dropping fugitive

The only purposes we have been using fugitive for is status and commit
which should be equally comfortable with gina. Gina log is really
instantaneous even on big repositories like Linux while fugitive just
freezes vim. For handling hunks, merge and rebase conflicts we anyways
rely on the other plugins.

We use edita so that applications which use $EDITOR internally can work
inside neovim terminal without opening another instance which does not
work with the already running instance. This is required for things like
interactive rebase. See below issue.
https://github.com/lambdalisue/gina.vim/issues/276

We drop fzf-checkout as it isn't that useful anymore since gina allows
easy checkouts for branch or tags easily.
This commit is contained in:
Sanchayan Maity 2020-10-02 13:10:28 +05:30
parent 87ebb6c160
commit d04c8675f9
4 changed files with 147 additions and 32 deletions

View file

@ -1,21 +0,0 @@
nnoremap <Leader>ga :Git fetch --all<CR>
nnoremap <Leader>gl :0Gclog!<CR>
nnoremap <Leader>gL :Gclog!<CR>
nnoremap <Leader>gd :Ghdiffsplit!<CR>
nnoremap <Leader>gD :Gvdiffsplit!<CR>
nnoremap <Leader>gs :Git<CR>
nnoremap <Leader>gS :Git<SPACE>
nnoremap <Leader>gc :Git commit -v -q --signoff<CR>
nnoremap <Leader>gC :Git commit -v -q --signoff %:p<CR>
nnoremap <Leader>gp :Git push<CR>
nnoremap <Leader>gP :Git push -u<SPACE>
nnoremap <Leader>g- :Git stash<CR>:e<CR>
nnoremap <Leader>g+ :Git stash pop<CR>:e<CR>
nnoremap <Leader>gw :Gwrite<CR>
nnoremap <Leader>gM :0,3Git blame<CR>
nnoremap <Leader>gr :Git rebase origin/master<CR>
nnoremap <Leader>gR :Git rebase upstream/master<CR>
" For 3 way merge
nnoremap <Leader>dl :diffget //2<CR>
nnoremap <Leader>dr :diffget //3<CR>

View file

@ -1,9 +0,0 @@
nnoremap <Leader>gbo :GBranches checkout<CR>
nnoremap <Leader>gbt :GBranches track<CR>
nnoremap <Leader>gbc :GBranches create<SPACE>
nnoremap <Leader>gbd :GBranches delete<CR>
nnoremap <Leader>gbm :GBranches merge<CR>
nnoremap <Leader>gto :GTags checkout<CR>
nnoremap <Leader>gtc :GTags create<SPACE>
nnoremap <Leader>gtd :GTags delete<CR>

View file

@ -0,0 +1,145 @@
" Required for opening buffers vertically with gina-patch
set diffopt+=vertical
nnoremap <Leader>ga :Gina add %:p<CR>
nnoremap <Leader>gb :Gina branch<CR>
nnoremap <Leader>gB :Gina branch -a<CR>
nnoremap <Leader>gc :Gina commit<CR>
nnoremap <Leader>gC :Gina checkout -b<SPACE>
nnoremap <Leader>gd :Gina diff -- %<CR>
nnoremap <Leader>gD :Gina diff<CR>
nnoremap <Leader>gf :Gina fetch --all<CR>
nnoremap <Leader>gg :Gina<SPACE>
nnoremap <Leader>gh :Gina patch<CR>
nnoremap <Leader>gl :Gina log :%<CR>
nnoremap <Leader>gL :Gina log<CR>
nnoremap <Leader>gM :Gina merge<SPACE>
nnoremap <Leader>gp :Gina push<CR>
nnoremap <Leader>gP :Gina push --force-with-lease<CR>
nnoremap <Leader>gr :Gina rebase origin/master<CR>
nnoremap <Leader>gR :Gina remote -v<CR>
nnoremap <Leader>gs :Gina status<CR>
nnoremap <Leader>gt :Gina tag<CR>
nnoremap <Leader>gT :Gina tag<SPACE>
nnoremap <Leader>gu :Gina push -u<SPACE>
nnoremap <Leader>g- :Gina stash<CR>:e<CR>
nnoremap <Leader>g+ :Gina stash pop<CR>:e<CR>
" Default options for the specific git commands
call gina#custom#command#option(
\ 'commit', '-v|--verbose'
\)
call gina#custom#command#option(
\ 'patch', '--oneside'
\)
call gina#custom#command#option(
\ 'patch',
\ '--opener', 'split'
\)
call gina#custom#command#option(
\ 'show',
\ '--opener', 'split',
\ '--show-signature'
\)
call gina#custom#command#option(
\ '/\%(status\|commit\)',
\ '-u|--untracked-files'
\)
call gina#custom#command#option(
\ 'status',
\ '-b|--branch'
\)
call gina#custom#command#option(
\ '/\%(branch\|commit\|diff\|log\|status\|tag\)',
\ '--opener', 'split'
\)
" Custom action aliases for gina buffers
call gina#custom#action#alias(
\ '/\%(blame\|log\|reflog\)',
\ 'preview',
\ 'belowright show:commit:preview',
\)
call gina#custom#action#alias(
\ '/\%(blame\|log\|reflog\)',
\ 'changes',
\ 'belowright changes:of:preview',
\)
" Custom key bindings in gina buffers
call gina#custom#mapping#nmap(
\ 'branch', 'bd',
\ ':<C-u>call gina#action#call(''branch:delete'')<CR>',
\ {'noremap': 1, 'silent': 1}
\)
call gina#custom#mapping#nmap(
\ 'branch', 'br',
\ ':<C-u>call gina#action#call(''branch:move:force'')<CR>',
\ {'noremap': 1, 'silent': 1}
\)
call gina#custom#mapping#nmap(
\ 'branch', 'su',
\ ':<c-u>call gina#action#call(''branch:set-upstream-to'')<cr>',
\ {'noremap': 1, 'silent': 1}
\)
call gina#custom#mapping#nmap(
\ 'branch', 'uu',
\ ':<c-u>call gina#action#call(''branch:unset-upstream'')<cr>',
\ {'noremap': 1, 'silent': 1}
\)
call gina#custom#mapping#nmap(
\ 'commit', 'gs',
\ ':<C-u>Gina status<CR>',
\ {'noremap': 1, 'silent': 1}
\)
call gina#custom#mapping#nmap(
\ 'status', 'cc',
\ ':<C-u>Gina commit<CR>',
\ {'noremap': 1, 'silent': 1}
\)
call gina#custom#mapping#nmap(
\ 'status', 'ga',
\ ':<C-u>call gina#action#call(''add'')<CR>',
\ {'noremap': 1, 'silent': 1}
\)
call gina#custom#mapping#nmap(
\ '/\%(branch\|log\)', 'co',
\ ':<C-u>call gina#action#call(''commit:checkout'')<CR>',
\ {'noremap': 1, 'silent': 1}
\)
call gina#custom#mapping#nmap(
\ '/\%(branch\|tag\)', 'ct',
\ ':<C-u>call gina#action#call(''commit:checkout:track'')<CR>',
\ {'noremap': 1, 'silent': 1}
\)
call gina#custom#mapping#nmap(
\ '/\%(blame\|log\|reflog\)',
\ 'p',
\ ':<C-u>call gina#action#call(''preview'')<CR>',
\ {'noremap': 1, 'silent': 1}
\)
call gina#custom#mapping#nmap(
\ '/\%(blame\|log\|reflog\)',
\ 'c',
\ ':<C-u>call gina#action#call(''changes'')<CR>',
\ {'noremap': 1, 'silent': 1}
\)
" Set options for gina buffers
call gina#custom#execute(
\ '/\%(ls\|log\|reflog\|grep\)',
\ 'setlocal noautoread',
\)
call gina#custom#execute(
\ '/\%(status\|branch\|ls\|log\|reflog\|grep\)',
\ 'setlocal cursorline',
\)
call gina#custom#execute(
\ 'commit',
\ 'setlocal spell',
\)
call gina#custom#execute(
\ 'commit',
\ 'setlocal textwidth=72',
\)
call gina#custom#execute(
\ 'log',
\ 'setlocal number',
\)

View file

@ -18,12 +18,11 @@ Plug 'steelsojka/completion-buffers'
" For tmux
Plug 'tmux-plugins/vim-tmux-focus-events'
" Git support
Plug 'lambdalisue/gina.vim'
Plug 'rhysd/git-messenger.vim'
Plug 'tpope/vim-fugitive'
Plug 'mhinz/vim-signify'
Plug 'rhysd/conflict-marker.vim'
Plug 'salcode/vim-interactive-rebase-reverse'
Plug 'stsewd/fzf-checkout.vim'
" Boost vim command line mode
Plug 'vim-utils/vim-husk'
" Rainbow Parentheses
@ -63,6 +62,7 @@ Plug 'liuchengxu/vim-which-key'
Plug 'christoomey/vim-system-copy'
" Toggle terminal
Plug 'voldikss/vim-floaterm'
Plug 'lambdalisue/edita.vim'
" Take care of sudo
Plug 'lambdalisue/suda.vim'
" LSP