Closed konosubakonoakua closed 1 month ago
BTW, my pwsh start up fast, because I use no profile
@konosubakonoakua Interesting. I notice no performance drops on my Mac. I don't have access to a Windows machine. Could you help me pinpoint possible issues?
Just to ask, are you sure this plugin is the issue? How did you test this and can you give me some reproducible steps?
Yes, I'm sure we should add '-nop' to cmd list like this:
pwsh -nop -c "zoxide query -ls"
I also tried to add opts config but failed:
-- Configure the extension
opts = {
extensions = {
zoxide = {
cmd = { "-nop", "-c", "zoxide query -ls"},
prompt_title = "🙉 Zoxide",
mappings = {
default = {
after_action = function(selection)
print("Update to (" .. selection.z_score .. ") " .. selection.path)
end,
},
["<C-s>"] = {
before_action = function(selection)
print("before C-s")
end,
action = function(selection)
-- vim.cmd.edit(selection.path)
require("neo-tree.command").execute({ toggle = false, dir = vim.loop.cwd() })
end,
},
-- ["<C-q>"] = { action = z_utils.create_basic_command("split") },
},
},
},
}
the plugin didn't get the cmd I assigned.
or we modify the plugin src code:
local shell_arg = { vim.o.shell }
if vim.o.shell == "cmd.exe" then
shell_arg[2] = "/c"
shell_arg[3] = cmd
elseif vim.o.shell == "pwsh" then
shell_arg[2] = "-nop"
shell_arg[3] = "-c"
shell_arg[4] = cmd
else
shell_arg[2] = "-c"
shell_arg[3] = cmd
end
opts.cmd = vim.F.if_nil(opts.cmd, shell_arg)
Solved by:
vim.keymap.set("n", "<leader>sz",
function()
t.extensions.zoxide.list({ cmd = { "pwsh", "-nop", "-c", "zoxide query -ls" } })
end, { desc = "zoxide" }
)
I'm glad you found a solution! I don't think pwsh
(Powershell) would work on Mac and Linux though 😄
it tooks about seconds to show up, sometimes even failed.