nix-config/modules/home-manager/nvim/treesitter/default.nix
Gabe Venberg 9eb783a3e8 moved home-manager options to the "home" namespace
this frees up the "host" namespace for host-wide options.
2024-04-23 16:56:34 -05:00

56 lines
1.2 KiB
Nix

{
config,
pkgs,
lib,
...
}: {
options = {
home.nvim.enable-treesitter = lib.mkOption {
default = false;
type = lib.types.bool;
description = ''
enable nvim treesitter
'';
};
};
config =
lib.mkIf config.home.nvim.enable-treesitter
{
home.nvim.enable-completions = true;
programs.nixvim = {
plugins.treesitter = {
enable = true;
folding = true;
indent = true;
nixvimInjections = true;
};
plugins.treesitter-context.enable = true;
plugins.indent-blankline.enable = true;
extraPlugins = with pkgs.vimPlugins; [
treesj
];
extraConfigLua = ''
require("treesj").setup({
use_default_keymaps=false,
})
'';
keymaps = [
{
action = ":TSJToggle<CR>";
key = "<leader>j";
mode = "n";
options = {
silent = true;
desc = "tree sitter join toggle";
};
}
];
};
};
imports = [
./rainbow-delimiters.nix
./arial.nix
./tree-sitter-nu.nix
];
}