summaryrefslogtreecommitdiff
path: root/lua/plugins
diff options
context:
space:
mode:
authorChristian Segundo2025-01-17 23:01:52 +0100
committerChristian Segundo2025-01-17 23:01:52 +0100
commit5b7f52d7f85b69c7dbb5b2951c67d7fcc90fe94f (patch)
tree13cd20f419fd24d5e94c1531607f1f3e97e2614e /lua/plugins
parentf7522188d1fdaa038724b0bd75d343558dc27c00 (diff)
downloadconfig-5b7f52d7f85b69c7dbb5b2951c67d7fcc90fe94f.tar.gz
simplify whichkey config
most lsp keybindings are now by default under gr so no need to set them manually see: https://github.com/neovim/neovim/pull/28650 and https://neovim.io/doc/user/lsp.html
Diffstat (limited to 'lua/plugins')
-rw-r--r--lua/plugins/core/which-key.lua53
-rw-r--r--lua/plugins/lsp/config.lua2
2 files changed, 5 insertions, 50 deletions
diff --git a/lua/plugins/core/which-key.lua b/lua/plugins/core/which-key.lua
index 3c4a95b..8ae0406 100644
--- a/lua/plugins/core/which-key.lua
+++ b/lua/plugins/core/which-key.lua
@@ -5,54 +5,7 @@ return {
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
-
- opts = {
- f = { name = "File" },
- t = {
- name = "Tab",
- c = { "<cmd>tabnew<cr>", "Create" },
- ["1"] = { "1gt", "1" },
- ["2"] = { "2gt", "2" },
- ["3"] = { "3gt", "3" },
- ["4"] = { "4gt", "4" },
- ["5"] = { "5gt", "5" },
- ["6"] = { "6gt", "6" },
- ["7"] = { "7gt", "7" },
- ["8"] = { "8gt", "8" },
- ["9"] = { "9gt", "9" },
- },
- b = {
- name = "Buffer",
- n = { "<cmd>BufferNext<cr>", "Next" },
- p = { "<cmd>BufferPrevious<cr>", "Previous" },
- c = { "<cmd>BufferClose<cr>", "Close" },
- },
- l = {
- name = "LSP",
- a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Action" },
- f = {
- "<cmd>lua vim.lsp.buf.format({ async = false, timeout_ms = 5000 })<cr>",
- "Format",
- },
- d = { "<cmd>lua vim.diagnostic.open_float()<cr>", "Diagnostic" },
- h = { "<cmd>lua vim.lsp.buf.hover()<cr>", "Help" },
- g = {
- name = "Go to",
- D = {
- "<cmd>lua vim.lsp.buf.declaration()<cr>",
- "Go to declaration",
- },
- d = { "<cmd>lua vim.lsp.buf.definition()<cr>", "Go to definition" },
- i = {
- "<cmd>lua vim.lsp.buf.definition()<cr>",
- "Go to implementation",
- },
- },
- },
- },
-
- config = function(_, opts)
- local wk = require("which-key")
- wk.register(opts, { prefix = "<leader>" })
- end,
+ -- Don't set keymaps here using the plugin spec or elsewhere using the
+ -- wk.add fn. Instead use normal vim.keymap.set and set a description.
+ -- This way everything without this plugin.
}
diff --git a/lua/plugins/lsp/config.lua b/lua/plugins/lsp/config.lua
index ef952b1..4a9469a 100644
--- a/lua/plugins/lsp/config.lua
+++ b/lua/plugins/lsp/config.lua
@@ -10,8 +10,10 @@ return {
lsp_opts.capabilities.textDocument.completion.completionItem.snippetSupport = true
require("lspconfig")[lsp].setup(lsp_opts)
end
+ vim.keymap.set('n', 'grd', "<cmd>lua vim.diagnostic.open_float()<cr>", { desc = 'Diagnostics floating window' })
end,
init = function()
+ -- Show who is emitting the diagnostic
vim.diagnostic.config({
float = {
source = "always",