Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question
2  
What is “sever time”? –  Gilles May 13 '11 at 21:46
add comment

2 Answers

up vote 1 down vote accepted

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

share|improve this answer
    
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
add comment

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.

share|improve this answer
    
thanks a lot, but i like simple as kce's answer ^^ –  meotimdihia May 15 '11 at 4:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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