dotfiles/modules/programs/nvim/new_plugins/treesitter-textobjects.nix

91 lines
2.1 KiB
Nix

{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
home-manager.users.moritz.programs.nixvim = {
plugins.treesitter-textobjects = {
enable = true;
move = {
enable = true;
gotoNext = {
"]f" = {
desc = "Next function";
query = "@function.outer";
};
"]c" = {
desc = "Next class";
query = "@class.outer";
};
"]b" = {
desc = "Next block";
query = "@block.outer";
};
"]P" = {
desc = "Next parameter";
query = "@parameter.outer";
};
};
gotoPrevious = {
"[f" = {
desc = "Previous function";
query = "@function.outer";
};
"[c" = {
desc = "Previous class";
query = "@class.outer";
};
"[b" = {
desc = "Previous block";
query = "@block.outer";
};
"[P" = {
desc = "Previous parameter";
query = "@parameter.outer";
};
};
};
select = {
enable = true;
keymaps = {
"af" = {
desc = "function";
query = "@function.outer";
};
"if" = {
desc = "inner function";
query = "@function.inner";
};
"ac" = {
desc = "class";
query = "@class.outer";
};
"ic" = {
desc = "inner class";
query = "@class.inner";
};
"ab" = {
desc = "block";
query = "@block.outer";
};
"ib" = {
desc = "inner block";
query = "@block.inner";
};
"aP" = {
desc = "parameter";
query = "@parameter.outer";
};
"iP" = {
desc = "inner parameter";
query = "@parameter.inner";
};
};
};
};
performance.combinePlugins.standalonePlugins = [
"nvim-treesitter-textobjects"
];
};
}