The question is: Do you have control over the Vim invocation done by the external tool?!
Usually, such programs use an environment variable like $EDITOR
to determine the user's preferred editor program. If that is the case (or you can even modify the external tool), you can write a non-interactive editor replacement script that automatically applies whatever changes you want automated. Here's a simple example with sed
:
#/bin/sh
sed -i -e 's/foo/bar/' "$@"
If the Vim invocation is hard-coded, you may have to name this script vim
, and mess with $PATH
to have it picked up by the external tool.