From 638293d7a8e9122cf6f6a5d7560f30acb0a194b1 Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Mon, 20 May 2024 21:48:49 +0200 Subject: [PATCH] space + i for toggle inlay hints --- lua/plugins/lspconfig.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 70072f9..4ffc71a 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -51,6 +51,17 @@ local lspKeys = function(client, bufnr) end, { noremap = true, silent = false, desc = 'Format visual', buffer = bufnr }) end + if client.supports_method('inlayHintProvider') then + vim.keymap.set('n', 'i', function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }), { bufnr = bufnr }) + end, + { + noremap = true, + silent = false, + desc = 'Toggle inlay hints', + buffer = bufnr + }) + end end local document_highlight = function(bufnr)