简体   繁体   中英

How do you create a date snippet in gedit?

Specifically, I would like to use a keyboard shortcut instead of the 'Insert Date and time...' plugin. This snippet will be used for log files that are used frequently. The snippet will allow for formatting such as line feeds and dashed-line separators.

As the link in Anna's answer is now obsolete, here is a snippet using a shell command (on Unix):

$(1:date +%Y-%m-%d)

Use

date --help

to know more about available formatting options.

I guess you could also do the same with some Python snippet (using $<>). More there .

I think that the article GEdit Snippet to insert date and time covers basically what you need.

Update (the old link stopped working):

You can use a keyboard shortcut for the plugin . Alt + e → s → Enter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM