Initial commit
This commit is contained in:
commit
430194beda
109 changed files with 9066 additions and 0 deletions
42
modules/nixos/nixvim/plugins/treesitter.nix
Normal file
42
modules/nixos/nixvim/plugins/treesitter.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.nixvim;
|
||||
plugin = cfg.plugins.treesitter;
|
||||
|
||||
cc = "${pkgs.gcc}/bin/gcc";
|
||||
|
||||
inherit (lib) mkDefault mkIf;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
programs.nixvim = {
|
||||
plugins.treesitter = {
|
||||
enable = mkDefault true;
|
||||
nixvimInjections = mkDefault true;
|
||||
settings = {
|
||||
folding.enable = mkDefault true;
|
||||
highlight.enable = mkDefault true;
|
||||
indent.enable = mkDefault true;
|
||||
};
|
||||
};
|
||||
plugins.treesitter-context = mkIf plugin.enable { enable = mkDefault true; };
|
||||
plugins.treesitter-textobjects = mkIf plugin.enable { enable = mkDefault true; };
|
||||
};
|
||||
|
||||
# Fix for: ERROR `cc` executable not found.
|
||||
home.sessionVariables = mkIf plugin.enable {
|
||||
CC = mkDefault cc;
|
||||
};
|
||||
|
||||
# Fix for: WARNING `tree-sitter` executable not found
|
||||
home.packages = mkIf plugin.enable [
|
||||
plugin.package
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue