I am trying to write a command that passes selected text to a shell script.
The command works fine when there is no \n
character in the selected text (using Visual mode).
:vmap <Leader>tts 0y:silent exec ":!/home/user/tts.sh ".@0 <Enter>
The problems occurs when I try to select multiple lines. I tried to surround the shell script arguments with escaped quotes
:vmap <Leader>tts 0y:silent exec ":!/home/user/tts.sh \"".@0."\"" <Enter>
But this solution doesn't work either.
How can I do this?
I am using neovim v0.4.4
Any hint ?.