Skip to content

Commit 4e2e35e

Browse files
committed
refactor: extract LSP servers and mason tool extras
1 parent 2d05423 commit 4e2e35e

3 files changed

Lines changed: 28 additions & 27 deletions

File tree

init.lua

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -641,26 +641,6 @@ require('lazy').setup({
641641
Lua = {},
642642
},
643643
},
644-
645-
-- my customizations
646-
clangd = {},
647-
gopls = {},
648-
pyright = {
649-
settings = {
650-
pyright = {
651-
-- Using Ruff's import organizer
652-
disableOrganizeImports = true,
653-
},
654-
python = {
655-
analysis = {
656-
-- Ignore all files for analysis to exclusively use Ruff for linting
657-
ignore = { '*' },
658-
},
659-
},
660-
},
661-
},
662-
ts_ls = {},
663-
ruff = {},
664644
}
665645

666646
-- Ensure the servers and tools above are installed
@@ -673,13 +653,6 @@ require('lazy').setup({
673653
local ensure_installed = vim.tbl_keys(servers or {})
674654
vim.list_extend(ensure_installed, {
675655
-- You can add other tools here that you want Mason to install
676-
677-
-- my customizations
678-
'markdownlint',
679-
'mypy',
680-
'jq',
681-
'prettier',
682-
'codelldb',
683656
})
684657

685658
require('mason-tool-installer').setup { ensure_installed = ensure_installed }

lua/custom/plugins/lsp.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
vim.lsp.config('pyright', {
2+
settings = {
3+
pyright = { disableOrganizeImports = true },
4+
python = { analysis = { ignore = { '*' } } },
5+
},
6+
})
7+
8+
return {
9+
{
10+
'mason-org/mason-lspconfig.nvim',
11+
opts = {
12+
ensure_installed = { 'clangd', 'gopls', 'pyright', 'ts_ls', 'ruff' },
13+
automatic_enable = true,
14+
},
15+
},
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
vim.api.nvim_create_autocmd('User', {
2+
pattern = 'VeryLazy', once = true,
3+
callback = function()
4+
local mr = require 'mason-registry'
5+
mr.refresh(function()
6+
local p = mr.get_package 'codelldb'
7+
if not p:is_installed() then p:install() end
8+
end)
9+
end,
10+
})
11+
12+
return {}

0 commit comments

Comments
 (0)