diff --git a/nvim/lua/settings/lazy/plugins/link-visitor.lua b/nvim/lua/settings/lazy/plugins/link-visitor.lua index c786aa2..2dc2e5d 100644 --- a/nvim/lua/settings/lazy/plugins/link-visitor.lua +++ b/nvim/lua/settings/lazy/plugins/link-visitor.lua @@ -7,4 +7,37 @@ return { skip_confirmation = true, border = "rounded", }, + config = function() + local whichKey = require("which-key") + + whichKey.register({ + ["v"] = { + name = "Visit link", + v = { + function() + require("link-visitor").visit() + end, + "Visit", + }, + l = { + function() + require("link-visitor").link_under_cursor() + end, + "Under cursor", + }, + n = { + function() + require("link-visitor").link_near_cursor() + end, + "Near cursor", + }, + N = { + function() + require("link-visitor").link_nearest() + end, + "Near cursor", + }, + }, + }) + end } diff --git a/nvim/lua/settings/lazy/plugins/nvim-lspconfig.lua b/nvim/lua/settings/lazy/plugins/nvim-lspconfig.lua index 832e62b..b47763a 100644 --- a/nvim/lua/settings/lazy/plugins/nvim-lspconfig.lua +++ b/nvim/lua/settings/lazy/plugins/nvim-lspconfig.lua @@ -19,89 +19,89 @@ return { ["l"] = { name = "LSP", d = { - name = "Diagnostic", + name = "LSP Diagnostic", o = { function() vim.diagnostic.open_float() end, - "Open", + "Open LSP diagnostic", }, p = { function() vim.diagnostic.goto_prev() end, - "Previous", + "Previous LSP diagnostic", }, n = { function() vim.diagnostic.goto_next() end, - "Next", + "Next LSP diagnostic", }, }, b = { - name = "File", - d = { + name = "LSP Buffer", + D = { function() vim.lsp.buf.declaration() end, - "Declaration", + "Go to symbol declaration", buffer = ev.buf, }, - D = { + d = { function() vim.lsp.buf.definition() end, - "Definition", + "Go to symbol definition", buffer = ev.buf, }, h = { function() vim.lsp.buf.hover() end, - "Hover", + "Hover symbol documentation", buffer = ev.buf, }, i = { function() vim.lsp.buf.implementation() end, - "Implementation", + "Go to symbol implementation", buffer = ev.buf, }, s = { function() vim.lsp.buf.signature_help() end, - "Signature", + "Go to symbol signature", buffer = ev.buf, }, t = { function() vim.lsp.buf.type_definition() end, - "Type definition", + "Go to symbol type definition", buffer = ev.buf, }, r = { function() vim.lsp.buf.rename() end, - "Rename", + "Rename symbol", buffer = ev.buf, }, c = { function() vim.lsp.buf.code_action() end, - "Code action", + "LSP code action", buffer = ev.buf, }, R = { function() vim.lsp.buf.references() end, - "References", + "Go to symbol deferences", buffer = ev.buf, }, f = { @@ -110,7 +110,7 @@ return { async = true, }) end, - "Format", + "Format file", buffer = ev.buf, }, }, diff --git a/nvim/lua/settings/lazy/plugins/nvimtree.lua b/nvim/lua/settings/lazy/plugins/nvimtree.lua index c1b22e7..c2ec511 100644 --- a/nvim/lua/settings/lazy/plugins/nvimtree.lua +++ b/nvim/lua/settings/lazy/plugins/nvimtree.lua @@ -18,5 +18,37 @@ return { dotfiles = false, }, }) + + local whichKey = require("which-key") + + whichKey.register({ + ["n"] = { + name = "NvimTree", + t = { + function() + require("nvim-tree.api").tree.toggle() + end, + "Toggle NvimTree", + }, + f = { + function() + require("nvim-tree.api").tree.focus() + end, + "Focus NvimTree", + }, + e = { + function() + require("nvim-tree.api").tree.expand_all() + end, + "Expand NvimTree", + }, + c = { + function() + require("nvim-tree.api").tree.collapse_all() + end, + "Collapse NvimTree", + }, + }, + }) end, } diff --git a/nvim/lua/settings/lazy/plugins/telescope.lua b/nvim/lua/settings/lazy/plugins/telescope.lua index ea728ed..58c7e7c 100644 --- a/nvim/lua/settings/lazy/plugins/telescope.lua +++ b/nvim/lua/settings/lazy/plugins/telescope.lua @@ -5,5 +5,76 @@ return { }, config = function() require("telescope").setup({}) + + local whichKey = require("which-key") + + whichKey.register({ + ["t"] = { + name = "Telescope", + t = { + function() + require("telescope.builtin").treesitter() + end, + "Explore the Abstract Syntax Tree", + }, + f = { + function() + require("telescope.builtin").find_files() + end, + "Find files", + }, + w = { + function() + require("telescope.builtin").live_grep() + end, + "Find words", + }, + c = { + function() + require("telescope.builtin").colorscheme() + end, + "Find color schemes", + }, + g = { + function() + require("telescope.builtin").git_files() + end, + "Find git files", + }, + l = { + name = "LSP", + e = { + function() + require("telescope.builtin").diagnostics() + end, + "List diagnostics for all open buffers", + }, + r = { + function() + require("telescope.builtin").lsp_references() + end, + "List all references for the word under the cursor", + }, + i = { + function() + require("telescope.builtin").lsp_implementation() + end, + "Go to the implementation of the word under the cursor", + }, + d = { + function() + require("telescope.builtin").lsp_definition() + end, + "Go to the definition of the word under the cursor", + }, + t = { + function() + require("telescope.builtin").lsp_type_definition() + end, + "Go to the type definition of the word under the cursor", + }, + }, + }, + }) end, } diff --git a/nvim/lua/settings/lazy/plugins/which-key.lua b/nvim/lua/settings/lazy/plugins/which-key.lua index b04cd8e..e65535b 100644 --- a/nvim/lua/settings/lazy/plugins/which-key.lua +++ b/nvim/lua/settings/lazy/plugins/which-key.lua @@ -5,130 +5,4 @@ return { vim.o.timeout = true vim.o.timeoutlen = 0 end, - config = function() - local whichKey = require("which-key") - - whichKey.register({ - ["n"] = { - name = "NvimTree", - t = { - function() - require("nvim-tree.api").tree.toggle() - end, - "Toggle", - }, - f = { - function() - require("nvim-tree.api").tree.focus() - end, - "Focus", - }, - e = { - function() - require("nvim-tree.api").tree.expand_all() - end, - "Expand", - }, - c = { - function() - require("nvim-tree.api").tree.collapse_all() - end, - "Collapse", - }, - }, - ["t"] = { - name = "Telescope", - t = { - function() - require("telescope.builtin").treesitter() - end, - "Explore the Abstract Syntax Tree", - }, - f = { - function() - require("telescope.builtin").find_files() - end, - "Find files", - }, - w = { - function() - require("telescope.builtin").live_grep() - end, - "Find words", - }, - c = { - function() - require("telescope.builtin").colorscheme() - end, - "Find color schemes", - }, - g = { - function() - require("telescope.builtin").git_files() - end, - "Find git files", - }, - l = { - name = "LSP", - e = { - function() - require("telescope.builtin").diagnostics() - end, - "List diagnostics for all open buffers", - }, - r = { - function() - require("telescope.builtin").lsp_references() - end, - "List all references for the word under the cursor", - }, - i = { - function() - require("telescope.builtin").lsp_implementation() - end, - "Go to the implementation of the word under the cursor", - }, - d = { - function() - require("telescope.builtin").lsp_definition() - end, - "Go to the definition of the word under the cursor", - }, - t = { - function() - require("telescope.builtin").lsp_type_definition() - end, - "Go to the type definition of the word under the cursor", - }, - }, - }, - ["v"] = { - name = "Visit link", - v = { - function() - require("link-visitor").visit() - end, - "Visit", - }, - l = { - function() - require("link-visitor").link_under_cursor() - end, - "Under cursor", - }, - n = { - function() - require("link-visitor").link_near_cursor() - end, - "Near cursor", - }, - N = { - function() - require("link-visitor").link_nearest() - end, - "Near cursor", - }, - }, - }) - end, }