mason is back baby

This commit is contained in:
Ivar Fatland
2025-02-20 13:04:05 +01:00
parent 33f634d651
commit 7824eedf10
+31 -22
View File
@@ -160,16 +160,6 @@ require'lazy'.setup{ --{{{1
vim.keymap.set("n", "-", vim.cmd.Oil, { desc = "Open parent directory" }) vim.keymap.set("n", "-", vim.cmd.Oil, { desc = "Open parent directory" })
end, end,
}, },
{ 'Williamboman/mason.nvim', --{{{3
config = function()
require'mason'.setup {
registries = {
'github:mason-org/mason-registry',
'github:crashdummyy/mason-registry',
},
}
end,
},
{ 'seblyng/roslyn.nvim', --{{{2 { 'seblyng/roslyn.nvim', --{{{2
--WARN: requires html-lsp, roslyn and rzls installed via Mason --WARN: requires html-lsp, roslyn and rzls installed via Mason
dependencies = { 'tris203/rzls.nvim', }, dependencies = { 'tris203/rzls.nvim', },
@@ -182,7 +172,7 @@ require'lazy'.setup{ --{{{1
'--logLevel=Information', '--logLevel=Information',
'--extensionLogDirectory=' .. vim.fs.dirname(vim.lsp.get_log_path()), '--extensionLogDirectory=' .. vim.fs.dirname(vim.lsp.get_log_path()),
'--razorSourceGenerator=' .. vim.fs.joinpath( '--razorSourceGenerator=' .. vim.fs.joinpath(
vim.fn.stdpath'data', vim.fn.stdpath'data' --[[@as string]],
'mason', 'mason',
'packages', 'packages',
'roslyn', 'roslyn',
@@ -190,7 +180,7 @@ require'lazy'.setup{ --{{{1
'Microsoft.CodeAnalysis.Razor.Compiler.dll' 'Microsoft.CodeAnalysis.Razor.Compiler.dll'
), ),
'--razorDesignTimePath=' .. vim.fs.joinpath( '--razorDesignTimePath=' .. vim.fs.joinpath(
vim.fn.stdpath'data', vim.fn.stdpath'data' --[[@as string]],
'mason', 'mason',
'packages', 'packages',
'rzls', 'rzls',
@@ -219,7 +209,7 @@ require'lazy'.setup{ --{{{1
exe = { exe = {
'dotnet', 'dotnet',
vim.fs.joinpath( vim.fs.joinpath(
vim.fn.stdpath'data', vim.fn.stdpath'data' --[[@as string]],
'mason', 'mason',
'packages', 'packages',
'roslyn', 'roslyn',
@@ -229,19 +219,38 @@ require'lazy'.setup{ --{{{1
}, },
}, },
}, },
{ "folke/lazydev.nvim", --{{{2
ft = "lua", -- only load on lua files
opts = {
library = {
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
{ 'neovim/nvim-lspconfig', --{{{2 { 'neovim/nvim-lspconfig', --{{{2
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
},
config = function() config = function()
require'lspconfig'.gopls.setup{} require'mason'.setup {
require'lspconfig'.rust_analyzer.setup{} registries = {
require'lspconfig'.gdscript.setup{} 'github:mason-org/mason-registry',
require'lspconfig'.clangd.setup{} 'github:crashdummyy/mason-registry',
require'lspconfig'.pyright.setup{} },
require'lspconfig'.ts_ls.setup{} }
require'lspconfig'.jdtls.setup{} require'mason-lspconfig'.setup()
require'mason-lspconfig'.setup_handlers{
function (server_name)
require'lspconfig'[server_name].setup{}
end,
zls = function()
require'lspconfig'.zls.setup{ enable_autofix = false } require'lspconfig'.zls.setup{ enable_autofix = false }
vim.g.zig_fmt_autosave = false vim.g.zig_fmt_autosave = false
end,
}
require'lspconfig'.gdscript.setup{}
vim.cmd [[ vim.cmd [[
noremap ,rn :lua vim.lsp.buf.rename()<CR> noremap ,rn :lua vim.lsp.buf.rename()<CR>
noremap ,fd :lua vim.lsp.buf.definition()<CR> noremap ,fd :lua vim.lsp.buf.definition()<CR>
@@ -336,7 +345,7 @@ require'lazy'.setup{ --{{{1
'S', 'S',
function () function ()
---@type string ---@type string
local snippets_path = vim.fn.stdpath('config') .. '/snippets/' .. vim.api.nvim_buf_get_option(0, "filetype") .. '.snippets' local snippets_path = vim.fn.stdpath('config') .. '/snippets/' .. vim.bo.filetype .. '.snippets'
if not file_exists(snippets_path) then if not file_exists(snippets_path) then
local file = io.open( snippets_path, 'w' ) local file = io.open( snippets_path, 'w' )