In this article, the program is modified by other user code and is not original. It is summarized as follows and used as a personal note.
(1) Open the project base, open the file utils. Em, and insert the following code:
// Insert time macro monthtoname (monthnum) {If (monthnum = 1) Return "01" If (monthnum = 2) Return "02" If (monthnum = 3) return "03" If (monthnum = 4) Return "04" If (monthnum = 5) Return "05" If (monthnum = 6) return "06" If (monthnum = 7) Return "07" If (monthnum = 8) Return "08" If (monthnum = 9) return "09" If (monthnum = 10) Return "10" If (monthnum = 11) Return "11" If (monthnum = 12) return "12"} macro displaydate () {sztime = getpolicime (1) Day = sztime. day month = sztime. month year = sztime. year hour = sztime. hour minute = sztime. minute second = sztime. second if (day <10) szday = "[email protected] @" else szday = day szmonth = monthtoname (month) hbuf = getcurrentbuf () setbufseltext (hbuf, "/* @ [email protected]/@ [email protected]/@ [email protected] @ [email protected]: @ [email protected]: @ [email protected] */")}
(2) assign a shortcut:
Options-> menu assignments open the menu assignments window, enter macro in command, select the macro to be used (displaydate), and add it to the appropriate menu. you can also customize the shortcut key. I have defined CTRL + ALT + F11.
(Option --> key allocation)
You can achieve the following results:
/* 2014/09/28--11:41:15 */
Add time to code quickly in source insight