mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 17:58:51 +02:00
feat(which-key): easier integration for which-key group names
This commit is contained in:
parent
29ec138f8e
commit
df94a044ec
2 changed files with 18 additions and 10 deletions
|
@ -218,11 +218,7 @@ return {
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {
|
opts = {
|
||||||
plugins = { spelling = true },
|
plugins = { spelling = true },
|
||||||
},
|
defaults = {
|
||||||
config = function(_, opts)
|
|
||||||
local wk = require("which-key")
|
|
||||||
wk.setup(opts)
|
|
||||||
local keymaps = {
|
|
||||||
mode = { "n", "v" },
|
mode = { "n", "v" },
|
||||||
["g"] = { name = "+goto" },
|
["g"] = { name = "+goto" },
|
||||||
["gz"] = { name = "+surround" },
|
["gz"] = { name = "+surround" },
|
||||||
|
@ -239,11 +235,12 @@ return {
|
||||||
["<leader>u"] = { name = "+ui" },
|
["<leader>u"] = { name = "+ui" },
|
||||||
["<leader>w"] = { name = "+windows" },
|
["<leader>w"] = { name = "+windows" },
|
||||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||||
}
|
},
|
||||||
if Util.has("noice.nvim") then
|
},
|
||||||
keymaps["<leader>sn"] = { name = "+noice" }
|
config = function(_, opts)
|
||||||
end
|
local wk = require("which-key")
|
||||||
wk.register(keymaps)
|
wk.setup(opts)
|
||||||
|
wk.register(opts.defaults)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -199,6 +199,17 @@ return {
|
||||||
{
|
{
|
||||||
"folke/noice.nvim",
|
"folke/noice.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
dependencies = {
|
||||||
|
-- which key integration
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
if require("lazyvim.util").has("noice.nvim") then
|
||||||
|
opts.defaults["<leader>sn"] = { name = "+noice" }
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
opts = {
|
opts = {
|
||||||
lsp = {
|
lsp = {
|
||||||
override = {
|
override = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue