From 85d7d7c082bd84d3c701ceec3d477ee37db5c827 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Sun, 18 Feb 2024 08:19:51 +0100 Subject: bootstrap --- lua/plugins/core/which-key.lua | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lua/plugins/core/which-key.lua (limited to 'lua/plugins/core/which-key.lua') diff --git a/lua/plugins/core/which-key.lua b/lua/plugins/core/which-key.lua new file mode 100644 index 0000000..6e046a3 --- /dev/null +++ b/lua/plugins/core/which-key.lua @@ -0,0 +1,45 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + + opts = { + f = { name = "File" }, + b = { + name = "Buffer", + n = { "BufferNext", "Next" }, + p = { "BufferPrevious", "Previous" }, + c = { "BufferClose", "Close" }, + ["1"] = { "BufferGoto 1", "1" }, + ["2"] = { "BufferGoto 2", "2" }, + ["3"] = { "BufferGoto 3", "3" }, + ["4"] = { "BufferGoto 4", "4" }, + ["5"] = { "BufferGoto 5", "5" }, + ["6"] = { "BufferGoto 6", "6" }, + ["7"] = { "BufferGoto 7", "7" }, + ["8"] = { "BufferGoto 8", "8" }, + ["9"] = { "BufferGoto 9", "9" }, + }, + l = { + name = "LSP", + a = { "lua vim.lsp.buf.code_action()", "Action" }, + f = { "lua vim.lsp.buf.format({ async = false, timeout_ms = 5000 })", "Format" }, + d = { "lua vim.diagnostic.open_float()", "Diagnostic" }, + h = { "lua vim.lsp.buf.hover()", "Help" }, + g = { + name = "Go to", + D = { "lua vim.lsp.buf.declaration()", "Go to declaration" }, + d = { "lua vim.lsp.buf.definition()", "Go to definition" }, + i = { "lua vim.lsp.buf.definition()", "Go to implementation" }, + }, + }, + }, + + config = function(_, opts) + local wk = require("which-key") + wk.register(opts, { prefix = "" }) + end, +} -- cgit v1.2.3