diff --git a/lua/lazyvim/plugins/extras/util/chezmoi.lua b/lua/lazyvim/plugins/extras/util/chezmoi.lua index ff4501db..201288a4 100644 --- a/lua/lazyvim/plugins/extras/util/chezmoi.lua +++ b/lua/lazyvim/plugins/extras/util/chezmoi.lua @@ -5,10 +5,15 @@ local pick_chezmoi = function() local fzf_lua = require("fzf-lua") local actions = { ["enter"] = function(selected) - fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = os.getenv("HOME") }) + fzf_lua.actions.vimcmd_entry("ChezmoiEdit", selected, { cwd = vim.env.HOME }) 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 = vim.env.HOME, + hidden = false, + }) elseif LazyVim.pick.picker.name == "snacks" then local results = require("chezmoi.commands").list({ args = { @@ -50,7 +55,7 @@ return { "alker0/chezmoi.vim", init = function() vim.g["chezmoi#use_tmp_buffer"] = 1 - vim.g["chezmoi#source_dir_path"] = os.getenv("HOME") .. "/.local/share/chezmoi" + vim.g["chezmoi#source_dir_path"] = vim.env.HOME .. "/.local/share/chezmoi" end, }, { @@ -80,7 +85,7 @@ return { init = function() -- run chezmoi edit on file enter vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { - pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" }, + pattern = { vim.env.HOME .. "/.local/share/chezmoi/*" }, callback = function() vim.schedule(require("chezmoi.commands.__edit").watch) end,