flake/nixos/nvim/plugins/treesitter.nix
2025-02-04 11:39:52 -06:00

70 lines
1.5 KiB
Nix

{ pkgs, ... }:
{
programs.nixvim = {
plugins = {
treesitter-refactor = {
enable = true;
highlightCurrentScope.enable = false;
highlightDefinitions.enable = true;
navigation = {
enable = true;
keymaps = {
gotoDefinition = null;
gotoDefinitionLspFallback = "gnd";
gotoNextUsage = "<a-*>";
gotoPreviousUsage = "<a-#>";
listDefinitions = "gnD";
listDefinitionsToc = "gO";
};
};
smartRename = {
enable = true;
keymaps.smartRename = "grr";
};
};
treesitter-context = {
enable = true;
};
treesitter = {
enable = true;
settings = {
indent.enable = true;
incremental_selection = {
enable = true;
keymaps = {
init_selection = "gnn";
node_incremental = "grn";
scope_incremental = "grc";
node_decremental = "grm";
};
};
highlight = {
enable = true;
};
};
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
bash
c
cpp
css
dockerfile
go
graphql
html
javascript
json
jsonc
lua
python
regex
ruby
rust
svelte
toml
typescript
yaml
];
};
};
};
}