I have the following autocommand in my vimrc for vimwiki:

autocmd BufWritePost *.md silent! VimwikiAll2HTML

The VimwikiAll2HTML triggers a custom script with :! scriptname to process all the files in the wiki.

It works, but there is the annoyance of the "Press ENTER or type command to continue" message that I want to suppress.

I tried this:

autocmd BufWritePost *.md set shortmess=a | set cmdheight=2 | silent! VimwikiAll2HTML | set shortmess=filnxtToOF | set cmdheight = 1

But the last two commands to reset the shortmess and cmdheight properties just get ignored. What's the proper way to suppress the "Press Enter" command? I also tried throwing a <cr> in there but no luck.


OK, this answer worked for me:


For my particular problem, final solution is:

autocmd BufWritePost *.md execute ':silent! VimwikiAll2HTML' | execute ':redraw!'
  • 3
    You don't really need the :s and the second command doesn't need execute (the first one needs it to allow | as a command separator.) This should work: autocmd BufWritePost *.md execute 'silent! VimwikiAll2HTML' | redraw!
    – filbranden
    Aug 11 '20 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.