summaryrefslogtreecommitdiffstats
path: root/nvim
diff options
context:
space:
mode:
authorVladislav Grechannik <52157081+VlaDexa@users.noreply.github.com>2024-04-17 20:04:55 +0200
committerGitHub <noreply@github.com>2024-04-17 14:04:55 -0400
commitbddd76c1f92c9155d064b48eeb7d9d3579ad6976 (patch)
tree980dc4aae556b557692152be01f8e8b0a661e709 /nvim
parent75569ed3af3a2ebd1eff47ed6c89a57305a78eed (diff)
downloaddots-bddd76c1f92c9155d064b48eeb7d9d3579ad6976.tar.gz
Enable inlay hints for the supporting servers (#843)
Diffstat (limited to 'nvim')
-rw-r--r--nvim/init.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/nvim/init.lua b/nvim/init.lua
index cc49351..4bd9b7f 100644
--- a/nvim/init.lua
+++ b/nvim/init.lua
@@ -286,6 +286,7 @@ require('lazy').setup({
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
+ ['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
}
end,
},
@@ -518,6 +519,16 @@ require('lazy').setup({
callback = vim.lsp.buf.clear_references,
})
end
+
+ -- The following autocommand is used to enable inlay hints in your
+ -- code, if the language server you are using supports them
+ --
+ -- This may be unwanted, since they displace some of your code
+ if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
+ map('<leader>th', function()
+ vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled())
+ end, '[T]oggle Inlay [H]ints')
+ end
end,
})