fix: astronvim - install lsp, fomatters and others via home-manager instead of mason.nvim

This commit is contained in:
Ryan Yin
2023-07-13 12:28:23 +08:00
parent 3234d0db2e
commit 54ebad9151
2 changed files with 37 additions and 7 deletions

View File

@@ -2,12 +2,6 @@
My Neovim config based on AstroNvim.
## TODO
- [ ] Install language servers, formatters, and others via nix home manager, instead of mason.nvim!
- currently some plugins(markdown/clangd/...) failed to start due to this problem.
- Temporary solution: `rm ~/.local/share/nvim/mason/bin/*`, but do not remove `emmet-ls`, cause it's not found in nixpkgs!
## Screenshots
![](/_img/astronvim_2023-07-13_00-39.webp)

View File

@@ -5,7 +5,9 @@ return {
opt = {
relativenumber = true, -- Show relative numberline
signcolumn = "auto", -- Show sign column when used only
spell = false, -- Enable spell checking
spell = false, -- Spell checking
swapfile = false, -- Swapfile
},
},
@@ -79,6 +81,39 @@ return {
},
},
},
-- Install lsp, formmatter and others via home manager instead of Mason.nvim
-- LSP installations
{
"williamboman/mason-lspconfig.nvim",
-- ensure_installed nothing
opts = function(_, opts) opts.ensure_installed = {
"emmet_ls", -- not exist in nixpkgs, so install it via mason
} end,
},
-- Formatters/Linter installation
{
"jay-babu/mason-null-ls.nvim",
-- ensure_installed nothing
opts = function(_, opts) opts.ensure_installed = {} end,
},
-- Debugger installationl
{
"jay-babu/mason-nvim-dap.nvim",
-- overrides `require("mason-nvim-dap").setup(...)`
opts = function(_, opts) opts.ensure_installed = {} end,
},
},
-- Configure require("lazy").setup() options
lazy = {
defaults = { lazy = true },
performance = {
rtp = {
-- customize default disabled vim plugins
disabled_plugins = { };
},
},
},
lsp = {
@@ -91,6 +126,7 @@ return {
},
},
},
-- enable servers that installed by home-manager instead of mason
servers = {
"dockerls",
"jsonnet_ls", -- jsonnet language server