Add time to code quickly in source insight

Source: Internet
Author: User
Tags add time

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.