1

This is the following code I am using

set statusline=\PATH:\ %r%F\ \ \ \ \LINE:\ %l/%L/%P  

In the same statusline how I can show the time information ? Thanks for suggestion.

J4cK
  • 30,459
  • 8
  • 42
  • 54

1 Answers1

6

Vim allows you to evaluate vim commands inside of the status line, so something like this should do the trick:

set statusline=\PATH:\ %r%F\ \ \ \ \LINE:\ %l/%L/%P\ TIME:\ %{strftime('%c')}

%{} executes any vim statements contained within the {} brackets. If you want a different time format, read the below help topic on the strftime function:

:help strftime()

Also, if you need more help on the special printf style % characters, read this:

:help 'statusline'
EvergreenTree
  • 1,788
  • 2
  • 16
  • 30
  • 2
    Is there any way to make it so vim automatically updates the clock? For it to update I have to move my cursor/interact in some way, otherwise it remains the same. – Sam Fuller Apr 14 '19 at 17:07