External Tools parameters fail to use shell command.

Answered

program:  /usr/local/bin/nvim

parameter : `find . -name $SelectedText$`

the parameter is uncertain by the macro, so i need to find absolute  file path with selected text, and then open the file with vim.

but the fact is vim can not recognize whole parameter, it deal the param as literal "find . -name" and report parameter error.

May I use shell command as parameter?

0
2 comments

No, it's not supported.

You can create a custom shell script that will take the string literal parameter and evaluate it via the shell, then pass the result of the evaluation to nvim. In the external tool call your custom script.

1
Avatar
Permanently deleted user

ok, it needs an additional script somewhere , but it works, thank you!

0

Please sign in to leave a comment.