-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid creating default keymaps #39
Comments
I can see adding a But before changing anything, what are your thoughts on the current behavior where default mappings are only created if no mapping to the |
I’d be okay with that solution for buffer specific mappings. That sounds reasonable, but I’m not quite as sure for global mappings. If the user doesn’t want the mapping at all, and would prefer to just run Admittedly, I’m biased towards letting the user configure mappings themselves since that’s always felt more “vim” to me 🤷 Maybe separate options for |
With the current behavior, a global keybindings can be disabled by remapping a key to itself, e.g. I do think this is a bit unintuitive and I'm currently leaning towards adding a |
Yeah, I think that's fair and mainly why I wanted to discuss options. How about the following:
I think |
The problem with this approach is that it relies on the order in which plugins load, if two of them are trying to grab the same mapping. And that's not always predictable... FWIW I would prefer a simple boolean of By the way, I'm not sure |
The Global keymaps should be configured only by request, in a config option, never by default. I'd only make an excuse for plugins where the keymap is the entire point of the plugin — i.e. something like Surround or Sneak (or Unimpaired, or something that provide extra text objects). When I first discovered this, I just disabled dirbuf for a while instead of trying to figure how to change the keymap. I mean, all it was doing was exploding my current buffer and producing a ton of error messages, anyway. Users who do this might not stick around to find all the good that the plugin has to offer! |
Personally, I tend to like to configure keymaps on my own (or have the ability to override defaults). The buffer-specific keymaps are fine, but the global mapping on
-
sometimes interferes (rarely) with my use of macros. I can contribute a PR, but I'll wait for feedback/discussion, since changing defaults might break other users' configs.Possible solutions:
mapping
table that gets used to setup mappings indirbuf
. To override defaults, simply set the default values tonil
. This is similar to how many other neovim plugins handle mappings (seetelescope
, etc).on_attach
function (similar to howlspconfig
, etc handles mappings) as mentioned in Feature: Ability to pass anon_attach
function to set customdirbuf
buffer keymaps #38. This feels simpler? And I like the flexibility of anon_attach
hook in general.The text was updated successfully, but these errors were encountered: