I am trying to write an abbreviation that will do the following:
if there is <<
in the whole buffer somewhere, it will enclose it with bash -c "<the-buffer>"
So, If I run
tee $HOME/Desktop/test << ENDI am testing!END
it will run the following instead.
bash -c "tee $HOME/Desktop/test << ENDI am testing!END"
The code I came up with is:
function run_in_bash # Run the command in bash bash -c "(commandline --current-buffer)"endabbr --add run_in_bash_abbr --regex '.*<<.*' --function run_in_bash
But now when I am running:
tee $HOME/Desktop/test << ENDI am testing!END
It says fish: Expected a string, but found a redirection
. What can i do here?