I know about r!
command to append text from bash output to vim under cursor. So for example issuing this command in vim:
:r! printf "abcd\n"
would append "abcd" into the vim buffer. But I am somehow unable to do similar with subshell involved. In file a.sh
, I issue:
:r! printf "This file was created on %s" $(date +%m/%d/%y)
And the result is
This file was created on a.shs
some nonsense created from the filename. Why? (on normal terminal, there is no such problem, so I am assuming vim cannot handle subshells?)