Из:h :!
:
A '|' in {cmd} is passed to the shell, you cannot use it to append a Vim command. See :bar.
Но вы могли бы сделать что-то вроде:
command Asc execute ":w | ! cd %:p:h; ansible-playbook --syntax-check %"
Что устраняет необходимость cd
возврата, поскольку только исполняемая оболочка меняет каталоги.
Используйтеtimeout
:
exec 3<>/dev/tcp/localhost/port
echo -e "textcommand\r" >&3
timeout 0.2 cat <&3
exec 3<&-; exec 3>&-