feat(explorer): added ctrl+t to open a terminal in the item's directory

This commit is contained in:
Folke Lemaitre 2025-02-07 09:10:09 +01:00
parent 453f1a5d85
commit 81f90062c5
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 7 additions and 0 deletions

View file

@ -195,6 +195,12 @@ function M.picker_grep(_, item)
end
end
function M.terminal(_, item)
if item then
Snacks.terminal(nil, { cwd = Snacks.picker.util.dir(item) })
end
end
function M.cd(_, item)
if item then
vim.fn.chdir(Snacks.picker.util.dir(item))

View file

@ -88,6 +88,7 @@ M.explorer = {
["u"] = "explorer_update",
["<c-c>"] = "tcd",
["<c-f>"] = "picker_grep",
["<c-t>"] = "terminal",
["."] = "explorer_focus",
["I"] = "toggle_ignored",
["H"] = "toggle_hidden",