mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/scope: init
This commit is contained in:
parent
204f1aecf2
commit
9b0e2ba7e5
3 changed files with 85 additions and 0 deletions
|
@ -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
50
plugins/utils/scope.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
34
tests/test-sources/plugins/utils/scope.nix
Normal file
34
tests/test-sources/plugins/utils/scope.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue