Coder Social home page Coder Social logo

Comments (6)

GaetanLepage avatar GaetanLepage commented on June 26, 2024

This is the behavior we had before.
We removed it when adding the aforementioned plugins.which-key.registrations option.

That being said, I get your point. I have no major reason to oppose this change.
What do you think @traxys ?

from nixvim.

MattSturgeon avatar MattSturgeon commented on June 26, 2024

I don't feel strongly about this either. It just felt strange that you can use keymaps to register most of your key descriptions, but not all.

Looking ahead, if this is accepted and plugin-specific keymaps get refactored to be consistent with keymap, perhaps plugins.which-key.registrations would become redundant and end up being deprecated?

from nixvim.

GaetanLepage avatar GaetanLepage commented on June 26, 2024

Actually, I remember now.
We used to allow this behavior but decided to remove it.
Basically, one entry in the keymaps option leads to one call of vim.keymap.set.
The latter does not support nil rhs argument. Hence, the behavior for specifying a keymap without an action does not make sense (if you forget about which-key.
We (at least I) don't want our core keymaps option to depend on a third-party plugin.

from nixvim.

MattSturgeon avatar MattSturgeon commented on June 26, 2024

Actually, I remember now. We used to allow this behavior but decided to remove it.

Yeah, this would essentially be reverting that... So I'll appreciate if this is considered "won't fix".

Basically, one entry in the keymaps option leads to one call of vim.keymap.set.

What if the keymaps list used for vim.keymap.set is filtered to remove keymaps without an action? The inverse filter could be used to register which-key descriptions.

I get that this adds complexity, but I think it would be more intuitive.

We (at least I) don't want our core keymaps option to depend on a third-party plugin.

I agree core functionality shouldn't depend on plugins, but I think plugins should be able to enhance core functionality.

I think it would be enough to document that key descriptions have no effect without which-key... Perhaps print a warning if a null-action keymap is defined without which-key being enabled?

from nixvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.