Say I write an autocommand for a particular file to do something when I save it, such as
autocmd BufWritePost .Xresources silent! execute 'xrdb ~/.Xresources'
I'm doing it with
silent! execute, because if I only use
autocmd BufWritePost .Xresources !xrdb ~/.Xresources
vim would prompt for an enter. But I still want to see that the reload happened, which I thought could be handled with
echo, such as
autocmd BufWritePost .Xresources silent! execute 'xrdb ~/.Xresources' | echo 'Xresources reloaded'
But again this has the problem of prompting to
Press ENTER or type command to continue. Now there is
echon which does not do prompt for ENTER, but it also does not display the message, as saving the file with
"~/.Xresources" 487L, 18435C written to be written to the status line instead.
So the quation is, is there some way to run the autocommand such that it saves the file, runs the shell command, and echoes a confirmation message in the status line, without prompting the user to press ENTER, or interrupt in any other way?