From 70c0207d89a7ed24ec39955e32e6c9ebfb741390 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sat, 17 Sep 2022 17:44:31 -0500 Subject: [PATCH] feat(nvim): closer mapping integration w/ which-key --- .../primary/config/lua/plugins/mappings.lua | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/dots/.nvim-environments/primary/config/lua/plugins/mappings.lua b/dots/.nvim-environments/primary/config/lua/plugins/mappings.lua index af187a6b..5151eaa3 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/mappings.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/mappings.lua @@ -4,7 +4,14 @@ if not loaded then return end +local wk = require("which-key") + -- Telescope mappings +wk.register({ + t = { + name = "Telescope", + }, +}, { prefix = "" }) vim.keymap.set("n", "tw", ":Telescope live_grep", { silent = true, desc = "Telescope: Grep for Word" }) vim.keymap.set("n", "tgs", ":Telescope git_status", { silent = true, desc = "Telescope: Git Status" }) vim.keymap.set("n", "tgc", ":Telescope git_commits", { silent = true, desc = "Telescope: Git Commits" }) @@ -34,6 +41,12 @@ vim.keymap.set("n", "tk", ":Telescope keymaps", { silent = true, des vim.keymap.set("n", "tc", ":Telescope commands", { silent = true, desc = "Telescope: Commands" }) -- Lsp Mappings + +wk.register({ + l = { + name = "LSP", + }, +}, { prefix = "" }) vim.keymap.set("n", "lD", vim.lsp.buf.declaration, { silent = true, desc = "LSP: Declaration" }) vim.keymap.set("n", "ld", vim.lsp.buf.definition, { silent = true, desc = "LSP: Definition" }) vim.keymap.set("n", "k", vim.lsp.buf.hover, { silent = true, desc = "LSP: Hover" }) @@ -88,6 +101,11 @@ end, { vim.keymap.set("n", "nf", ":Neoformat", { silent = true, desc = "Neoformat" }) -- DAP Mappings +wk.register({ + d = { + name = "DAP", + }, +}, { prefix = "" }) local dap = require("dap") vim.keymap.set("n", "dc", dap.continue, { silent = true, desc = "DAP: Continue" }) vim.keymap.set("n", "de", dap.terminate, { silent = true, desc = "DAP: Terminate" }) @@ -130,6 +148,13 @@ vim.keymap.set("n", "nd", require("notify").dismiss, { silent = true, de vim.keymap.set("n", "ww", ":WhichKey", { silent = true, desc = "Show Keybinds" }) -- Neogen Mappings +wk.register({ + n = { + g = { + name = "Neogen", + }, + }, +}, { prefix = "" }) vim.keymap.set("n", "ngf", ":Neogen func", { silent = true, desc = "Neogen: Function Annotation" }) vim.keymap.set("n", "ngc", ":Neogen class", { silent = true, desc = "Neogen: Class Annotation" }) vim.keymap.set("n", "ngt", ":Neogen type", { silent = true, desc = "Neogen: Type Annotation" }) @@ -142,6 +167,11 @@ vim.keymap.set("n", "nt", ":Neotree show toggle focus", { silent = t vim.keymap.set("n", "pt", "PlenaryTestFile", { silent = true, desc = "Plenary: Test File" }) -- Neogit Mappings +wk.register({ + g = { + name = "Git", + }, +}, { prefix = "" }) vim.keymap.set("n", "gg", ":Neogit", { silent = true, desc = "Neogit: Open" }) -- Gitsigns Mappings