Best way to insert timestamp in Vim?

前端 未结 10 1862
轮回少年
轮回少年 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:35

    For a unix timestamp:

    :r! date +\%s
    

    You can also map this command to a key (for example F12) in VIM if you use it a lot:

    Put this in your .vimrc:

    
    map   :r! date +\%s
    

提交回复
热议问题