diff --git a/lua/valeth/plugins/lsp.lua b/lua/valeth/plugins/lsp.lua index e7ae200..c51872a 100644 --- a/lua/valeth/plugins/lsp.lua +++ b/lua/valeth/plugins/lsp.lua @@ -45,6 +45,13 @@ local function lua_ls_setup(lsp_config) }) end +local function toggle_inlay_hints() + local to_enable = not vim.lsp.inlay_hint.is_enabled() + vim.lsp.inlay_hint.enable(to_enable) + local status = to_enable and "enabled" or "disabled" + vim.notify("Inlay hints " .. status, vim.log.levels.INFO) +end + spec.config = function() local neoconf = require("neoconf") @@ -95,6 +102,7 @@ spec.config = function() vim.keymap.set("n", "ci", vim.diagnostic.open_float, opts) vim.keymap.set("n", "re", vim.lsp.buf.rename, opts) vim.keymap.set({ "n", "i" }, "", vim.lsp.buf.signature_help, opts) + vim.keymap.set("n", "", toggle_inlay_hints, opts) end })