Fix lsp_signature.nvim behavior

Thu, 11 Apr 2024 21:49:00 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 11 Apr 2024 21:49:00 -0500
changeset 1148
bca491e2be91
parent 1147
23f9b157fe8a
child 1149
4af7c8156683

Fix lsp_signature.nvim behavior

.config/nvim/lua/config/maps.lua file | annotate | diff | comparison | revisions
.config/nvim/lua/plugins/completion.lua file | annotate | diff | comparison | revisions
.config/nvim/lua/plugins/lsp.lua file | annotate | diff | comparison | revisions
--- a/.config/nvim/lua/config/maps.lua
+++ b/.config/nvim/lua/config/maps.lua
@@ -88,7 +88,7 @@ vim.api.nvim_create_autocmd("LspAttach",
     map("n", "gd", vim.lsp.buf.definition, bufopts)
     map("n", "K", vim.lsp.buf.hover, bufopts)
     map("n", "gi", vim.lsp.buf.implementation, bufopts)
-    map("n", "<F12>", vim.lsp.buf.signature_help, bufopts)
+    map({ "n", "i" }, "<F12>", vim.lsp.buf.signature_help, bufopts)
     map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, bufopts)
     map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
     map("n", "<leader>wl", function()
--- a/.config/nvim/lua/plugins/completion.lua
+++ b/.config/nvim/lua/plugins/completion.lua
@@ -97,17 +97,4 @@ return {
       delete_check_events = "TextChanged",
     },
   },
-  {
-    "ray-x/lsp_signature.nvim",
-    branch = "master",
-    event = { "LspAttach" },
-    opts = {
-      toggle_key = "<F12>",
-      toggle_key_flip_floatwin_setting = true,
-      floating_window = false,
-      fix_pos = true,
-      hint_enable = false,
-      handler_opts = { border = "none" },
-    },
-  },
 }
--- a/.config/nvim/lua/plugins/lsp.lua
+++ b/.config/nvim/lua/plugins/lsp.lua
@@ -9,6 +9,7 @@ return {
     dependencies = {
       { "williamboman/mason-lspconfig.nvim", config = true },
       { "folke/neodev.nvim", config = true },
+      "ray-x/lsp_signature.nvim",
     },
     config = function(_, _)
       local capabilities = require("cmp_nvim_lsp").default_capabilities()
@@ -51,4 +52,18 @@ return {
       vim.keymap.set("n", "<leader>ca", require("actions-preview").code_actions, { silent = true })
     end,
   },
+
+  {
+    "ray-x/lsp_signature.nvim",
+    branch = "master",
+    lazy = true,
+    opts = {
+      toggle_key = "<F12>",
+      toggle_key_flip_floatwin_setting = true,
+      doc_lines = 0,
+      floating_window = true,
+      fix_pos = true,
+      hint_enable = false,
+    },
+  },
 }

mercurial