diff --git a/configuration.nix b/configuration.nix index 6e3175ef..6629810d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -18,10 +18,6 @@ isMaximal: { }; lsp = { - # This must be enabled for the language modules to hook into - # the LSP API. - enable = true; - formatOnSave = true; lspkind.enable = false; lightbulb.enable = true; @@ -42,7 +38,8 @@ isMaximal: { # This section does not include a comprehensive list of available language modules. # To list all available language module options, please visit the nvf manual. languages = { - enableFormat = true; # + enableLSP = true; + enableFormat = true; enableTreesitter = true; enableExtraDiagnostics = true; diff --git a/docs/release-notes/rl-0.3.md b/docs/release-notes/rl-0.3.md index 089f01f7..87ae5648 100644 --- a/docs/release-notes/rl-0.3.md +++ b/docs/release-notes/rl-0.3.md @@ -50,8 +50,9 @@ soon. - A new section has been added for language support: `vim.languages.`. - - The options `enableLSP` [](#opt-vim.languages.enableTreesitter), etc. will - enable the respective section for all languages that have been enabled. + - The options [](#opt-vim.languages.enableLSP), + [](#opt-vim.languages.enableTreesitter), etc. will enable the respective + section for all languages that have been enabled. - All LSP languages have been moved here - `plantuml` and `markdown` have been moved here - A new section has been added for `html`. The old diff --git a/flake/templates/standalone/flake.nix b/flake/templates/standalone/flake.nix index 1057a6d5..79617260 100644 --- a/flake/templates/standalone/flake.nix +++ b/flake/templates/standalone/flake.nix @@ -26,22 +26,12 @@ config.vim = { theme.enable = true; - lsp = { - # Enable LSP functionality globally. This is required for modules found - # in `vim.languages` to enable relevant LSPs. - enable = true; - - # You may define your own LSP configurations using `vim.lsp.servers` in - # nvf without ever needing lspconfig to do it. This will use the native - # API provided by Neovim > 0.11 - servers = {}; - }; - # Language support and automatic configuration of companion plugins. # Note that enabling, e.g., languages..diagnostics will automatically # enable top-level options such as enableLSP or enableExtraDiagnostics as # they are needed. languages = { + enableLSP = true; enableFormat = true; enableTreesitter = true; enableExtraDiagnostics = true; diff --git a/modules/neovim/init/lsp.nix b/modules/neovim/init/lsp.nix index b89c3fde..faef0f93 100644 --- a/modules/neovim/init/lsp.nix +++ b/modules/neovim/init/lsp.nix @@ -5,7 +5,7 @@ }: let inherit (builtins) filter; inherit (lib.modules) mkIf mkMerge mkDefault; - inherit (lib.options) mkOption mkEnableOption; + inherit (lib.options) mkOption; inherit (lib.types) attrsOf; inherit (lib.strings) concatLines; inherit (lib.attrsets) mapAttrsToList attrNames filterAttrs; @@ -27,48 +27,37 @@ enabledServers = filterAttrs (_: u: u.enable) cfg.servers; in { options = { - vim.lsp = { - enable = mkEnableOption '' - global LSP functionality for Neovim. - - This option controls whether to enable LSP functionality within modules under - {option}`vim.languages`. You do not need to set this to `true` for language - servers defined in {option}`vim.lsp.servers` to take effect, since they are - enabled automatically. - ''; - - servers = mkOption { - type = attrsOf lspOptions; - default = {}; - example = '' - { - "*" = { - root_markers = [".git"]; - capabilities = { - textDocument = { - semanticTokens = { - multilineTokenSupport = true; - }; + vim.lsp.servers = mkOption { + type = attrsOf lspOptions; + default = {}; + example = '' + { + "*" = { + root_markers = [".git"]; + capabilities = { + textDocument = { + semanticTokens = { + multilineTokenSupport = true; }; }; }; + }; - "clangd" = { - filetypes = ["c"]; - }; - } - ''; - description = '' - LSP configurations that will be managed using `vim.lsp.config()` and related - utilities added in Neovim 0.11. LSPs defined here will be added to the - resulting {file}`init.lua` using `vim.lsp.config` and enabled through - `vim.lsp.enable()` API from Neovim below the configuration table. + "clangd" = { + filetypes = ["c"]; + }; + } + ''; + description = '' + LSP configurations that will be managed using `vim.lsp.config()` and + related utilities added in Neovim 0.11. LSPs defined here will be + added to the resulting {file}`init.lua` using `vim.lsp.config` and + enabled through `vim.lsp.enable` below the configuration table. - You may review the generated configuration by running {command}`nvf-print-config` - in a shell. Please see {command}`:help lsp-config` for more details - on the underlying API. - ''; - }; + You may review the generated configuration by running {command}`nvf-print-config` + in a shell. Please see {command}`:help lsp-config` for more details + on the underlying API. + ''; }; }; diff --git a/modules/plugins/languages/asm.nix b/modules/plugins/languages/asm.nix index 9fe58a76..a0e96cef 100644 --- a/modules/plugins/languages/asm.nix +++ b/modules/plugins/languages/asm.nix @@ -20,7 +20,7 @@ in { }; lsp = { - enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.languages.enableLSP;}; package = mkOption { type = package; diff --git a/modules/plugins/languages/astro.nix b/modules/plugins/languages/astro.nix index b7a69bda..2ecbbe47 100644 --- a/modules/plugins/languages/astro.nix +++ b/modules/plugins/languages/astro.nix @@ -81,7 +81,7 @@ in { }; lsp = { - enable = mkEnableOption "Astro LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Astro LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/bash.nix b/modules/plugins/languages/bash.nix index e02596cf..bfe01032 100644 --- a/modules/plugins/languages/bash.nix +++ b/modules/plugins/languages/bash.nix @@ -56,7 +56,7 @@ in { }; lsp = { - enable = mkEnableOption "Enable Bash LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Enable Bash LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Bash LSP server to use"; diff --git a/modules/plugins/languages/clang.nix b/modules/plugins/languages/clang.nix index 2db178e9..bb30cc95 100644 --- a/modules/plugins/languages/clang.nix +++ b/modules/plugins/languages/clang.nix @@ -98,7 +98,7 @@ in { }; lsp = { - enable = mkEnableOption "clang LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "clang LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "The clang LSP server to use"; diff --git a/modules/plugins/languages/csharp.nix b/modules/plugins/languages/csharp.nix index 49ae4985..af7f36e0 100644 --- a/modules/plugins/languages/csharp.nix +++ b/modules/plugins/languages/csharp.nix @@ -91,7 +91,7 @@ in { }; lsp = { - enable = mkEnableOption "C# LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "C# LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "C# LSP server to use"; type = enum (attrNames servers); diff --git a/modules/plugins/languages/css.nix b/modules/plugins/languages/css.nix index 0147fba3..d103f241 100644 --- a/modules/plugins/languages/css.nix +++ b/modules/plugins/languages/css.nix @@ -80,7 +80,7 @@ in { }; lsp = { - enable = mkEnableOption "CSS LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "CSS LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "CSS LSP server to use"; diff --git a/modules/plugins/languages/cue.nix b/modules/plugins/languages/cue.nix index bd446cbf..313e3233 100644 --- a/modules/plugins/languages/cue.nix +++ b/modules/plugins/languages/cue.nix @@ -21,7 +21,7 @@ in { }; lsp = { - enable = mkEnableOption "CUE LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "CUE LSP support" // {default = config.vim.languages.enableLSP;}; package = mkOption { type = package; diff --git a/modules/plugins/languages/dart.nix b/modules/plugins/languages/dart.nix index 9cbd0783..7b9584b9 100644 --- a/modules/plugins/languages/dart.nix +++ b/modules/plugins/languages/dart.nix @@ -77,7 +77,7 @@ in { flutter-tools = { enable = mkOption { type = bool; - default = config.vim.lsp.enable; + default = config.vim.languages.enableLSP; description = "Enable flutter-tools for flutter support"; }; diff --git a/modules/plugins/languages/default.nix b/modules/plugins/languages/default.nix index 25b99080..b889e60a 100644 --- a/modules/plugins/languages/default.nix +++ b/modules/plugins/languages/default.nix @@ -1,5 +1,8 @@ -{lib, ...}: let - inherit (lib.modules) mkRenamedOptionModule; +{ + config, + lib, + ... +}: let inherit (lib.nvim.languages) mkEnable; in { imports = [ @@ -45,12 +48,13 @@ in { ./wgsl.nix ./yaml.nix ./ruby.nix - - # This is now a hard deprecation. - (mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"]) ]; options.vim.languages = { + # LSPs are now built into Neovim, and we should enable them by default + # if `vim.lsp.enable` is true. + enableLSP = mkEnable "LSP" // {default = config.vim.lsp.enable;}; + # Those are still managed by plugins, and should be enabled here. enableDAP = mkEnable "Debug Adapter"; enableTreesitter = mkEnable "Treesitter"; diff --git a/modules/plugins/languages/elixir.nix b/modules/plugins/languages/elixir.nix index 241efd8e..7b3a0256 100644 --- a/modules/plugins/languages/elixir.nix +++ b/modules/plugins/languages/elixir.nix @@ -53,7 +53,7 @@ in { }; lsp = { - enable = mkEnableOption "Elixir LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Elixir LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Elixir LSP server to use"; diff --git a/modules/plugins/languages/fsharp.nix b/modules/plugins/languages/fsharp.nix index 6ed0ccab..966b0349 100644 --- a/modules/plugins/languages/fsharp.nix +++ b/modules/plugins/languages/fsharp.nix @@ -51,7 +51,7 @@ in { }; lsp = { - enable = mkEnableOption "F# LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "F# LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { type = enum (attrNames servers); default = defaultServer; diff --git a/modules/plugins/languages/gleam.nix b/modules/plugins/languages/gleam.nix index 272ef51e..284d3443 100644 --- a/modules/plugins/languages/gleam.nix +++ b/modules/plugins/languages/gleam.nix @@ -41,7 +41,7 @@ in { }; lsp = { - enable = mkEnableOption "Gleam LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Gleam LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/go.nix b/modules/plugins/languages/go.nix index bab0ff4a..3f232669 100644 --- a/modules/plugins/languages/go.nix +++ b/modules/plugins/languages/go.nix @@ -67,7 +67,7 @@ in { }; lsp = { - enable = mkEnableOption "Go LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Go LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Go LSP server to use"; diff --git a/modules/plugins/languages/haskell.nix b/modules/plugins/languages/haskell.nix index f50c9f09..ff6c7d78 100644 --- a/modules/plugins/languages/haskell.nix +++ b/modules/plugins/languages/haskell.nix @@ -25,7 +25,7 @@ in { }; lsp = { - enable = mkEnableOption "LSP support for Haskell" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "LSP support for Haskell" // {default = config.vim.languages.enableLSP;}; package = mkOption { description = "Haskell LSP package or command to run the Haskell LSP"; example = ''[ (lib.getExe pkgs.haskellPackages.haskell-language-server) "--debug" ]''; diff --git a/modules/plugins/languages/hcl.nix b/modules/plugins/languages/hcl.nix index e702170c..3a3db782 100644 --- a/modules/plugins/languages/hcl.nix +++ b/modules/plugins/languages/hcl.nix @@ -43,7 +43,7 @@ in { }; lsp = { - enable = mkEnableOption "HCL LSP support (terraform-ls)" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "HCL LSP support (terraform-ls)" // {default = config.vim.languages.enableLSP;}; # TODO: (maybe, is it better?) it would be cooler to use vscode-extensions.hashicorp.hcl probably, shouldn't be too hard package = mkOption { type = package; diff --git a/modules/plugins/languages/helm.nix b/modules/plugins/languages/helm.nix index ffe115c9..d3fd636e 100644 --- a/modules/plugins/languages/helm.nix +++ b/modules/plugins/languages/helm.nix @@ -54,7 +54,7 @@ in { }; lsp = { - enable = mkEnableOption "Helm LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Helm LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Helm LSP server to use"; diff --git a/modules/plugins/languages/java.nix b/modules/plugins/languages/java.nix index 2e26feea..dc46fcfe 100644 --- a/modules/plugins/languages/java.nix +++ b/modules/plugins/languages/java.nix @@ -23,7 +23,7 @@ in { }; lsp = { - enable = mkEnableOption "Java LSP support (java-language-server)" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Java LSP support (java-language-server)" // {default = config.vim.languages.enableLSP;}; package = mkOption { description = "java language server package, or the command to run as a list of strings"; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; diff --git a/modules/plugins/languages/julia.nix b/modules/plugins/languages/julia.nix index 8c48b070..aa537df9 100644 --- a/modules/plugins/languages/julia.nix +++ b/modules/plugins/languages/julia.nix @@ -78,7 +78,7 @@ in { lsp = { enable = mkOption { type = bool; - default = config.vim.lsp.enable; + default = config.vim.languages.enableLSP; description = '' Whether to enable Julia LSP support. diff --git a/modules/plugins/languages/kotlin.nix b/modules/plugins/languages/kotlin.nix index 1118afdf..2ddc63e9 100644 --- a/modules/plugins/languages/kotlin.nix +++ b/modules/plugins/languages/kotlin.nix @@ -30,7 +30,7 @@ in { }; lsp = { - enable = mkEnableOption "Kotlin LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Kotlin LSP support" // {default = config.vim.languages.enableLSP;}; package = mkOption { description = "kotlin_language_server package with Kotlin runtime"; diff --git a/modules/plugins/languages/lua.nix b/modules/plugins/languages/lua.nix index 9f56cbea..d5be4905 100644 --- a/modules/plugins/languages/lua.nix +++ b/modules/plugins/languages/lua.nix @@ -43,7 +43,7 @@ in { }; lsp = { - enable = mkEnableOption "Lua LSP support via LuaLS" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Lua LSP support via LuaLS" // {default = config.vim.languages.enableLSP;}; package = mkOption { description = "LuaLS package, or the command to run as a list of strings"; diff --git a/modules/plugins/languages/markdown.nix b/modules/plugins/languages/markdown.nix index eeb80e8d..4563bc44 100644 --- a/modules/plugins/languages/markdown.nix +++ b/modules/plugins/languages/markdown.nix @@ -67,7 +67,7 @@ in { }; lsp = { - enable = mkEnableOption "Enable Markdown LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Enable Markdown LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/nim.nix b/modules/plugins/languages/nim.nix index d9a29e37..69288223 100644 --- a/modules/plugins/languages/nim.nix +++ b/modules/plugins/languages/nim.nix @@ -54,7 +54,7 @@ in { }; lsp = { - enable = mkEnableOption "Nim LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Nim LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Nim LSP server to use"; type = str; diff --git a/modules/plugins/languages/nix.nix b/modules/plugins/languages/nix.nix index 83022adf..ad16a34e 100644 --- a/modules/plugins/languages/nix.nix +++ b/modules/plugins/languages/nix.nix @@ -143,7 +143,7 @@ in { }; lsp = { - enable = mkEnableOption "Nix LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Nix LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Nix LSP server to use"; type = enum (attrNames servers); diff --git a/modules/plugins/languages/nu.nix b/modules/plugins/languages/nu.nix index bd007fc8..eab0385c 100644 --- a/modules/plugins/languages/nu.nix +++ b/modules/plugins/languages/nu.nix @@ -40,7 +40,7 @@ in { }; lsp = { - enable = mkEnableOption "Nu LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Nu LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { type = str; default = defaultServer; diff --git a/modules/plugins/languages/ocaml.nix b/modules/plugins/languages/ocaml.nix index 995ca04d..568b846e 100644 --- a/modules/plugins/languages/ocaml.nix +++ b/modules/plugins/languages/ocaml.nix @@ -49,7 +49,7 @@ in { }; lsp = { - enable = mkEnableOption "OCaml LSP support (ocaml-lsp)" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "OCaml LSP support (ocaml-lsp)" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "OCaml LSP server to user"; type = enum (attrNames servers); diff --git a/modules/plugins/languages/odin.nix b/modules/plugins/languages/odin.nix index 6d20351c..7a32db93 100644 --- a/modules/plugins/languages/odin.nix +++ b/modules/plugins/languages/odin.nix @@ -41,7 +41,7 @@ in { }; lsp = { - enable = mkEnableOption "Odin LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Odin LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/php.nix b/modules/plugins/languages/php.nix index 61ff0425..4dccc8cd 100644 --- a/modules/plugins/languages/php.nix +++ b/modules/plugins/languages/php.nix @@ -95,7 +95,7 @@ in { }; lsp = { - enable = mkEnableOption "PHP LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "PHP LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "PHP LSP server to use"; diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index bec7ec8b..9905716e 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -169,7 +169,7 @@ in { }; lsp = { - enable = mkEnableOption "Python LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Python LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Python LSP server to use"; diff --git a/modules/plugins/languages/r.nix b/modules/plugins/languages/r.nix index 894c63f6..fcadcc37 100644 --- a/modules/plugins/languages/r.nix +++ b/modules/plugins/languages/r.nix @@ -79,7 +79,7 @@ in { }; lsp = { - enable = mkEnableOption "R LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "R LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "R LSP server to use"; diff --git a/modules/plugins/languages/ruby.nix b/modules/plugins/languages/ruby.nix index ab0e0905..2f42aa4f 100644 --- a/modules/plugins/languages/ruby.nix +++ b/modules/plugins/languages/ruby.nix @@ -57,7 +57,7 @@ in { }; lsp = { - enable = mkEnableOption "Ruby LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Ruby LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/rust.nix b/modules/plugins/languages/rust.nix index 677f7d3b..2181623a 100644 --- a/modules/plugins/languages/rust.nix +++ b/modules/plugins/languages/rust.nix @@ -43,7 +43,7 @@ in { }; lsp = { - enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.languages.enableLSP;}; package = mkOption { description = "rust-analyzer package, or the command to run as a list of strings"; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; diff --git a/modules/plugins/languages/scala.nix b/modules/plugins/languages/scala.nix index b5382415..f769d092 100644 --- a/modules/plugins/languages/scala.nix +++ b/modules/plugins/languages/scala.nix @@ -33,7 +33,7 @@ in { }; lsp = { - enable = mkEnableOption "Scala LSP support (metals)" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Scala LSP support (metals)" // {default = config.vim.languages.enableLSP;}; package = mkPackageOption pkgs "metals" { default = ["metals"]; }; diff --git a/modules/plugins/languages/sql.nix b/modules/plugins/languages/sql.nix index add46c15..277dbeef 100644 --- a/modules/plugins/languages/sql.nix +++ b/modules/plugins/languages/sql.nix @@ -79,7 +79,7 @@ in { }; lsp = { - enable = mkEnableOption "SQL LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "SQL LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "SQL LSP server to use"; diff --git a/modules/plugins/languages/svelte.nix b/modules/plugins/languages/svelte.nix index 08a807c7..536ff2c1 100644 --- a/modules/plugins/languages/svelte.nix +++ b/modules/plugins/languages/svelte.nix @@ -77,7 +77,7 @@ in { }; lsp = { - enable = mkEnableOption "Svelte LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Svelte LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Svelte LSP server to use"; diff --git a/modules/plugins/languages/tailwind.nix b/modules/plugins/languages/tailwind.nix index fbe707ba..594f6d9d 100644 --- a/modules/plugins/languages/tailwind.nix +++ b/modules/plugins/languages/tailwind.nix @@ -35,7 +35,7 @@ in { enable = mkEnableOption "Tailwindcss language support"; lsp = { - enable = mkEnableOption "Tailwindcss LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Tailwindcss LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Tailwindcss LSP server to use"; diff --git a/modules/plugins/languages/terraform.nix b/modules/plugins/languages/terraform.nix index 095da072..33bb9357 100644 --- a/modules/plugins/languages/terraform.nix +++ b/modules/plugins/languages/terraform.nix @@ -20,7 +20,7 @@ in { }; lsp = { - enable = mkEnableOption "Terraform LSP support (terraform-ls)" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Terraform LSP support (terraform-ls)" // {default = config.vim.languages.enableLSP;}; package = mkOption { description = "terraform-ls package"; diff --git a/modules/plugins/languages/ts.nix b/modules/plugins/languages/ts.nix index 5a1e5889..df1353ab 100644 --- a/modules/plugins/languages/ts.nix +++ b/modules/plugins/languages/ts.nix @@ -120,7 +120,7 @@ in { }; lsp = { - enable = mkEnableOption "Typescript/Javascript LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Typescript/Javascript LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Typescript/Javascript LSP server to use"; diff --git a/modules/plugins/languages/typst.nix b/modules/plugins/languages/typst.nix index 08a2252b..8c65ae2c 100644 --- a/modules/plugins/languages/typst.nix +++ b/modules/plugins/languages/typst.nix @@ -76,7 +76,7 @@ in { }; lsp = { - enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Typst LSP server to use"; diff --git a/modules/plugins/languages/vala.nix b/modules/plugins/languages/vala.nix index 220926d0..da65a372 100644 --- a/modules/plugins/languages/vala.nix +++ b/modules/plugins/languages/vala.nix @@ -50,7 +50,7 @@ in { }; lsp = { - enable = mkEnableOption "Vala LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Vala LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { description = "Vala LSP server to use"; type = enum (attrNames servers); diff --git a/modules/plugins/languages/wgsl.nix b/modules/plugins/languages/wgsl.nix index f374543e..7c8a1016 100644 --- a/modules/plugins/languages/wgsl.nix +++ b/modules/plugins/languages/wgsl.nix @@ -42,7 +42,7 @@ in { }; lsp = { - enable = mkEnableOption "WGSL LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "WGSL LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/yaml.nix b/modules/plugins/languages/yaml.nix index 7a1a4552..c84b17cd 100644 --- a/modules/plugins/languages/yaml.nix +++ b/modules/plugins/languages/yaml.nix @@ -55,7 +55,7 @@ in { }; lsp = { - enable = mkEnableOption "YAML LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "YAML LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/languages/zig.nix b/modules/plugins/languages/zig.nix index 89307eab..2aa0e2b6 100644 --- a/modules/plugins/languages/zig.nix +++ b/modules/plugins/languages/zig.nix @@ -72,7 +72,7 @@ in { }; lsp = { - enable = mkEnableOption "Zig LSP support" // {default = config.vim.lsp.enable;}; + enable = mkEnableOption "Zig LSP support" // {default = config.vim.languages.enableLSP;}; server = mkOption { type = enum (attrNames servers); diff --git a/modules/plugins/lsp/lspconfig/config.nix b/modules/plugins/lsp/lspconfig/config.nix index 16cba488..1c1f0a0a 100644 --- a/modules/plugins/lsp/lspconfig/config.nix +++ b/modules/plugins/lsp/lspconfig/config.nix @@ -14,6 +14,8 @@ in { config = mkIf cfg.lspconfig.enable (mkMerge [ { vim = { + lsp.enable = true; + startPlugins = ["nvim-lspconfig"]; pluginRC.lspconfig = entryAfter ["lsp-setup"] '' diff --git a/modules/plugins/lsp/module.nix b/modules/plugins/lsp/module.nix index 6b63d725..f408d873 100644 --- a/modules/plugins/lsp/module.nix +++ b/modules/plugins/lsp/module.nix @@ -3,12 +3,11 @@ inherit (lib.nvim.binds) mkMappingOption; in { options.vim.lsp = { + enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options"; formatOnSave = mkEnableOption "format on save"; - inlayHints = { enable = mkEnableOption "inlay hints"; }; - mappings = { goToDefinition = mkMappingOption "Go to definition" diff --git a/modules/plugins/ui/breadcrumbs/breadcrumbs.nix b/modules/plugins/ui/breadcrumbs/breadcrumbs.nix index 72351ecc..2faee6c8 100644 --- a/modules/plugins/ui/breadcrumbs/breadcrumbs.nix +++ b/modules/plugins/ui/breadcrumbs/breadcrumbs.nix @@ -4,7 +4,7 @@ ... }: let inherit (lib.options) mkOption mkEnableOption; - inherit (lib.types) nullOr listOf enum bool str int; + inherit (lib.types) nullOr listOf enum bool str int either; inherit (lib.modules) mkRenamedOptionModule; inherit (lib.nvim.types) mkPluginSetupOption borderType; mkSimpleIconOption = default: @@ -74,7 +74,7 @@ in { ::: {.note} This will pass `draw_empty` to the `nvim_navic` winbar component, which causes the component to be drawn even - if it's empty. + if it's empty ::: ''; }; @@ -86,163 +86,145 @@ in { close = mkOption { type = str; default = ""; - description = "Close and return the cursor to its original location."; + description = "keybinding to close Navbuddy UI"; }; nextSibling = mkOption { type = str; default = "j"; - description = "Navigate to the next sibling node."; + description = "keybinding to navigate to the next sibling node"; }; previousSibling = mkOption { type = str; default = "k"; - description = "Navigate to the previous sibling node."; + description = "keybinding to navigate to the previous sibling node"; }; parent = mkOption { type = str; default = "h"; - description = "Navigate to the parent node."; + description = "keybinding to navigate to the parent node"; }; children = mkOption { type = str; default = "l"; - description = "Navigate to the child node."; + description = "keybinding to navigate to the child node"; }; root = mkOption { type = str; default = "0"; - description = "Navigate to the root node."; + description = "keybinding to navigate to the root node"; }; visualName = mkOption { type = str; default = "v"; - description = "Select the name visually."; + description = "visual selection of name"; }; visualScope = mkOption { type = str; default = "V"; - description = "Select the scope visually."; + description = "visual selection of scope"; }; yankName = mkOption { type = str; default = "y"; - description = "Yank the name to system clipboard."; + description = "yank the name to system clipboard"; }; yankScope = mkOption { type = str; default = "Y"; - description = "Yank the scope to system clipboard."; + description = "yank the scope to system clipboard"; }; insertName = mkOption { type = str; default = "i"; - description = "Insert at the start of name."; + description = "insert at start of name"; }; insertScope = mkOption { type = str; default = "I"; - description = "Insert at the start of scope."; + description = "insert at start of scope"; }; appendName = mkOption { type = str; default = "a"; - description = "Insert at the end of name."; + description = "insert at end of name"; }; appendScope = mkOption { type = str; default = "A"; - description = "Insert at the end of scope."; + description = "insert at end of scope"; }; rename = mkOption { type = str; default = "r"; - description = "Rename the node."; + description = "rename the node"; }; delete = mkOption { type = str; default = "d"; - description = "Delete the node."; + description = "delete the node"; }; foldCreate = mkOption { type = str; default = "f"; - description = "Create a new fold of the node."; + description = "create a new fold"; }; foldDelete = mkOption { type = str; default = "F"; - description = "Delete the current fold of the node."; + description = "delete the current fold"; }; comment = mkOption { type = str; default = "c"; - description = "Comment the node."; + description = "comment the node"; }; select = mkOption { type = str; default = ""; - description = "Goto the node."; + description = "goto selected symbol"; }; moveDown = mkOption { type = str; default = "J"; - description = "Move the node down."; + description = "move focused node down"; }; moveUp = mkOption { type = str; default = "K"; - description = "Move the node up."; - }; - - togglePreview = mkOption { - type = str; - default = "s"; - description = "Toggle the preview."; - }; - - vsplit = mkOption { - type = str; - default = ""; - description = "Open the node in a vertical split."; - }; - - hsplit = mkOption { - type = str; - default = ""; - description = "Open the node in a horizontal split."; + description = "move focused node up"; }; telescope = mkOption { type = str; default = "t"; - description = "Start fuzzy finder at the current level."; + description = "fuzzy finder at current level"; }; help = mkOption { type = str; default = "g?"; - description = "Open the mappings help window."; + description = "open mapping help window"; }; }; @@ -250,7 +232,7 @@ in { useDefaultMappings = mkOption { type = bool; default = true; - description = "Add the default Navbuddy keybindings in addition to the keybinding added by this module."; + description = "use default Navbuddy keybindings (disables user-specified keybinds)"; }; window = { @@ -260,13 +242,13 @@ in { border = mkOption { type = borderType; default = config.vim.ui.borders.globalStyle; - description = "The border style to use."; + description = "border style to use"; }; scrolloff = mkOption { type = nullOr int; default = null; - description = "The scrolloff value within a navbuddy window."; + description = "Scrolloff value within navbuddy window"; }; sections = { @@ -283,7 +265,7 @@ in { border = mkOption { type = borderType; default = config.vim.ui.borders.globalStyle; - description = "The border style to use for the left section of the Navbuddy UI."; + description = "border style to use for the left section of Navbuddy UI"; }; }; @@ -300,7 +282,7 @@ in { border = mkOption { type = borderType; default = config.vim.ui.borders.globalStyle; - description = "The border style to use for the middle section of the Navbuddy UI."; + description = "border style to use for the middle section of Navbuddy UI"; }; }; @@ -310,13 +292,13 @@ in { border = mkOption { type = borderType; default = config.vim.ui.borders.globalStyle; - description = "The border style to use for the right section of the Navbuddy UI."; + description = "border style to use for the right section of Navbuddy UI"; }; preview = mkOption { type = enum ["leaf" "always" "never"]; default = "leaf"; - description = "The display mode of the preview on the right section."; + description = "display mode of the preview on the right section"; }; }; }; @@ -335,13 +317,13 @@ in { auto_attach = mkOption { type = bool; default = true; - description = "Whether to attach to LSP server manually."; + description = "Whether to attach to LSP server manually"; }; preference = mkOption { type = nullOr (listOf str); default = null; - description = "The preference list ranking LSP servers."; + description = "list of lsp server names in order of preference"; }; }; @@ -349,25 +331,25 @@ in { followNode = mkOption { type = bool; default = true; - description = "Whether to keep the current node in focus in the source buffer."; + description = "keep the current node in focus on the source buffer"; }; highlight = mkOption { type = bool; default = true; - description = "Whether to highlight the currently focused node in the source buffer."; + description = "highlight the currently focused node"; }; reorient = mkOption { type = enum ["smart" "top" "mid" "none"]; default = "smart"; - description = "The mode for reorienting the source buffer after moving nodes."; + description = "reorient buffer after changing nodes"; }; scrolloff = mkOption { type = nullOr int; default = null; - description = "The scrolloff value in the source buffer when Navbuddy is open."; + description = "scrolloff value when navbuddy is open"; }; }; diff --git a/modules/plugins/ui/breadcrumbs/config.nix b/modules/plugins/ui/breadcrumbs/config.nix index 324501a5..747a7773 100644 --- a/modules/plugins/ui/breadcrumbs/config.nix +++ b/modules/plugins/ui/breadcrumbs/config.nix @@ -64,11 +64,6 @@ in { ${cfg.navbuddy.mappings.moveDown} = mkLuaInline "actions.move_down()"; ${cfg.navbuddy.mappings.moveUp} = mkLuaInline "actions.move_up()"; - ${cfg.navbuddy.mappings.togglePreview} = mkLuaInline "actions.toggle_preview()"; - - ${cfg.navbuddy.mappings.vsplit} = mkLuaInline "actions.vsplit()"; - ${cfg.navbuddy.mappings.hsplit} = mkLuaInline "actions.hsplit()"; - ${cfg.navbuddy.mappings.telescope} = mkLuaInline '' actions.telescope({ layout_strategy = "horizontal",