LazyVim / starter

Starter template for LazyVim
Apache License 2.0
1.01k stars 800 forks source link

Unable to remove default which-key keybindings config #92

Open brymon68 opened 2 months ago

brymon68 commented 2 months ago

I am trying to completely disable all default which-key bindings (besides those defined in my keymaps) but have been unsuccessful.

In my plugins/which-key.lua file I have:

return {
  "folke/which-key.nvim",
  event = "VeryLazy",
  init = function()
    vim.o.timeout = true
    vim.o.timeoutlen = 500
  end,
  keys = function()
    return {} -- <--should remove all default mappings
  end
}

I have tried overriding defaults as well as overriding keys but have been unsuccessful. Am I missing something?

rbrgmn commented 2 weeks ago

I use the following hack.

./config/nvim/lua/plugins/default_bindings_disabled.lua:

return {
{
"LazyVim/LazyVim",
opts = {
defaults = {
-- Disable all default key bindings
keymaps = false,
},
},
},
}

This setup will give you complete control over all key mappings in LazyVim, allowing only the ones you define.