hero2008
hero2008

Reputation: 611

How to write vimrc to show time and git info on vim's ruler bar

In vim 7.3, I'd like to show the current time and git info on the ruler bar.

How can I do this?

From vim's guide, it seems I should modify the rulerformat option, but how?

Upvotes: 3

Views: 1272

Answers (1)

number5
number5

Reputation: 16453

  1. for git info, better way to do it is using fugitive.vim, after you installed the fugitive vim plugin, you can set your statusline in your .vimrc

    set statusline =... %{fugitive#statusline()} ...

  2. to display time in your statusline, you need strftime function, eg.

    set statusline+=%{strftime("%I:%M")}

You can look here for more statusline ideas

Upvotes: 7

Related Questions