mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
nixvimConfigs/trovebelt/setups/treesitter: init
This commit is contained in:
parent
ab8b139eb9
commit
24839f9a0f
@ -6,6 +6,7 @@
|
|||||||
config = {
|
config = {
|
||||||
nixvimConfigs.trovebelt.setups = {
|
nixvimConfigs.trovebelt.setups = {
|
||||||
lsp.enable = true;
|
lsp.enable = true;
|
||||||
|
treesitter.enable = true;
|
||||||
ui.enable = true;
|
ui.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./setups/lsp.nix
|
./setups/lsp.nix
|
||||||
|
./setups/treesitter.nix
|
||||||
./setups/ui.nix
|
./setups/ui.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
45
configs/nixvim/trovebelt/modules/setups/treesitter.nix
Normal file
45
configs/nixvim/trovebelt/modules/setups/treesitter.nix
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
nixvimCfg = config.nixvimConfigs.trovebelt;
|
||||||
|
cfg = nixvimCfg.setups.treesitter;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.nixvimConfigs.trovebelt.setups.treesitter.enable =
|
||||||
|
lib.mkEnableOption "tree-sitter setup with all parsers installed";
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
plugins.treesitter = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Install all of the grammars with Nix. We can easily replace it if we
|
||||||
|
# want to.
|
||||||
|
nixGrammars = true;
|
||||||
|
ensureInstalled = lib.mkDefault "all";
|
||||||
|
nixvimInjections = true;
|
||||||
|
|
||||||
|
# Enable all of its useful features.
|
||||||
|
folding = true;
|
||||||
|
indent = true;
|
||||||
|
incrementalSelection.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable some more context for me.
|
||||||
|
plugins.treesitter-context = {
|
||||||
|
enable = true;
|
||||||
|
lineNumbers = true;
|
||||||
|
maxLines = 7;
|
||||||
|
mode = "cursor";
|
||||||
|
separator = "*";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Some niceties for refactoring.
|
||||||
|
plugins.treesitter-refactor = {
|
||||||
|
enable = true;
|
||||||
|
highlightCurrentScope.enable = true;
|
||||||
|
highlightDefinitions.enable = true;
|
||||||
|
navigation.enable = true;
|
||||||
|
smartRename.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user