diff --git a/lua/config/opts.lua b/lua/config/opts.lua index b3a96cb..10b80b6 100644 --- a/lua/config/opts.lua +++ b/lua/config/opts.lua @@ -40,4 +40,5 @@ opt.smartindent = true -- disable netrw vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 +vim.g.inlay_hints_visible = true diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua index 644a8dc..606cb65 100644 --- a/lua/plugins/nvim-lspconfig.lua +++ b/lua/plugins/nvim-lspconfig.lua @@ -11,8 +11,8 @@ -- -- ============================================== -ui = require 'config.ui' -icons = require 'config.icons' +local ui = require 'config.ui' +local icons = require 'config.icons' return { { @@ -64,6 +64,14 @@ return { function(server_name) -- default handler (optional) require("lspconfig")[server_name].setup({ on_attach = function(client, bufnr) + + -- optionally enable inlay hints + -- Source: https://www.reddit.com/r/neovim/comments/14em0f8/how_to_use_the_new_lsp_inlay_hints/ + -- .............................................. + + if client.server_capabilities.inlayHintProvider and opts.inlay_hints.enabled then + vim.lsp.inlay_hint.enable(true, { bufnr }) + end end }) end,