GithubHelp home page GithubHelp logo

invalid mode shortname about which-key.nvim HOT 12 CLOSED

folke avatar folke commented on May 20, 2024
invalid mode shortname

from which-key.nvim.

Comments (12)

folke avatar folke commented on May 20, 2024 2

Just to be sure you don't call :WhichKey on <leader> right? No need to do that as with vim-which-key.

from which-key.nvim.

klooj avatar klooj commented on May 20, 2024 1

You are correct. When using certain gui's for nvim, they mess with the mapping of leader keys. So I put that in there to take control of the situation. I thought I called that function before loading any plugins but apparently my timing is off. Not a big deal at all though, rarely use a gui anymore.

Getting the perfect portable vimrc is comically similar to whack-a-mole.

from which-key.nvim.

folke avatar folke commented on May 20, 2024

Thank you for reporting. When exactly does this error appear?

Just tried your config and it works. Is there a certain prefix that triggers this error?

from which-key.nvim.

klooj avatar klooj commented on May 20, 2024

hmmm. it happens immediately upon pushing the leader key. maybe there's a leftover parameter or clash somewhere from another which-key plugin. i'll debug some more to isolate it.

from which-key.nvim.

klooj avatar klooj commented on May 20, 2024

It also seems to effect the d and g keys in normal mode. So neither d$ nor gg do anything. I'm kinda stumped.

from which-key.nvim.

klooj avatar klooj commented on May 20, 2024

ok ya that definitely is it.

from which-key.nvim.

folke avatar folke commented on May 20, 2024

@klooj great. Can you show the exact keympaping you had in place that caused this?

I'll see if I can show a warning when someone else has leftovers from vim-which-key and handle it properly

from which-key.nvim.

PSeitz avatar PSeitz commented on May 20, 2024

I had this nnoremap <silent> <Leader> :WhichKey '<Space>'<CR>

from which-key.nvim.

klooj avatar klooj commented on May 20, 2024

fershur. so there were two parts:

first, this is how i set my leader keys. i had to comment out those 4 lines in order for the popup to work. i think it's just a timing thing that could be fixed on my end.
image

second, these are the keymaps i had (they're wrapped in a custom function )
image

from which-key.nvim.

folke avatar folke commented on May 20, 2024

That definitely caused it. You don't need to set any special keymaps for WhichKey to work.
Just pushed a change that shows an error when such a invalid keymap is called, so other users with the same issue will know what to do. Also updated the README.

from which-key.nvim.

folke avatar folke commented on May 20, 2024

Your first 4 lines in the first screenshot are <nop> operations, so if those were loaded AFTER WhichKey, it wouldn't work. But why would you want to add these in, in the first place? :)

from which-key.nvim.

klooj avatar klooj commented on May 20, 2024

this plugin is great. everything is working and I was able to jettison two plugins (vim-peekabo and vim-signature). three plugins for the price one.

fwiw, you may want to use wk.register({["j"] = "which_key_ignore", ["k"] = "which_key_ignore"}) for the example in the readme, so that people who have jk jj kj etc mapped to esc in insert mode can copy paste or at the very least be gently reminded they'll need to do it.

from which-key.nvim.

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.