lua help - add pushd command #480
-
Hi. I don't know lua and I always have trouble with it when I need to do something in a nvim plugin (I am totally fine with vimscript). I am using this For
I think there needs to be a I thought that adding this line before those command would work, but it breaks the whole thing:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Oh, it looks like you're trying to use Lua as though it's a shell scripting language. It is not. And And So you probably just need to change the |
Beta Was this translation helpful? Give feedback.
-
Ah, I see. When compounding cmd command with
|
Beta Was this translation helpful? Give feedback.
-
Oh, I just needed to add another space after the |
Beta Was this translation helpful? Give feedback.
Oh, it looks like you're trying to use Lua as though it's a shell scripting language. It is not.
pushd
is a shell command, not a Lua function.And
__zoxide_query
and__zoxide_cd
are functions defined in the Lua script, and they return a string. The string is returned to Clink, and Clink returns it to CMD, which executes the string as though the user typed it into the command prompt.And
__zoxide_query
calls__zoxide_cd
.So you probably just need to change the
__zoxide_cd
function to return whatever command line you want to be executed. It sounds like you want to put two commands in the command line, something like" pushd %cd% & " ..
preceding whatever normally gets returned.