plugins/scope: init

This commit is contained in:
Andrew Plaza 2024-08-31 11:25:17 -04:00
parent 204f1aecf2
commit 9b0e2ba7e5
No known key found for this signature in database
GPG key ID: 5AC436990F6A3071
3 changed files with 85 additions and 0 deletions

View file

@ -220,6 +220,7 @@
./utils/refactoring.nix
./utils/rest.nix
./utils/sandwich.nix
./utils/scope.nix
./utils/sleuth.nix
./utils/smart-splits.nix
./utils/spectre.nix

50
plugins/utils/scope.nix Normal file
View file

@ -0,0 +1,50 @@
{
lib,
config,
pkgs,
...
}:
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "scope";
originalName = "scope.nvim";
defaultPackage = pkgs.vimPlugins.scope-nvim;
maintainers = [ lib.maintainers.insipx ];
settingsOptions = {
hooks = {
pre_tab_enter = lib.nixvim.defaultNullOpts.mkLuaFn null ''
Run custom logic before entering a tab.
'';
post_tab_enter = lib.nixvim.defaultNullOpts.mkLuaFn null ''
Run custom logic after entering a tab.
'';
pre_tab_leave = lib.nixvim.defaultNullOpts.mkLuaFn null ''
Run custom logic before leaving a tab.
'';
post_tab_leave = lib.nixvim.defaultNullOpts.mkLuaFn null ''
Run custom logic after leaving a tab.
'';
pre_tab_close = lib.nixvim.defaultNullOpts.mkLuaFn null ''
Run custom logic before closing a tab.
'';
post_tab_close = lib.nixvim.defaultNullOpts.mkLuaFn null ''
Run custom logic after closing a tab.
'';
};
};
settingsExample = {
settings = {
pre_tab_enter.__raw = ''
function()
print("about to enter tab!")
end
'';
};
};
}

View file

@ -0,0 +1,34 @@
{
empty = {
plugins.scope.enable = true;
};
defaults = {
plugins.scope = {
enable = true;
settings.hooks = {
pre_tab_enter = null;
post_tab_enter = null;
pre_tab_leave = null;
post_tab_leave = null;
pre_tab_close = null;
post_tab_close = null;
};
};
};
example = {
plugins.scope = {
enable = true;
settings = {
hooks = {
pre_tab_enter.__raw = ''
function()
print("Example hook, about to enter tab")
end
'';
};
};
};
};
}