diff --git a/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/barbar.lua b/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/barbar.lua index 62300ad..4bd8613 100644 --- a/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/barbar.lua +++ b/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/barbar.lua @@ -13,27 +13,10 @@ return { local whichKey = require("which-key") whichKey.register({ - "b", - desc = "Barbar", - { - "bc", - desc = "Barbar Close", - { - "bcc", - "BufferCloseAllButCurrent", - desc = "Barbar Close All But Current" - }, - { - "bcl", - "BufferCloseAllBuffersLeft", - desc = "Barbar Close All Buffers Left" - }, - { - "bcr", - "BufferCloseAllBuffersRight", - desc = "Barbar Close All Buffers Right" - } - }, + { "", "bcl", desc = "BufferCloseAllBuffersLeft" }, + { "", desc = "bc" }, + { "", "bcr", desc = "BufferCloseAllBuffersRight" }, + { "", "bcc", desc = "BufferCloseAllButCurrent" }, }) map("n", "", "BufferPrevious", opts) diff --git a/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/nvim-lspconfig.lua b/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/nvim-lspconfig.lua index 69e1204..134b007 100644 --- a/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/nvim-lspconfig.lua +++ b/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/nvim-lspconfig.lua @@ -19,105 +19,22 @@ return { local on_attach = function(_, buffer) whichKey.register({ - ["l"] = { - name = "LSP", - d = { - name = "LSP Diagnostic", - o = { - function() - vim.diagnostic.open_float() - end, - "Open LSP diagnostic", - }, - p = { - function() - vim.diagnostic.goto_prev() - end, - "Previous LSP diagnostic", - }, - n = { - function() - vim.diagnostic.goto_next() - end, - "Next LSP diagnostic", - }, - }, - b = { - name = "LSP Buffer", - D = { - function() - vim.lsp.buf.declaration() - end, - "Go to symbol declaration", - buffer = buffer, - }, - d = { - function() - vim.lsp.buf.definition() - end, - "Go to symbol definition", - buffer = buffer, - }, - h = { - function() - vim.lsp.buf.hover() - end, - "Hover symbol documentation", - buffer = buffer, - }, - i = { - function() - vim.lsp.buf.implementation() - end, - "Go to symbol implementation", - buffer = buffer, - }, - s = { - function() - vim.lsp.buf.signature_help() - end, - "Go to symbol signature", - buffer = buffer, - }, - t = { - function() - vim.lsp.buf.type_definition() - end, - "Go to symbol type definition", - buffer = buffer, - }, - r = { - function() - vim.lsp.buf.rename() - end, - "Rename symbol", - buffer = buffer, - }, - c = { - function() - vim.lsp.buf.code_action() - end, - "LSP code action", - buffer = buffer, - }, - R = { - function() - vim.lsp.buf.references() - end, - "Go to symbol deferences", - buffer = buffer, - }, - f = { - function() - vim.lsp.buf.format({ - async = true, - }) - end, - "Format file", - buffer = buffer, - }, - }, - }, + { "l", group = "LSP" }, + { "lb", group = "LSP Buffer" }, + { "lbD", function() vim.lsp.buf.declaration() end, buffer = 1, desc = "Go to symbol declaration" }, + { "lbR", function() vim.lsp.buf.references() end, buffer = 1, desc = "Go to symbol references" }, + { "lbc", function() vim.lsp.buf.code_action() end, buffer = 1, desc = "LSP code action" }, + { "lbd", function() vim.lsp.buf.definition() end, buffer = 1, desc = "Go to symbol definition" }, + { "lbf", function() vim.lsp.buf.format() end, buffer = 1, desc = "Format file" }, + { "lbh", function() vim.lsp.buf.hover() end, buffer = 1, desc = "Hover symbol documentation" }, + { "lbi", function() vim.lsp.buf.implementation() end, buffer = 1, desc = "Go to symbol implementation" }, + { "lbr", function() vim.lsp.buf.rename() end, buffer = 1, desc = "Rename symbol" }, + { "lbs", function() vim.lsp.buf.signature_help() end, buffer = 1, desc = "Go to symbol signature" }, + { "lbt", function() vim.lsp.buf.type_definition() end, buffer = 1, desc = "Go to symbol type definition" }, + { "ld", group = "LSP Diagnostic" }, + { "ldn", function() vim.diagnostic.goto_next() end, desc = "Next LSP diagnostic" }, + { "ldo", function() vim.diagnostic.open_float() end, desc = "Open LSP diagnostic" }, + { "ldp", function() vim.diagnostic.goto_prev() end, desc = "Previous LSP diagnostic" }, }) end diff --git a/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/which-key.lua b/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/which-key.lua index 54e6381..73de94e 100644 --- a/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/which-key.lua +++ b/ansible/roles/neovim/files/nvim/lua/settings/lazy/plugins/which-key.lua @@ -7,30 +7,12 @@ return { end, config = function() require("which-key").register({ - [""] = { - ":write", - "Persist the content of the current buffer to the file system" - }, - [""] = { - ":quitall", - "Quit the editor with confirmation" - }, - [""] = { - "h", - "Move to the window on the left" - }, - [""] = { - "l", - "Move to the window on the right" - }, - [""] = { - "k", - "Move to the window on the top" - }, - [""] = { - "j", - "Move to the window on the bottom" - } + { "", "h", desc = "Move to the window on the left" }, + { "", "j", desc = "Move to the window on the bottom" }, + { "", "k", desc = "Move to the window on the top" }, + { "", "l", desc = "Move to the window on the right" }, + { "", ":quitall", desc = "Quit the editor with confirmation" }, + { "", ":write", desc = "Persist the content of the current buffer to the file system" }, }) end }