chore: update whichkey syntax

This commit is contained in:
Nydragon 2024-09-21 06:00:25 +02:00
parent c5b4439f66
commit d135fbaf2b
Signed by: nydragon
SSH key fingerprint: SHA256:iQnIC12spf4QjWSbarmkD2No1cLMlu6TWoV7K6cYF5g
2 changed files with 23 additions and 104 deletions

View file

@ -157,12 +157,7 @@ require("lazy").setup({
vim.o.timeout = true vim.o.timeout = true
vim.o.timeoutlen = 300 vim.o.timeoutlen = 300
end, end,
opts = { opts = {},
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "^:", "^ ", "^call ", "^lua " },
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
config = function(_, opts) config = function(_, opts)
require("which-key-config") require("which-key-config")
require("which-key").setup(opts) require("which-key").setup(opts)
@ -316,9 +311,3 @@ vim.diagnostic.config({
}) })
vim.cmd("colorscheme catppuccin") vim.cmd("colorscheme catppuccin")
--vim.api.nvim_create_autocmd({ "VimLeave" }, {
--callback = function()
--vim.cmd("close")
--end,
--})

View file

@ -1,95 +1,25 @@
local wk = require("which-key") local wk = require("which-key")
wk.register({ wk.add({
t = { { "<leader>bt", "<cmd>BlameToggle virtual<cr>", desc = "Toggle Virtual Blame" },
["1"] = { { "<leader>c", desc = "NerdCommenter" },
"<Cmd>BufferGoto 1<CR>", { "<leader>f", desc = "Telescope - Finder" },
"Go to Buffer 1", { "<leader>fb", "<cmd>Telescope buffers<CR>", desc = "Find Open Buffers" },
}, { "<leader>ff", "<cmd>Telescope find_files<CR>", desc = "Find File" },
d = { { "<leader>fg", "<cmd>Telescope live_grep<CR>", desc = "Live Grep" },
"<Cmd>BufferClose<CR>", { "<leader>fh", "<cmd>Telescope help_tags<CR>", desc = "Find Help" },
"Close Current Buffer", { "<leader>fi", "<cmd>Telescope builtin<cr>", desc = "Search all Telescope builtins" },
}, { "<leader>ft", "<cmd>TodoTelescope <cr>", desc = "Open Todo in Telescope" },
}, { "<leader>fu", "<cmd>UrlView<cr>", desc = "Display and open URLs in current buffer" },
f = { { "<leader>n", desc = "Terminal" },
"Telescope - Finder", { "<leader>nb", "<cmd>lua _Lazygit_toggle()<CR>", desc = "Open Lazygit" },
f = { { "<leader>nj", "<cmd>ToggleTerm<CR>", desc = "Open Terminal" },
"<cmd>Telescope find_files<CR>", { "<leader>r", "<cmd>lua vim.lsp.buf.rename()<CR>", desc = "Rename a token" },
"Find File", { "<leader>t1", "<Cmd>BufferGoto 1<CR>", desc = "Go to Buffer 1" },
}, { "<leader>td", "<Cmd>BufferClose<CR>", desc = "Close Current Buffer" },
g = { { "<leader>x", desc = "Toggle Trouble" },
"<cmd>Telescope live_grep<CR>", { "<leader>xl", "<cmd>Trouble loclist toggle<cr>", desc = "" },
"Live Grep", { "<leader>xq", "<cmd>Trouble quickfix toggle<cr>", desc = "" },
}, { "<leader>xr", "<cmd>Trouble lsp_references toggle<cr>", desc = "" },
b = { { "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Open Trouble" },
"<cmd>Telescope buffers<CR>",
"Find Open Buffers",
},
h = {
"<cmd>Telescope help_tags<CR>",
"Find Help",
},
i = {
"<cmd>Telescope builtin<cr>",
"Search all Telescope builtins",
},
t = {
"<cmd>TodoTelescope <cr>",
"Open Todo in Telescope",
},
u = {
"<cmd>UrlView<cr>",
"Display and open URLs in current buffer",
},
},
n = {
"Terminal",
b = {
"<cmd>lua _Lazygit_toggle()<CR>",
"Open Lazygit",
},
j = {
"<cmd>ToggleTerm<CR>",
"Open Terminal",
},
},
c = {
"NerdCommenter",
},
r = {
"<cmd>lua vim.lsp.buf.rename()<CR>",
"Rename a token",
},
x = {
"Toggle Trouble",
x = {
"<cmd>Trouble diagnostics toggle<cr>",
"Open Trouble",
},
q = {
"<cmd>Trouble quickfix toggle<cr>",
"",
},
l = {
"<cmd>Trouble loclist toggle<cr>",
"",
},
r = {
"<cmd>Trouble lsp_references toggle<cr>",
"",
},
},
b = {
t = {
"<cmd>BlameToggle virtual<cr>",
"Toggle Virtual Blame",
},
},
}, { prefix = "<leader>" })
wk.register({
["/"] = {
"<cmd>Telescope current_buffer_fuzzy_find<cr>",
"Search for a string in the current buffer",
},
}) })