Switch to vim.lsp.config & remove ltex-ls

This commit is contained in:
2025-05-04 17:09:57 +02:00
parent 2f5a78b724
commit a2cea5dc0d
6 changed files with 37 additions and 117 deletions
Generated
-18
View File
@@ -228,23 +228,6 @@
"type": "github" "type": "github"
} }
}, },
"ltex-extra": {
"flake": false,
"locked": {
"lastModified": 1737936194,
"narHash": "sha256-b92tQ9ouf9ikizEalOrVvRDaumttz2ENR7E1rc8N4Bw=",
"owner": "barreiroleo",
"repo": "ltex_extra.nvim",
"rev": "09dc879b1873001f855bca5ad1f024ca15b9bbaf",
"type": "github"
},
"original": {
"owner": "barreiroleo",
"ref": "dev",
"repo": "ltex_extra.nvim",
"type": "github"
}
},
"neovim-nightly": { "neovim-nightly": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@@ -402,7 +385,6 @@
"flood": "flood", "flood": "flood",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"ltex-extra": "ltex-extra",
"neovim-nightly": "neovim-nightly", "neovim-nightly": "neovim-nightly",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
-5
View File
@@ -44,11 +44,6 @@
url = "github:tmux/tmux"; url = "github:tmux/tmux";
flake = false; flake = false;
}; };
ltex-extra = {
url = "github:barreiroleo/ltex_extra.nvim/dev";
flake = false;
};
}; };
outputs = { outputs = {
+3
View File
@@ -0,0 +1,3 @@
return {
filetypes = { "sh", "zsh", "make" },
}
+9
View File
@@ -0,0 +1,9 @@
return {
settings = {
json = {
schemas = require('schemastore').json.schemas(),
format = { enable = true },
validate = { enable = true },
},
},
}
+7 -11
View File
@@ -2,18 +2,16 @@
pkgs, pkgs,
lib, lib,
neovim-nightly, neovim-nightly,
ltex-extra,
... ...
}: let }: let
mkNvim = import ./nix/mknvim.nix {inherit pkgs lib;}; mkNvim = import ./nix/mknvim.nix {inherit pkgs lib;};
# mkPlugin = src: pname:
mkPlugin = src: pname: # (pkgs.vimUtils.buildVimPlugin
(pkgs.vimUtils.buildVimPlugin # {
{ # inherit pname src;
inherit pname src; # version = src.lastModifiedDate;
version = src.lastModifiedDate; # })
}) # .overrideAttrs {doCheck = false;};
.overrideAttrs {doCheck = false;};
in in
mkNvim { mkNvim {
withNodeJs = false; withNodeJs = false;
@@ -69,7 +67,6 @@ in
}) })
SchemaStore-nvim SchemaStore-nvim
roslyn-nvim roslyn-nvim
(mkPlugin ltex-extra "ltex-extra")
nvim-lint nvim-lint
(conform-nvim.overrideAttrs { (conform-nvim.overrideAttrs {
# clashes with oil # clashes with oil
@@ -135,7 +132,6 @@ in
nil nil
vscode-langservers-extracted # html, jsonls vscode-langservers-extracted # html, jsonls
marksman marksman
ltex-ls
texlab texlab
helm-ls helm-ls
zls zls
+18 -83
View File
@@ -1,87 +1,22 @@
vim.lsp.enable("lua_ls")
vim.lsp.enable("hls")
vim.lsp.enable("rust_analyzer")
vim.lsp.enable("clangd")
vim.lsp.enable("pyright")
vim.lsp.enable("nil_ls")
vim.lsp.enable("ts_ls")
vim.lsp.enable("yamlls")
vim.lsp.enable("marksman")
vim.lsp.enable("texlab")
vim.lsp.enable("html")
vim.lsp.enable("helm_ls")
vim.lsp.enable("zls")
vim.lsp.enable("gopls")
vim.lsp.enable("bashls")
vim.lsp.enable("jsonls")
return { return {
{ -- see https://github.com/seblyng/roslyn.nvim/pull/178
"lsp",
event = { "BufReadPost", "BufWritePost", "BufNewFile" },
load = function() end,
after = function()
-- see https://github.com/neovim/nvim-lspconfig/issues/3494
require("lspconfig").lua_ls.setup({})
require("lspconfig").hls.setup({})
require("lspconfig").rust_analyzer.setup({})
require("lspconfig").clangd.setup({})
require("lspconfig").pyright.setup({})
require("lspconfig").nil_ls.setup({})
require("lspconfig").ts_ls.setup({})
require("lspconfig").yamlls.setup({})
require("lspconfig").marksman.setup({})
require("lspconfig").texlab.setup({})
require("lspconfig").html.setup({})
require("lspconfig").helm_ls.setup({})
require("lspconfig").zls.setup({})
require("lspconfig").bashls.setup({
filetypes = { "sh", "zsh", "make" },
})
require("lspconfig").ltex.setup({
filetypes = { "markdown", "org", "plaintex", "rst", "tex", "pandoc", "rmd", "mail", "text" }
})
require("lspconfig").jsonls.setup({
on_new_config = function(new_config)
new_config.settings.json.schemas = new_config.settings.json.schemas or {}
vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
end,
settings = {
json = {
format = {
enable = true,
},
validate = { enable = true },
},
},
})
require("lspconfig").gopls.setup({
settings = {
-- https://go.googlesource.com/vscode-go/+/HEAD/docs/settings.md#settings-for
gopls = {
analyses = {
nilness = true,
unusedparams = true,
unusedwrite = true,
useany = true
},
experimentalPostfixCompletions = true,
gofumpt = true,
staticcheck = true,
usePlaceholders = true,
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true
}
}
}
})
end,
},
{
"ltex_extra.nvim",
ft = { "markdown", "tex" },
opts = {
-- See https://valentjn.github.io/ltex/supported-languages.html#natural-languages
load_langs = { 'en-US' },
},
after = function(plug)
require("ltex_extra").setup(plug.opts)
end,
},
{ {
"roslyn.nvim", "roslyn.nvim",
ft = { "cs", "vb" }, ft = { "cs", "vb" },