mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-06 03:38:16 +00:00
feat(explorer): added ctrl+t to open a terminal in the item's directory
This commit is contained in:
parent
453f1a5d85
commit
81f90062c5
2 changed files with 7 additions and 0 deletions
|
@ -195,6 +195,12 @@ function M.picker_grep(_, item)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.terminal(_, item)
|
||||||
|
if item then
|
||||||
|
Snacks.terminal(nil, { cwd = Snacks.picker.util.dir(item) })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function M.cd(_, item)
|
function M.cd(_, item)
|
||||||
if item then
|
if item then
|
||||||
vim.fn.chdir(Snacks.picker.util.dir(item))
|
vim.fn.chdir(Snacks.picker.util.dir(item))
|
||||||
|
|
|
@ -88,6 +88,7 @@ M.explorer = {
|
||||||
["u"] = "explorer_update",
|
["u"] = "explorer_update",
|
||||||
["<c-c>"] = "tcd",
|
["<c-c>"] = "tcd",
|
||||||
["<c-f>"] = "picker_grep",
|
["<c-f>"] = "picker_grep",
|
||||||
|
["<c-t>"] = "terminal",
|
||||||
["."] = "explorer_focus",
|
["."] = "explorer_focus",
|
||||||
["I"] = "toggle_ignored",
|
["I"] = "toggle_ignored",
|
||||||
["H"] = "toggle_hidden",
|
["H"] = "toggle_hidden",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue