benbrastmckie / .config

NeoVim configuration optimized for writing in LaTeX
331 stars 276 forks source link

WhichKey conflicting keymap exists #126

Closed rafisics closed 4 months ago

rafisics commented 4 months ago

Running :checkhealth, I am getting this following warning:

which-key: require("which-key.health").check()

WhichKey: checking conflicting keymaps ~
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"gc"**
- rhs: ` `

My nvim version:

NVIM v0.10.0
Build type: RelWithDebInfo
LuaJIT 2.1.1713484068
benbrastmckie commented 4 months ago

I cannot reproduce this as I am still on v0.9.5 since I'm running NixOS stable. Is there a particular reason you want to be on v0.10.0? I will consider updating but have little reason to do so aside from fixing this issue.

rafisics commented 4 months ago

No particular reason, I had to reinstall nvim on Ubuntu recently. I prefer using the stable release. So, I used get checkout stable and I ended up with v0.10.0.

benbrastmckie commented 4 months ago

I get that. Have you tried the command :verbose nmap gc? That should tell you if it is being assigned elsewhere.

rafisics commented 4 months ago

:verbose nmap gc gives:

n  gcc         * <Lua 12: vim/_defaults.lua:0>                                                                                               
                 Toggle comment line                                                                                                                   
        Last set from Lua (run Nvim with -V1 for more details)                                                                                         
n  gc          * <Lua 10: vim/_defaults.lua:0>                                                                                                         
                 Toggle comment                                                                                                                        
        Last set from Lua (run Nvim with -V1 for more details)                                                                                         
Press ENTER or type command to continue    

Running nvim -V1 and then :verbose nmap gc gives:

n  gcc         * <Lua 12: vim/_defaults.lua:0>                                                                                               
                 Toggle comment line                                                                                                                   
        Last set from ~/vim/_defaults.lua                                                                                                              
n  gc          * <Lua 10: vim/_defaults.lua:0>                                                                                                         
                 Toggle comment                                                                                                                        
        Last set from ~/vim/_defaults.lua                                                                                                              
Press ENTER or type command to continue     
benbrastmckie commented 4 months ago

You could try unmapping gc and perhaps also gcc by adding the following to the Unmappings section of keymaps.lua:

keymap("n", "gc", "", opts)
keymap("n", "gcc", "", opts)
rafisics commented 4 months ago

Yes, it worked. Thank you.