neovim-config/lua/plugins/whichkey.lua

31 lines
753 B
Lua

return {
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
config = function()
local wk = require("which-key")
-- f key register
wk.register({
f = {
name = "Files",
b = { "<cmd>Telescope buffers<cr>", "Find Buffer" },
f = { "<cmd>Telescope find_files<cr>", "Find File" },
r = { "<cmd>Telescope oldfiles<cr>", "Open Recent File" },
s = { "<cmd>Telescope live_grep<cr>", "Search Word" },
t = { "<cmd>Telescope tags<cr>", "Find Tag" },
w = { "<cmd>Telescope grep_string<cr>", "Find Word" },
}
}, { prefix = "<leader>" })
-- q key register
wk.register({
q = {"<cmd>bdelete<cr>", "Close Buffer"}
}, { prefix = "<leader>" })
end
}