The default message displayed on the prompt when one saves a file is

"<file_name>" <nlines>L, <ncharacters>C written

and it remains in the prompt until another message is to be displayed.

I'd like to change this by using a custom message which should remain on the prompt for 1-2 seconds and then go away.

How can I do this?

1 Answer 1


I believe one could do this with something like

augroup MyWriteMsg
  au BufWritePost echom 'my message'

Though you would want to use a timer to clear it. I’m not sure I see the value in doing that though, as it’s only more complexity for what (as far as I can see) is no benefit.

  • No you're right, there's no concrete benefit, I just like it better. Could you post the complete answer including a timer to clear the prompt?
    – noibe
    Commented Jan 13, 2020 at 1:06
  • @noibe from my phone, without vim docs, probably not. But you can read :help timer as a start
    – D. Ben Knoble
    Commented Jan 13, 2020 at 1:07
  • I guess it is smth like: ``` func! ClearMessage(timer_id) abort echo '' endfunc func! CustomSaveMessage() abort echo 'my message' call timer_start(1000, 'ClearMessage') endfunc augroup MyWriteMsg au! au BufWritePost * call CustomSaveMessage() augroup END ``` But it wouldn't work as expected
    – Maxim Kim
    Commented Jan 13, 2020 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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