liuchengxu / space-vim

:four_leaf_clover: Lean & mean spacemacs-ish Vim distribution
https://liuchengxu.github.io/space-vim/
MIT License
2.86k stars 256 forks source link

Cannot cut and paste `dd` during git rebase #424

Closed florentx closed 5 years ago

florentx commented 5 years ago

After f993d4f it's no longer easy to copy paste 1 or more lines during a git-rebase for re-ordering commits.

The usual keys dd or <num>dd no longer work.

liuchengxu commented 5 years ago

d is mapped to drop the commit when in the gitrebase buffer. If you don't want it, just unmap d:

function! UserConfig() abort 
  autocmd FileType gitrebase unmap <buffer> d
endfunction
florentx commented 5 years ago

Well I'm not really fond of this new behavior. I don't like that it shadows some commonly used key bindings.

Maybe it should be off by default, and the user can opt-in for these bindings in his/her configuration ~/.spacevim with a g:spacevim_gitrebase_keybindings = 1 ?

Or the bindings could use a modifier key ? E.g. Control+P / Control+R ... Control+D ...

At least the dd, p and P are standard keys which are useful during a rebase.

On a similar topic: https://www.reddit.com/r/git/comments/6lln75/vim_keybindings_for_interactive_rebase/djupt43/

liuchengxu commented 5 years ago

Well, that makes sense. I have added an option b:spacevim_enable_map for gitrebase buffer, which is disabled by default.