feat: refactor and separate LSP/language configurations

This commit is contained in:
NotAShelf 2023-04-17 23:27:27 +03:00
commit 6b512f132a
No known key found for this signature in database
GPG key ID: F0D14CCB5ED5AA22
30 changed files with 1266 additions and 522 deletions

View file

@ -5,51 +5,23 @@
...
}:
with lib;
with builtins; {
with builtins; let
cfg = config.vim.treesitter;
usingNvimCmp = config.vim.autocomplete.enable && config.vim.autocomplete.type == "nvim-cmp";
in {
options.vim.treesitter = {
enable = mkOption {
default = false;
type = types.bool;
description = "Enable tree-sitter [nvim-treesitter]";
};
enable = mkEnableOption "treesitter, also enabled automatically through language options";
fold = mkOption {
default = false;
type = types.bool;
description = "Enable fold with tree-sitter";
};
fold = mkEnableOption "fold with treesitter";
autotagHtml = mkOption {
default = false;
type = types.bool;
description = "Enable autoclose and rename html tag [nvim-ts-autotag]";
};
autotagHtml = mkEnableOption "autoclose and rename html tag";
grammars = mkOption {
type = with types; listOf package;
default = with (pkgs.vimPlugins.nvim-treesitter.builtGrammars);
[
c
cpp
nix
python
rust
markdown
comment
toml
make
tsx
html
javascript
css
graphql
json
zig
]
++ (optional config.vim.notes.orgmode.enable org); # add orgmode grammar if enabled
default = [];
description = ''
List of treesitter grammars to install.
When enabling a language, its treesitter grammar is added for you.
List of treesitter grammars to install. For supported languages
use the `vim.language.<lang>.treesitter` option
'';
};
};