diff --git a/lua/taken/plugins/lsp/lspconfig.lua b/lua/taken/plugins/lsp/lspconfig.lua index 61bc4b2..3bed2a3 100644 --- a/lua/taken/plugins/lsp/lspconfig.lua +++ b/lua/taken/plugins/lsp/lspconfig.lua @@ -32,6 +32,12 @@ return { on_attach = on_attach, settings = { Lua = { + hint = { + enable = true, + }, + runtime = { + version = "LuaJIT", + }, diagnostics = { globals = { "vim" }, }, diff --git a/lua/taken/utils/on_attach.lua b/lua/taken/utils/on_attach.lua index 55fabfa..6ab6e79 100644 --- a/lua/taken/utils/on_attach.lua +++ b/lua/taken/utils/on_attach.lua @@ -24,18 +24,18 @@ local on_attach = function(client, bufnr) vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts("Get code actions")) - vim.keymap.set("n", "vrn", function() + vim.keymap.set("n", "vr", function() vim.lsp.buf.rename() end, opts("Rename symbol")) - vim.keymap.set("n", "vih", function() + vim.keymap.set("n", "vh", function() if vim.fn.has("nvim-0.10.0") == 0 then vim.notify("Inlay hints are only available in Neovim 0.10.0 and above", vim.log.levels.ERROR) return end if client.server_capabilities.inlayHintProvider then - local current_state = vim.lsp.inlay_hint.is_enabled(bufnr) - vim.lsp.inlay_hint.enable(bufnr, not current_state) + local current_state = vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }) + vim.lsp.inlay_hint.enable(not current_state, { bufnr = bufnr }) end end, opts("Toggle inlay hints")) vim.keymap.set("n", "[d", function()