Skip to content

Commit 380435c

Browse files
committed
plugins/telescope/zoxide: init
1 parent 5908b5a commit 380435c

File tree

5 files changed

+112
-0
lines changed

5 files changed

+112
-0
lines changed

flake/dev/list-plugins/list-plugins.py

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class State(Enum):
8787
"project": False,
8888
"ui-select": False,
8989
"undo": True,
90+
"zoxide": False,
9091
}.items():
9192
KNOWN_PATHS[
9293
f"plugins/by-name/telescope/extensions/{telescope_extension_name}.nix"

plugins/by-name/telescope/extensions/default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
./project.nix
1111
./ui-select.nix
1212
./undo.nix
13+
./zoxide.nix
1314
];
1415
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
let
2+
mkExtension = import ./_mk-extension.nix;
3+
in
4+
mkExtension {
5+
name = "zoxide";
6+
package = "telescope-zoxide";
7+
8+
settingsExample = {
9+
prompt_title = "Zoxide Folder List";
10+
mappings = {
11+
"<C-b>" = {
12+
keepinsert = true;
13+
action.__raw = ''
14+
function(selection)
15+
file_browser.file_browser({ cwd = selection.path })
16+
end
17+
'';
18+
};
19+
};
20+
};
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
empty = {
3+
plugins = {
4+
telescope = {
5+
enable = true;
6+
extensions.zoxide.enable = true;
7+
};
8+
web-devicons.enable = true;
9+
};
10+
};
11+
12+
defaults = {
13+
plugins = {
14+
web-devicons.enable = true;
15+
telescope = {
16+
enable = true;
17+
18+
extensions.zoxide = {
19+
enable = true;
20+
21+
settings = {
22+
prompt_title = "[ Zoxide List ]";
23+
list_command = "zoxide query -ls";
24+
mappings = {
25+
default = {
26+
action.__raw = ''
27+
function(selection)
28+
vim.cmd.cd(selection.path)
29+
end
30+
'';
31+
after_action.__raw = ''
32+
function(selection)
33+
vim.notify("Directory changed to " .. selection.path)
34+
end
35+
'';
36+
};
37+
"<C-s>".action.__raw =
38+
"require('telescope._extensions.zoxide.utils').create_basic_command('split')";
39+
"<C-v>".action.__raw =
40+
"require('telescope._extensions.zoxide.utils').create_basic_command('vsplit')";
41+
"<C-e>".action.__raw = "require('telescope._extensions.zoxide.utils').create_basic_command('edit')";
42+
"<C-f>" = {
43+
keepinsert = true;
44+
action.__raw = ''
45+
function(selection)
46+
builtin.find_files({ cwd = selection.path })
47+
end
48+
'';
49+
};
50+
"<C-t>".action.__raw = ''
51+
function(selection)
52+
vim.cmd.tcd(selection.path)
53+
end
54+
'';
55+
};
56+
};
57+
};
58+
};
59+
};
60+
};
61+
62+
example = {
63+
plugins = {
64+
web-devicons.enable = true;
65+
telescope = {
66+
enable = true;
67+
68+
extensions.zoxide = {
69+
enable = true;
70+
71+
settings = {
72+
prompt_title = "Zoxide Folder List";
73+
mappings = {
74+
"<C-b>" = {
75+
keepinsert = true;
76+
action.__raw = ''
77+
function(selection)
78+
file_browser.file_browser({ cwd = selection.path })
79+
end
80+
'';
81+
};
82+
};
83+
};
84+
};
85+
};
86+
};
87+
};
88+
}

typos.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ tro = "tro" # ./plugins/utils/spectre.nix
1616
protols = "protols" # ./plugins/lsp/lsp-packages.nix
1717
compatibilty = "compatibilty" # ./plugins/by-name/visual-multi/default.nix
1818
Maco = "Maco" # ./plugins/by-name/femaco
19+
Typ = "Typ" # ./flake/dev/list-plugins/list-plugins.py
1920

2021
[type.patch]
2122
extend-glob = ["*.patch"]

0 commit comments

Comments
 (0)