Monday, April 23, 2012

VI / VIM: Insert Current Date / Time

How do I display and insert current date and/or time under vi or VIM text editor?

You can use external command as follows to insert the current date and time:
:r !date
OR just type !!date (press ESC key followed by !! and than type date)
!!date
Sample outputs:
Fig.01: Insert date and time into Vim
Fig.01: Insert date and time into Vim

No comments:

Post a Comment