sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.93k stars 107 forks source link

[Feature] Add `s` and `u` default keybindings? #404

Closed briandipalma closed 1 year ago

briandipalma commented 1 year ago

Just like S and U but to stage/unstage individual files?

sindrets commented 1 year ago

We already have https://github.com/sindrets/diffview.nvim/blob/e91110d2a7f8e2f667666aba6ea089ff823f8748/doc/diffview_defaults.txt#L147

In my opinion there's no reason for stage/unstage file to be two separate mappings. It's never ambiguous which action should be taken. If the file is staged, "unstage" is the only action that can be taken. If the file is unstaged, "stage" is the only action that can be taken. This is why we only offer a toggle for this action. You can of course map this to both s and u if you want.

briandipalma commented 1 year ago

Yeah, I agree, but - is more awkward to type then either s or u. There are multiple keymaps for some of the other operations, maybe adding a default s keymap that toggles would be OK?

sindrets commented 1 year ago

Yeah sure, that makes sense. I initially decided on using the - mapping for the sake of familiarity from vim-fugitive.