Is it possible to have the statusline in Vim be updated so and so long after a given event?
And if so, how does one do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As others have already pointed out, using timed changes to the statusline is not possible at the moment. However, if you can pick a suitable event at which the status reverts to the default, then you might be in luck. For e.g., if your workflow is:
Escout to normal mode and call your shortcutthen you could use the
InsertEnterevent in an autocommand to change the status to the default once you hit i in normal mode.Here’s a small fun example that you can probably modify to your needs.
The normal status line:
Statuschange on function call:
With the above definitions, every time I press Ctrlm, the statusline changes to the above.
Now by setting an autocommand, we can revert it to the default whenever you enter insert mode.
Back to insert: