mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
plugins/telescope/zoxide: init
This commit is contained in:
parent
5908b5a737
commit
380435c555
5 changed files with 112 additions and 0 deletions
|
@ -87,6 +87,7 @@ for telescope_extension_name, has_depr_warnings in {
|
||||||
"project": False,
|
"project": False,
|
||||||
"ui-select": False,
|
"ui-select": False,
|
||||||
"undo": True,
|
"undo": True,
|
||||||
|
"zoxide": False,
|
||||||
}.items():
|
}.items():
|
||||||
KNOWN_PATHS[
|
KNOWN_PATHS[
|
||||||
f"plugins/by-name/telescope/extensions/{telescope_extension_name}.nix"
|
f"plugins/by-name/telescope/extensions/{telescope_extension_name}.nix"
|
||||||
|
|
|
@ -10,5 +10,6 @@
|
||||||
./project.nix
|
./project.nix
|
||||||
./ui-select.nix
|
./ui-select.nix
|
||||||
./undo.nix
|
./undo.nix
|
||||||
|
./zoxide.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
21
plugins/by-name/telescope/extensions/zoxide.nix
Normal file
21
plugins/by-name/telescope/extensions/zoxide.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
let
|
||||||
|
mkExtension = import ./_mk-extension.nix;
|
||||||
|
in
|
||||||
|
mkExtension {
|
||||||
|
name = "zoxide";
|
||||||
|
package = "telescope-zoxide";
|
||||||
|
|
||||||
|
settingsExample = {
|
||||||
|
prompt_title = "Zoxide Folder List";
|
||||||
|
mappings = {
|
||||||
|
"<C-b>" = {
|
||||||
|
keepinsert = true;
|
||||||
|
action.__raw = ''
|
||||||
|
function(selection)
|
||||||
|
file_browser.file_browser({ cwd = selection.path })
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
88
tests/test-sources/plugins/by-name/telescope/zoxide.nix
Normal file
88
tests/test-sources/plugins/by-name/telescope/zoxide.nix
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
plugins = {
|
||||||
|
telescope = {
|
||||||
|
enable = true;
|
||||||
|
extensions.zoxide.enable = true;
|
||||||
|
};
|
||||||
|
web-devicons.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
plugins = {
|
||||||
|
web-devicons.enable = true;
|
||||||
|
telescope = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
extensions.zoxide = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
prompt_title = "[ Zoxide List ]";
|
||||||
|
list_command = "zoxide query -ls";
|
||||||
|
mappings = {
|
||||||
|
default = {
|
||||||
|
action.__raw = ''
|
||||||
|
function(selection)
|
||||||
|
vim.cmd.cd(selection.path)
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
after_action.__raw = ''
|
||||||
|
function(selection)
|
||||||
|
vim.notify("Directory changed to " .. selection.path)
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"<C-s>".action.__raw =
|
||||||
|
"require('telescope._extensions.zoxide.utils').create_basic_command('split')";
|
||||||
|
"<C-v>".action.__raw =
|
||||||
|
"require('telescope._extensions.zoxide.utils').create_basic_command('vsplit')";
|
||||||
|
"<C-e>".action.__raw = "require('telescope._extensions.zoxide.utils').create_basic_command('edit')";
|
||||||
|
"<C-f>" = {
|
||||||
|
keepinsert = true;
|
||||||
|
action.__raw = ''
|
||||||
|
function(selection)
|
||||||
|
builtin.find_files({ cwd = selection.path })
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"<C-t>".action.__raw = ''
|
||||||
|
function(selection)
|
||||||
|
vim.cmd.tcd(selection.path)
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
example = {
|
||||||
|
plugins = {
|
||||||
|
web-devicons.enable = true;
|
||||||
|
telescope = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
extensions.zoxide = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
prompt_title = "Zoxide Folder List";
|
||||||
|
mappings = {
|
||||||
|
"<C-b>" = {
|
||||||
|
keepinsert = true;
|
||||||
|
action.__raw = ''
|
||||||
|
function(selection)
|
||||||
|
file_browser.file_browser({ cwd = selection.path })
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -16,6 +16,7 @@ tro = "tro" # ./plugins/utils/spectre.nix
|
||||||
protols = "protols" # ./plugins/lsp/lsp-packages.nix
|
protols = "protols" # ./plugins/lsp/lsp-packages.nix
|
||||||
compatibilty = "compatibilty" # ./plugins/by-name/visual-multi/default.nix
|
compatibilty = "compatibilty" # ./plugins/by-name/visual-multi/default.nix
|
||||||
Maco = "Maco" # ./plugins/by-name/femaco
|
Maco = "Maco" # ./plugins/by-name/femaco
|
||||||
|
Typ = "Typ" # ./flake/dev/list-plugins/list-plugins.py
|
||||||
|
|
||||||
[type.patch]
|
[type.patch]
|
||||||
extend-glob = ["*.patch"]
|
extend-glob = ["*.patch"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue