commit 3e41d35e0e1337c81a2ead6586b21ee869b31c8b from: Andre M. Bertachini date: Sun May 11 15:15:08 2025 UTC A few changes commit - 97347067f65c59c6975f47587748119f5b2f9aba commit + 3e41d35e0e1337c81a2ead6586b21ee869b31c8b blob - 5f1f13082416d29610789fc428681e9fb8568bbd blob + 7b67c03b8812e76f6c175380984d19803cd0d6a5 --- lazy-lock.json +++ lazy-lock.json @@ -2,7 +2,7 @@ "conform.nvim": { "branch": "master", "commit": "374aaf384e2e841607b8e2fe63fa3ad01d111c91" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "aafae207d5a2a28c59c9d478d8581c2739135d09" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "62f821a14e20f3f2ee358cd44d0b3d299a508e72" }, "mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" }, "nvim-lspconfig": { "branch": "master", "commit": "61e5109c8cf24807e4ae29813a3a82b31821dd45" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, blob - b2b1a0c36baa9b9cd650b87130f0229893bba2b6 blob + 39998557aaa3e69cc6791a6abc2acfd153bb9b45 --- lua/config/keymaps.lua +++ lua/config/keymaps.lua @@ -100,7 +100,15 @@ vim.api.nvim_create_autocmd('LspAttach', { -- Leader-based LSP actions (under l for less frequent actions) lsp_map('lr', vim.lsp.buf.rename, 'Rename across multiple files', 'n') - lsp_map('la', vim.lsp.buf.code_action, 'Code actions', { 'n', 'x' }) + lsp_map('ca', vim.lsp.buf.code_action, 'Code actions', { 'n', 'x' }) lsp_map('lt', require('telescope.builtin').lsp_type_definitions, 'Type Definition') + lsp_map('le', function() + vim.diagnostic.open_float({ + scope = 'line', + border = 'rounded', + max_width = 80, + severity = vim.diagnostic.severity.ERROR, + }) + end, 'Show error diagnostics in float', 'n') end, }) blob - d5c6154c7eb54ceb8d2132da4c0dd07ab195af74 blob + 4e6169aa10c79bf146a2851871b1f0b08d87d03f --- lua/plugins/lspconfig.lua +++ lua/plugins/lspconfig.lua @@ -2,24 +2,14 @@ return { { 'neovim/nvim-lspconfig', dependencies = { + { 'williamboman/mason.nvim', config = true }, { 'williamboman/mason-lspconfig.nvim' }, }, config = function() - local lspconfig = require('lspconfig') - local capabilities = vim.lsp.protocol.make_client_capabilities() - vim.diagnostic.config({ severity_sort = true, float = { border = 'rounded', source = 'if_many' }, underline = { severity = vim.diagnostic.severity.ERROR }, - signs = vim.g.have_nerd_font and { - text = { - [vim.diagnostic.severity.ERROR] = '󰅚 ', - [vim.diagnostic.severity.WARN] = '󰀪 ', - [vim.diagnostic.severity.INFO] = '󰋽 ', - [vim.diagnostic.severity.HINT] = '󰌶 ', - }, - } or {}, virtual_text = { source = 'if_many', spacing = 2, @@ -34,8 +24,7 @@ return { end, }, }) - - -- Define LSP servers and their configurations + -- Define LSP servers local servers = { lua_ls = { settings = { @@ -48,6 +37,7 @@ return { }, } + local lspconfig = require('lspconfig') for server_name, server_config in pairs(servers) do lspconfig[server_name].setup(vim.tbl_deep_extend('force', { capabilities = capabilities, blob - cdf95b5419e6f77c2092a1a841cfdc91af244d47 blob + ad982f94e6000f0c9aaa489ef8d752973942e84e --- lua/plugins/mason.lua +++ lua/plugins/mason.lua @@ -1,19 +1,29 @@ return { - { - "williamboman/mason.nvim", - opts = {}, - }, - { - "williamboman/mason-lspconfig.nvim", - opts = { - ensure_installed = { "lua_ls" }, - automatic_installation = true, + { + 'williamboman/mason.nvim', + opts = {}, }, - }, - { - "WhoIsSethDaniel/mason-tool-installer.nvim", - opts = { - ensure_installed = { "stylua" }, + { + 'williamboman/mason-lspconfig.nvim', + opts = { + ensure_installed = { 'lua_ls' }, + automatic_installation = true, + handlers = { + function(server_name) + local server = servers[server_name] or {} + -- This handles overriding only values explicitly passed + -- by the server configuration above. Useful when disabling + -- certain features of an LSP (for example, turning off formatting for ts_ls) + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + require('lspconfig')[server_name].setup(server) + end, + }, + }, }, - }, + { + 'WhoIsSethDaniel/mason-tool-installer.nvim', + opts = { + ensure_installed = { 'stylua' }, + }, + }, } blob - a95912f76c3be67ed25ef341e032eb2506d1235f blob + 34b67f200d2ed438c2a6d568ae2e7de5206ede35 --- lua/plugins/telescope.lua +++ lua/plugins/telescope.lua @@ -28,10 +28,10 @@ return { layout_config = { width = 0.8, height = 0.8, - preview_width = 0.6, + preview_width = 0.5, }, -- Disable costly folders - file_ignore_patterns = { 'node_modules', '.git/' }, + file_ignore_patterns = { 'node_modules' }, -- Basic mappings for efficiency mappings = { i = {