mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-16 23:33:43 -05:00
Add maps for :Gcommit --fixup/--squash
This commit is contained in:
@@ -1422,7 +1422,6 @@ function! fugitive#BufReadStatus() abort
|
||||
nnoremap <buffer> <silent> a :<C-U>let b:fugitive_display_format += 1<Bar>exe fugitive#BufReadStatus()<CR>
|
||||
nnoremap <buffer> <silent> i :<C-U>let b:fugitive_display_format -= 1<Bar>exe fugitive#BufReadStatus()<CR>
|
||||
nnoremap <buffer> <silent> C :<C-U>Gcommit<CR>:echohl WarningMsg<Bar>echo ':Gstatus C is deprecated in favor of cc'<Bar>echohl NONE<CR>
|
||||
nnoremap <buffer> <silent> cA :<C-U>Gcommit --amend --reuse-message=HEAD<CR>:echohl WarningMsg<Bar>echo ':Gstatus cA is deprecated in favor of ce'<Bar>echohl NONE<CR>
|
||||
nnoremap <buffer> <silent> ca :<C-U>Gcommit --amend<CR>
|
||||
nnoremap <buffer> <silent> cc :<C-U>Gcommit<CR>
|
||||
nnoremap <buffer> <silent> ce :<C-U>Gcommit --amend --no-edit<CR>
|
||||
@@ -3529,6 +3528,10 @@ function! s:ContainingCommit() abort
|
||||
return empty(commit) ? 'HEAD' : commit
|
||||
endfunction
|
||||
|
||||
function! s:SquashArgument() abort
|
||||
return s:Owner(@%)
|
||||
endfunction
|
||||
|
||||
function! s:NavigateUp(count) abort
|
||||
let rev = substitute(s:DirRev(@%)[1], '^$', ':', 'g')
|
||||
let c = a:count
|
||||
@@ -3577,6 +3580,9 @@ function! fugitive#MapJumps(...) abort
|
||||
nnoremap <buffer> <silent> cS :<C-U>exe 'Gvsplit ' . <SID>fnameescape(<SID>ContainingCommit())<CR>
|
||||
nnoremap <buffer> <silent> cO :<C-U>exe 'Gtabedit ' . <SID>fnameescape(<SID>ContainingCommit())<CR>
|
||||
nnoremap <buffer> <silent> cp :<C-U>exe 'Gpedit ' . <SID>fnameescape(<SID>ContainingCommit())<CR>
|
||||
nnoremap <buffer> cf :<C-U>Gcommit --fixup=<C-R>=<SID>SquashArgument()<CR>
|
||||
nnoremap <buffer> cs :<C-U>Gcommit --squash=<C-R>=<SID>SquashArgument()<CR>
|
||||
nnoremap <buffer> cA :<C-U>Gcommit --edit --squash=<C-R>=<SID>SquashArgument()<CR>
|
||||
nmap <buffer> . <SID>: <Plug><cfile><Home>
|
||||
endif
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user