1

I want to know how to display the server time inside the Vim editor, if possible.

  • 2
    What is “sever time”? – Gilles May 13 '11 at 21:46
1

You can execute external commands in Vim by using the '!' flag:

:! date

http://www.linux.com/learn/tutorials/442419-vim-tips-working-with-external-commands

  • As an added bonus, adding a r after the : will write the output into your buffer. Like so, :r! date. – jonyamo Oct 4 '11 at 18:30
5

If you like, you can set Vim up so it displays the time on the status bar by adding the following lines to your vimrc file:

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

Credit goes to this Vim Wiki page.

  • thanks a lot, but i like simple as kce's answer ^^ – meotimdihia May 15 '11 at 4:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.