and
\n{ on = [ \"g\", \"l\" ], run = \"cd $(readlink '@0')\", desc = \"Go to the symlink original directory\" },
But nothing works.
\nAm I doing something wrong? Thanks!
\nUPDATE:
\nI have changed the approach and tried creating a plugin. Here is the init.lua
:
return {\n entry = function()\n local h = cx.active.current.hovered\n local original_url = h.link_to\n if h and original_url then\n ya.manager_emit(\"reveal\", { path = original_url })\n end\n end,\n}
This cds into the symlink's parent directory, not the original path. Why is the original path not being passed into the path
argument?
Change the plugin to this, then it works:
\nreturn {\n entry = function()\n local h = cx.active.current.hovered\n local original_url = h.link_to\n if h and original_url then\n ya.manager_emit(\"cd\", { original_url })\n end\n end,\n}
-
I would like to have a keybinding to follow a symlink on a hovered file/directory. I have already tried: { on = [ "g", "l" ], run = '''shell "cd $(readlink '@0')" --confirm''', desc = "Go to the symlink original directory" }, and { on = [ "g", "l" ], run = "cd $(readlink '@0')", desc = "Go to the symlink original directory" }, But nothing works. Am I doing something wrong? Thanks! UPDATE: return {
entry = function()
local h = cx.active.current.hovered
local original_url = h.link_to
if h and original_url then
ya.manager_emit("reveal", { path = original_url })
end
end,
} This cds into the symlink's parent directory, not the original path. Why is the original path not being passed into the |
Beta Was this translation helpful? Give feedback.
-
Change the plugin to this, then it works: return {
entry = function()
local h = cx.active.current.hovered
local original_url = h.link_to
if h and original_url then
ya.manager_emit("cd", { original_url })
end
end,
} |
Beta Was this translation helpful? Give feedback.
Change the plugin to this, then it works: