Last Updated: February 25, 2016
·
603
· orangetux

Show date and time in Vims statusbar

Often I've my 'fullscreened' my Vim windows and I can't see the current time instantly on my panel. The next snippet puts the current date and time in Vims statusbar. Put it in your ~/.vimrc.

set ruler                                                                       
set rulerformat=%55(%{strftime('%F\ %H:%M\ %p')}\ %5l,%-6(%c%V%)\ %P%) 

{strftime('%F\ %H:%M\ %p')} defines the current date and time. <br />
%5l,%-6(%c%V%)\ defines the line and column of the cursor.<br />
%P% defines the relative position of my cursor to the file, E.g, 65% or Bot.

It looks like this:

Picture