fix(which-key): use new which-key support for native group keymaps (nop)

This commit is contained in:
Folke Lemaitre 2024-06-06 10:46:51 +02:00
parent bac4bba016
commit 8010f50aa5
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
8 changed files with 11 additions and 69 deletions

View file

@ -22,6 +22,7 @@ return {
} }
end, end,
keys = { keys = {
{ "<leader>a", "", desc = "+ai" },
{ {
"<leader>aa", "<leader>aa",
function() function()
@ -66,16 +67,6 @@ return {
end, end,
}, },
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["<leader>a"] = { name = "+ai" },
},
},
},
-- Telescope integration -- Telescope integration
{ {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",

View file

@ -49,17 +49,6 @@ return {
opts = {}, opts = {},
}, },
-- which key integration
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["<leader>d"] = { name = "+debug" },
},
},
},
-- mason.nvim integration -- mason.nvim integration
{ {
"jay-babu/mason-nvim-dap.nvim", "jay-babu/mason-nvim-dap.nvim",
@ -85,6 +74,7 @@ return {
-- stylua: ignore -- stylua: ignore
keys = { keys = {
{ "<leader>d", "", desc = "+debug" },
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" }, { "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" }, { "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" }, { "<leader>dc", function() require("dap").continue() end, desc = "Continue" },

View file

@ -50,14 +50,8 @@ return {
update_n_lines = "gzn", -- Update `n_lines` update_n_lines = "gzn", -- Update `n_lines`
}, },
}, },
}, keys = {
{ { "gz", "", desc = "+surround" },
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["gz"] = { name = "+surround" },
},
}, },
}, },

View file

@ -7,6 +7,7 @@ return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
}, },
keys = { keys = {
{ "<leader>r", "", desc = "+refactor" },
{ {
"<leader>rs", "<leader>rs",
function() function()
@ -124,15 +125,4 @@ return {
end end
end, end,
}, },
-- which key integration
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["<leader>r"] = { name = "+refactor" },
},
},
},
} }

View file

@ -5,15 +5,6 @@ return {
root = { ".latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" }, root = { ".latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" },
}) })
end, end,
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["<localLeader>l"] = { name = "+vimtex" },
},
},
},
-- Add BibTeX/LaTeX to treesitter -- Add BibTeX/LaTeX to treesitter
{ {
@ -38,6 +29,9 @@ return {
vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog" vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
end, end,
keys = {
{ "<localLeader>l", "", desc = "+vimtext" },
},
}, },
-- Correctly setup lspconfig for LaTeX 🚀 -- Correctly setup lspconfig for LaTeX 🚀

View file

@ -1,15 +1,6 @@
return { return {
recommended = true, recommended = true,
desc = "Neotest support. Requires language specific adapters to be configured. (see lang extras)", desc = "Neotest support. Requires language specific adapters to be configured. (see lang extras)",
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["<leader>t"] = { name = "+test" },
},
},
},
{ {
"nvim-neotest/neotest", "nvim-neotest/neotest",
dependencies = { "nvim-neotest/nvim-nio" }, dependencies = { "nvim-neotest/nvim-nio" },
@ -110,6 +101,7 @@ return {
end, end,
-- stylua: ignore -- stylua: ignore
keys = { keys = {
{"<leader>t", "", desc = "+test"},
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, { "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
{ "<leader>tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" }, { "<leader>tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" },
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, { "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest" },

View file

@ -266,16 +266,6 @@ return {
main = "ibl", main = "ibl",
}, },
-- Displays a popup with possible key bindings of the command you started typing
{
"folke/which-key.nvim",
opts = function(_, opts)
if LazyVim.has("noice.nvim") then
opts.defaults["<leader>sn"] = { name = "+noice" }
end
end,
},
-- Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu. -- Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
{ {
"folke/noice.nvim", "folke/noice.nvim",
@ -309,6 +299,7 @@ return {
}, },
-- stylua: ignore -- stylua: ignore
keys = { keys = {
{ "<leader>sn", "", desc = "+noice"},
{ "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" }, { "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
{ "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" }, { "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" }, { "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },