From fa500847efc9c1201b87812fd8893a3fbaffac60 Mon Sep 17 00:00:00 2001 From: pml68 Date: Mon, 20 May 2024 21:53:48 +0200 Subject: feat: add remap for toggling inlay hints --- lua/pml68/remap.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lua/pml68/remap.lua') diff --git a/lua/pml68/remap.lua b/lua/pml68/remap.lua index 1d72477..eb37b9e 100644 --- a/lua/pml68/remap.lua +++ b/lua/pml68/remap.lua @@ -61,6 +61,15 @@ vim.api.nvim_create_autocmd('LspAttach', { vim.keymap.set('n', '', 'lua vim.lsp.buf.rename()', opts) vim.keymap.set({ 'n', 'x' }, '', 'lua vim.lsp.buf.format({async = true})', opts) vim.keymap.set('n', 'gc', 'lua vim.lsp.buf.code_action()', opts) + -- u/Blan_11 + vim.keymap.set('n', 'lh', function() + local ok = pcall(vim.lsp.inlay_hint.enable, vim.lsp.inlay_hint.is_enabled()) + if ok then + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) + else + vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled()) + end + end, { silent = true }) end }) -- cgit v1.2.3