Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5977057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:18:58+00:00 2026-05-22T21:18:58+00:00

Is it possible to have the statusline in Vim be updated so and so

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:18:58+00:00Added an answer on May 22, 2026 at 9:18 pm

    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:

    1. Esc out to normal mode and call your shortcut
    2. See the outcome on the statusline and go back to insert mode to continue working

    then you could use the InsertEnter event 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:

    enter image description here

    "statusline
    hi green term=bold cterm=bold ctermfg=107
    hi red term=bold cterm=bold ctermfg=167
    hi gray term=bold cterm=bold ctermfg=0
    hi lblue term=bold cterm=bold ctermfg=12
    
    function! Palpatine()
        let str='At last, the Jedi are no more' 
        return str
    endfunction
    
    function! Force()
        let str=',~`,~`,~`,~`,~`,~`,~`,~'
        return str
    endfunction
    
    function! DefaultStatus()
        let statusStr='%#red#Palpatine: %#gray#%{Palpatine()} %#lblue#%{Force()} %=%#green#Yoda'
        return statusStr
    endfunction
    
    set laststatus=2
    set statusline=%!DefaultStatus()
    

    Statuschange on function call:

    enter image description here

    function! Yoda()
        let str='Not if anything to say about it, I have'
        return str
    endfunction
    
    function! MyStatus()
        let statusStr='%#red#Palpatine %=%#lblue#%{Force()} %#gray#%{Yoda()} %#green#:Yoda'
        return statusStr
    endfunction
    
    function! MyFunc()
        set statusline=%!MyStatus()
    endfunction
    
    noremap <C-m> :call MyFunc()<CR>
    

    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.

    autocmd InsertEnter * set statusline=%!DefaultStatus()
    

    Back to insert:

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is possible have one MSMQ queue in one machine and read masseges from
Is it possible to have more than one data type within an array list,
Is possible have INSTEAD INSERT and AFTER INSERT inside the same trigger? CREATE TRIGGER
Hi is it possible to have more than one group as admin_group? being able
Is it possible have more than one profile template? I'm working on an internal
I have heard that it is possible to have a local Git repository on
It is theoretically possible to have a converter, that scans the color areas of
Is it possible have two projects with the same name in flex builder? Here
is possible to have a separator between elements of a GridView? Thanks
Is it possible to have a MySQLi prepared statement within the fetch() call of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.