Best way to insert timestamp in Vim?

前端 未结 10 1857
轮回少年
轮回少年 2020-11-30 18:25

EditPad Lite has a nice feature (CTRL-E, CTRL-I) which inserts a time stamp e.g. \"2008-09-11 10:34:53\" into your code.

10条回答
  •  醉酒成梦
    2020-11-30 18:57

    http://kenno.wordpress.com/2006/08/03/vim-tip-insert-time-stamp/

    Tried it out, it works on my mac:

    :r! date
    

    produces:

    Thu Sep 11 10:47:30 CEST 2008
    

    This:

    :r! date "+\%Y-\%m-\%d \%H:\%M:\%S"
    

    produces:

    2008-09-11 10:50:56
    

提交回复
热议问题