nixvimConfigs/trovebelt: update LSP config and enable installation of its servers

Just to make the all-encompassing Neovim config more usable.
This commit is contained in:
Gabriel Arazas 2025-03-07 09:43:20 +08:00
parent 75ca42754d
commit f6dc11606b
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
3 changed files with 87 additions and 70 deletions

View File

@ -32,7 +32,7 @@ in {
}; };
# Enable all of the debugging extensoins. # Enable all of the debugging extensoins.
plugins.dap.extensions.dap-go.enable = true; plugins.dap-go.enable = true;
plugins.dap.extensions.dap-python.enable = true; plugins.dap-python.enable = true;
}; };
} }

View File

@ -7,63 +7,76 @@ in {
options.nixvimConfigs.trovebelt.setups.lsp.enable = options.nixvimConfigs.trovebelt.setups.lsp.enable =
lib.mkEnableOption "LSP setup alongside the preferred servers installation"; lib.mkEnableOption "LSP setup alongside the preferred servers installation";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable (lib.mkMerge [
plugins.lsp.enable = true; {
plugins.lsp.enable = true;
# Make all of the preferred language servers. # Make all of the preferred language servers.
plugins.lsp.servers = let plugins.lsp.servers = let
servers = [ servers = [
"ansiblels" # For Ansible. "ansiblels" # For Ansible.
"astro" # For Astro. "astro" # For Astro.
"beancount" # For Beancount. "beancount" # For Beancount.
"bashls" # For Bash. "bashls" # For Bash.
"clangd" # For C/C++. "clangd" # For C/C++.
"clojure-lsp" # For Clojure. "clojure_lsp" # For Clojure.
"cmake" # For CMake. "cmake" # For CMake.
"cssls" # For CSS. "cssls" # For CSS.
"dagger" # For Dagger. "dagger" # For Dagger.
"dartls" # For Dart. "dartls" # For Dart.
"denols" # For Deno. "denols" # For Deno.
"dhall-lsp-server" # For Dhall. "dhall_lsp_server" # For Dhall.
"dockerls" # For Dockerfiles. "dockerls" # For Dockerfiles.
"efm" # For whatever. "efm" # For whatever.
"elixirls" # For Elixir. "elixirls" # For Elixir.
"elmls" # For Elm. "elmls" # For Elm.
"emmet-ls" # For Emmet support. "emmet_ls" # For Emmet support.
"eslint" # For JavaScript. "eslint" # For JavaScript.
"gdscript" # For Godot. "gdscript" # For Godot.
"gopls" # For Go. "gopls" # For Go.
"graphql" # For GraphQL. "graphql" # For GraphQL.
"hls" # For Haskell. "hls" # For Haskell.
"html" # For HTML. "html" # For HTML.
"htmx" # For HTMX. "htmx" # For HTMX.
"java-language-server" # For Java. "java_language_server" # For Java.
"jsonls" # For JSON. "jsonls" # For JSON.
"julials" # For Julia. "julials" # For Julia.
"kotlin-language-server" # For Kotlin. "kotlin_language_server" # For Kotlin.
"lemminx" # For XML. "lemminx" # For XML.
"lua-ls" # For Lua. "lua_ls" # For Lua.
"nil-ls" # For Nix. "nil_ls" # For Nix.
"nushell" # For Nushell. "nushell" # For Nushell.
"perlpls" # For Perl. "perlpls" # For Perl.
"phpactor" # For PHP. "phpactor" # For PHP.
"pyright" # For Python. "pyright" # For Python.
"rust-analyzer" # For Rust. "rust_analyzer" # For Rust.
"solargraph" # For Ruby. "solargraph" # For Ruby.
"svelte" # For Svelte. "svelte" # For Svelte.
"taplo" # For TOML. "taplo" # For TOML.
"tailwindcss" # For Tailwind CSS. "tailwindcss" # For Tailwind CSS.
"terraformls" # For Terraform. "terraformls" # For Terraform.
"tsserver" # For TypeScript. "ts_ls" # For TypeScript.
"typst-lsp" # For Typst. "typst_lsp" # For Typst.
"vls" # For V. "vls" # For V.
"volar" # For Vue. "volar" # For Vue.
"yamlls" # For YAML. "yamlls" # For YAML.
"zls" # For Zig. "zls" # For Zig.
]; ];
mkEnableServerConfig = server: mkEnableServerConfig = server:
lib.nameValuePair server { enable = true; }; lib.nameValuePair server { enable = true; };
in lib.listToAttrs (builtins.map mkEnableServerConfig servers); in lib.listToAttrs (builtins.map mkEnableServerConfig servers);
}; }
{
plugins.lsp.servers.rust_analyzer = {
installCargo = lib.mkDefault true;
installRustc = lib.mkDefault true;
};
plugins.lsp.servers.hls = {
installGhc = lib.mkDefault true;
};
}
]);
} }

View File

@ -41,19 +41,23 @@ in {
# Enable them status bars. # Enable them status bars.
plugins.lualine = { plugins.lualine = {
enable = true; enable = true;
iconsEnabled = true; settings = {
globalstatus = true; options = {
alwaysDivideMiddle = true; icons_enabled = true;
globalstatus = true;
always_divide_middle = true;
};
# Disable the section separators. # Disable the section separators.
sectionSeparators = { section_separators = {
left = ""; left = "";
right = ""; right = "";
}; };
sections = { sections = {
lualine_a = [ "mode" ]; lualine_a = [ "mode" ];
lualine_z = [ "location" ]; lualine_z = [ "location" ];
};
}; };
}; };
}; };