feat: add treesitter keybindings

This commit is contained in:
n3oney 2023-05-03 00:15:05 +02:00
commit 320cb8007c
No known key found for this signature in database
GPG key ID: C786693DE727850E
2 changed files with 30 additions and 17 deletions

View file

@ -1,14 +1,5 @@
{
pkgs,
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.treesitter;
usingNvimCmp = config.vim.autocomplete.enable && config.vim.autocomplete.type == "nvim-cmp";
in {
{lib, ...}:
with lib; {
options.vim.treesitter = {
enable = mkEnableOption "treesitter, also enabled automatically through language options";
@ -16,13 +7,21 @@ in {
autotagHtml = mkEnableOption "autoclose and rename html tag";
mappings = {
incrementalSelection = {
init = mkMappingOption "Init selection [treesitter]" "gnn";
incrementByNode = mkMappingOption "Increment selection by node [treesitter]" "grn";
incrementByScope = mkMappingOption "Increment selection by scope [treesitter]" "grc";
decrementByNode = mkMappingOption "Decrement selection by node [treesitter]" "grm";
};
};
grammars = mkOption {
type = with types; listOf package;
default = [];
description = nvim.nmd.asciiDoc ''
List of treesitter grammars to install. For supported languages
use the `vim.language.<lang>.treesitter` option
'';
};
};