using the which key add method instead of register

This commit is contained in:
aminnairi
2025-01-05 10:58:08 +01:00
parent 185008bf2b
commit 8575a50773
10 changed files with 10 additions and 17 deletions
@@ -12,7 +12,7 @@ return {
local opts = { noremap = true, silent = true }
local whichKey = require("which-key")
whichKey.register({
whichKey.add({
{ "", "<leader>bcl", desc = "<cmd>BufferCloseAllBuffersLeft<cr>" },
{ "", desc = "<leader>bc" },
{ "", "<leader>bcr", desc = "<cmd>BufferCloseAllBuffersRight<cr>" },
@@ -35,7 +35,7 @@ return {
},
})
require("which-key").register({
require("which-key").add({
{ "<leader>c", "Cloak", },
{ "<leader>ct", ":CloakToggle<CR>", desc = "Toggle" },
{ "<leader>cd", ":CloakDisable<CR>", desc = "Disable" },
@@ -4,7 +4,7 @@ return {
local whichKey = require("which-key")
local conform = require("conform")
whichKey.register({
whichKey.add({
["<leader>f"] = {
name = "Format",
f = {
@@ -9,7 +9,7 @@ return {
disable_legacy_commands = true
})
whichKey.register({
whichKey.add({
{ "<leader>i", group = "Icon" },
{ "<leader>ie", function() vim.cmd("IconPickerInsert emoji") end, group = "Emoji" },
{ "<leader>is", function() vim.cmd("IconPickerInsert symbols") end, group = "Symbol" },
@@ -11,7 +11,7 @@ return {
local whichKey = require("which-key")
local linkVisitor = require("link-visitor");
whichKey.register({
whichKey.add({
{ "<leader>v", group = "Link", },
{ "<leader>vv", function() linkVisitor.visit() end, },
{ "<leader>vl", function() linkVisitor.link_under_cursor() end, },
@@ -13,7 +13,7 @@ return {
neogit.setup({})
whichKey.register({
whichKey.add({
{ "<leader>g", group = "Neogit", },
{ "<leader>go", function() neogit.open() end, },
})
@@ -18,7 +18,7 @@ return {
end
local on_attach = function(_, buffer)
whichKey.register({
whichKey.add({
{ "<leader>l", group = "LSP" },
{ "<leader>lb", group = "LSP Buffer" },
{ "<leader>lbD", function() vim.lsp.buf.declaration() end, buffer = 1, desc = "Go to symbol declaration" },
@@ -159,7 +159,7 @@ return {
local whichKey = require("which-key")
whichKey.register({
whichKey.add({
{ "<leader>n", group = "NvimTree" },
{ "<leader>nt", function() nvimTreeApi.tree.toggle() end, desc = "Toggle" },
{ "<leader>nf", function() nvimTreeApi.tree.focus() end, desc = "Focus" },
@@ -11,7 +11,7 @@ return {
local whichKey = require("which-key")
whichKey.register({
whichKey.add({
{ "<leader>t", group = "Telescope" },
{ "<leader>th", function() telescopeBuiltin.help_tags() end, desc = "Help Tags" },
{ "<leader>tt", function() telescopeBuiltin.treesitter() end, desc = "Treesitter" },
@@ -6,13 +6,6 @@ return {
vim.o.timeoutlen = 0
end,
config = function()
require("which-key").register({
{ "<C-h>", "<C-w>h", },
{ "<C-l>", "<C-w>l", },
{ "<C-j>", "<C-w>j", },
{ "<C-s>", ":write<CR>", },
{ "<C-q>", ":quitall<CR>", },
{ "<C-k>", "<C-w>k", },
})
-- Nothing here
end
}