From c0914757e57e059989aaf9b6013ec8153b733df2 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Fri, 23 Aug 2024 00:07:35 +0200 Subject: [PATCH] vim: better signature help --- modules/base/vim.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/base/vim.nix b/modules/base/vim.nix index 2f6d23c..670dd03 100644 --- a/modules/base/vim.nix +++ b/modules/base/vim.nix @@ -395,6 +395,20 @@ end, }) + -- Overwrite signature help defaults + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + -- Show window above cursor to avoid clipping completions menu + anchor_bias = "above", + -- Keep open until leaving insert mode. + -- Default: { CursorMoved, CursorMovedI, InsertCharPre }. + close_events = { "CursorMoved", }, + -- Make floating window unfocusable. Allows updating parameter + -- highlight with another rather than focusing the window. + focusable = false, + } + ) + -- The following keymaps are defined irregardless of the LSP -- server's capabilities since we would rather receive an error -- that the action is unsupported by the LSP server instead of doing