Giter Site home page Giter Site logo

Comments (8)

dpetka2001 avatar dpetka2001 commented on June 13, 2024

This looks similar to #2193. So that's your answer there.

If you would like to simply just hide the label from which-key menu, you could do ["<leader>f] = which_key_ignore. That doesn't mean that the keymaps are deleted. The top-level key will just not be visible on the menu. If you'd like to remove all the keys, there's no other way than manually deleting them.

If you'd like to change all the <leader>f keys to something else, you can use the plugin that is mentioned in the other issue.

from lazyvim.

gunslingerfry avatar gunslingerfry commented on June 13, 2024

So I've already changed all the f keys one by one. It was a pain, yes, but it's possible so that's not my issue. The problem is that once which key shows everything goes real weird.

So I guess there is two asks/problems:

  1. My request is to disable or override the groups so that normal bindings show in which-key
  2. There is a bug where your mapping over an empty group will get wiped out.

Interestingly, I've found that you could utilize this to have fast and slow bindings. I didn't disable the maps for <leader>b{key} but added my own mapping for <leader>b. If I do the mapping within timeoutlen it uses my binding. If I let timeoutlen expire it pulls up whichkey and uses the group.

edit: I thought the issue on 2 was due to using noremap in the mapping but that was a red herring.

When the issue occurs (where my binding is removed) it is verified removed from the keymap, looking at nmap.

from lazyvim.

dpetka2001 avatar dpetka2001 commented on June 13, 2024

This is specific to which-key, so I'd suggest creating an issue at the repo, since LazyVim has nothing to do with that.

Edit: regarding your second question, it might have to do with this open issue at the repo.

from lazyvim.

gunslingerfry avatar gunslingerfry commented on June 13, 2024

Sorry for the multiple edits. Yes and no. The problem is not with how which-key is generally used. It's only a problem because of the LazyVim which-key defaults. It's hardly a use case for which-key itself to handle someone creating an empty group on a particular mapping and then also creating a mapping on top. The answer would be to not create the empty group. I can't stop the creation of the empty group through the specs that LazyVim provides.

It's sorta related to the empty group thing and it sounds like what @folke was saying about it eating the leader key but in this case the mapping is gone entirely,

from lazyvim.

dpetka2001 avatar dpetka2001 commented on June 13, 2024

Again, this is very similar to #2193 (providing a mechanism to remove pre-configured groups) and the maintainer already gave an answer there (about a configurable single source of keys). My guess is your request falls under the same assumptions as in that issue. I'm just a regular user without a say in the project, so maybe the maintainer has a different opinion on this.

Either way, what I can suggest you is to either use which_key_ignore to hide the specific key you want from the which-key top-level menu (but that won't delete the keymaps and they will still be available) or delete all the keymaps you want and change the which-key defaults to whatever you like.

Edit: You could also take a look into mini.clues and configure that from the start to show exactly what you'd like and disable which-key.

from lazyvim.

gunslingerfry avatar gunslingerfry commented on June 13, 2024

Yeah I think disabling which-key or, perhaps, just mapping the which-key leader key to something else will solve my problem. I think it is a more serious issue that the mappings are changing/disappearing due to the way groups work with which-key though.

from lazyvim.

dpetka2001 avatar dpetka2001 commented on June 13, 2024

That is an issue directed to the which-key repo though, since its codebase is responsible for how to interact with groups. Lazyvim just uses it to define groups and map keys.

from lazyvim.

gunslingerfry avatar gunslingerfry commented on June 13, 2024

Alright I'll create an issue there.

from lazyvim.

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.