nixvimConfigs/fiesta/setups/treesitter: init

This commit is contained in:
Gabriel Arazas 2024-01-26 21:18:16 +08:00
parent ed1264c062
commit c8cd8b44ff
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
3 changed files with 40 additions and 0 deletions

View File

@ -5,6 +5,7 @@
imports = [ ./modules ]; imports = [ ./modules ];
nixvimConfigs.fiesta.setups = { nixvimConfigs.fiesta.setups = {
treesitter.enable = true;
desktop-utils.enable = true; desktop-utils.enable = true;
}; };

View File

@ -1,5 +1,6 @@
{ {
imports = [ imports = [
./setups/desktop-utils.nix ./setups/desktop-utils.nix
./setups/treesitter.nix
]; ];
} }

View File

@ -0,0 +1,38 @@
{ config, lib, pkgs, ... }:
let
nixvimCfg = config.nixvimConfigs.fiesta;
cfg = nixvimCfg.setups.treesitter;
in
{
options.nixvimConfigs.fiesta.setups.treesitter.enable =
lib.mkEnableOption "tree-sitter setup for Fiesta NixVim";
config = lib.mkIf cfg.enable {
# The main star of the show.
plugins.treesitter = {
enable = true;
# Install all of the grammars with Nix. We can easily replace it if we
# want to.
nixGrammars = true;
ensureInstalled = "all";
# Enable all of its useful features.
folding = true;
indent = true;
};
# Enable some more context for me.
plugins.treesitter-context = {
enable = true;
lineNumbers = true;
maxLines = 10;
};
# Show me your moves.
plugins.treesitter-textobjects = {
enable = true;
};
};
}