Closed asmodeus812 closed 6 months ago
Yeah, fair points. I won't pretend that the existing API is ideal - I think it would be much nicer to pretty much copy what telescope does, and allow users to bind functions directly.
This isn't something very high on my list right now, but I'd welcome any pull request that goes in the direction of telescope - doesn't need to be you, but if you're up for it I can help point you in the right direction :)
On the nightly
branch you can now set separate insert mode mappings for submit and abort.
@CKolkey this does not however address the initial request. Please revisit the description of this issue, there are more than one issues. And i immediately hit the same issue with master branch. Where if i have even 1 missing keymap, the entire neogit fails to start (with use_default_mappings = false). For example updating to master i was missing "untrack" mapping, and neogit just chokes, and fails to init.
Not addresssed here yet
I would like to customize / provide only a specific set of actions in the keymaps with use_default_keymaps = false, and have only those be mapped for editors, popups, status etc, the ones which remain unused, should not prevent the user from interacting with neogit
I would like to have use_default_keymaps = true, and neogit consider correctly the user config and merge the keymaps against the defaults without duplicate keymaps errors. (obviously if the user's config itself contains duplicates between the different keymap sections, that is fine to throw an error)
@asmodeus812 you didn’t ask me, I’m not a maintainer of this project (only contributed a few small things), but having maintained other projects my recommendation would be to create a separate issue for each issue.
With separate issues you can provide a clean and clear reproduction for each issue (easier to write tests) and people who want to use that style of config can rally behind it (maybe even help fix/implement) as well. Of course the issues can link to each other (and back to this one) since they are similar and related.
Edit: I see https://github.com/NeogitOrg/neogit/issues/1302 has been created, my recommendation would be to split it, since the “true” and “false” cases are quite different. Of course the actual maintainers may have a different opinion, this is just mine.
I suggest we keep this one closed, since it is also containing some issues that are solved already. But for the rest they are all connected to issues with the keybindings. Mostly revolving around how the use_default_keymaps
works.
Description
I have been trying this for a while, but am unable to customize the keymaps for the commit and rebase editors, in any sensible way without breaking neogit, the moment you try to change the defaults the editor panel would refuse to open, from the popup (commit or rebase ones), no errors, it just does not open. Seems like neogit follows maggit bindings a bit too blindly, not considering that unlike emacs vim is modal. Some keymaps are defined in insertmode some are in both insert and normal, some are defined only in normal mode, and there is no way to customize that, and there is no obvious rhyme or reason behind this.
If i change the submit and abort to be
c
, thec
would be bound for bothnormal
andinsertmode
. This is inconsistent with otherkeymaps
actions which are only bound in normal mode. I guess tough luck if your commit message contains the letter "c" in it while you type it out.If i remove an entry from the list of keymaps it also fails to open the either the
commit
orrebase
editors, say i remove thereset message
keybind because i do not care about it, it only works if ALL possible currently existing actions are in the table, for that particular popup/editor.If we have
use_default_keymaps = true
enabled when new actions are added upstream, this will break the user's configuration constantly, due to the reasons presented above.If the
use_default_keymaps = false
and the user likes to simply overridesome
, then he is bombarded with duplicate key actions messages. The reason, if we define key 'x' in status keymaps but it is by default already defined in the popup keymaps, neogit does not reconcile these changes.Neovim version
0.9.4
Operating system and version
Ubuntu 22
Steps to reproduce
Expected behavior
I would like to override the default<c-*> variants to be single keypress, in normal mode., just like any other action.
I would like to customize / provide only a specific set of actions in the keymaps with
use_default_keymaps = false
, and have only those be mapped for editors, popups, status etc, the ones which remain unused, should not prevent the user from interacting with neogitI would like to have
use_default_keymaps = true
, and neogit consider correctly the user config and merge the keymaps against the defaults without duplicate keymaps errors. (obviously if the user's config itself contains duplicates between the different keymap sections, that is fine to throw an error)Actual behavior
Well, the opposite of the expected behaviour.
Minimal config