I have a vim script function MyFunction
that returns a string value. I want to display this output in the statusline and so I have set the statusline as follows statusline +=\ %{MyFunction()}
.
I want this function to be called periodically (say every second) and display the updated value in the statusline.
Right now, If I'm in the window and move the cursor around, the statusline is updated but when the cursor is not moving or if the window is inactive, it just stays at one value.
How can I update it periodically?