0

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 but they 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.

0

OK, this answer worked for me:

https://stackoverflow.com/a/2803985/1641112

For my particular problem, final solution is:

autocmd BufWritePost *.md execute ':silent !VimwikiAll2HTML' | execute ':redraw!'

| improve this answer | |
  • 1
    Your ! is shifted from : silent to running the command as a shell... You also don't 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 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.