mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
fix(fzf-lua): set cwd for previewing chezmoi files outside home directory
Used the solution posted by @zjrgov in this gist: https://github.com/LazyVim/LazyVim/pull/6095#issuecomment-3258889700
This commit is contained in:
parent
5098a69870
commit
11725a4590
1 changed files with 3 additions and 2 deletions
|
|
@ -3,12 +3,13 @@ local pick_chezmoi = function()
|
|||
require("telescope").extensions.chezmoi.find_files()
|
||||
elseif LazyVim.pick.picker.name == "fzf" then
|
||||
local fzf_lua = require("fzf-lua")
|
||||
local dest_dir = os.getenv("HOME")
|
||||
local actions = {
|
||||
["enter"] = function(selected)
|
||||
fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = os.getenv("HOME") })
|
||||
fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = dest_dir })
|
||||
end,
|
||||
}
|
||||
fzf_lua.files({ cmd = "chezmoi managed --include=files,symlinks", actions = actions, hidden = false })
|
||||
fzf_lua.files({ cmd = "chezmoi managed --include=files,symlinks", actions = actions, cwd = dest_dir, hidden = false })
|
||||
elseif LazyVim.pick.picker.name == "snacks" then
|
||||
local results = require("chezmoi.commands").list({
|
||||
args = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue