org-mode 输入时间设置

在org-mode中,如何设置才能C-c . Enter 之后插入的直接是当前日期和时间啊?把时间也显示出来。 还有C-c C-s Enter 的时候,能不能直接把当前日期、时间插入到文档中啊?

C-h k (describe-key) 来查看 C-c . (org-time-stamp) 的用法:

C-c . runs the command org-time-stamp (found in org-mode-map), which is an interactive Lisp closure in `org.el’.

It is bound to C-c ., .

(org-time-stamp ARG &optional INACTIVE)

Prompt for a date/time and insert a time stamp.

If the user specifies a time like HH:MM or if this command is called with at least one prefix argument, the time stamp contains the date and the time. Otherwise, only the date is included.

All parts of a date not specified by the user are filled in from the timestamp at point, if any, or the current date/time otherwise.

If there is already a timestamp at the cursor, it is replaced.

With two universal prefix arguments, insert an active timestamp with the current time without prompting the user.

When called from lisp, the timestamp is inactive if INACTIVE is non-nil.





这说得很明白了吧?要满足你的需求,加俩 universal prefix arguments 就行, 就是 C-u


  • C-u C-c . 当前时间
  • C-c . 00:00 指定时间为 00:00
  • C-c . +1d 当前日期加 1
6 个赞

例如: create : time 输入之后: create: 2019-08-02 类似的.


他的意思是 类似于create 冒号 time update 冒号 time

自动将time转成当前时间 crete冒号llll就不用管了


对, 那么正则替换方式,可以在snippets片段中实现吗?
具体实现方式:在反引号( ` )执行emacs脚本

获取文件路径:`file-attributes (buffer-file-name)`
1. `(current-time-string)`
2. `(format-time-string "<%Y-%m-%d %H:%M>" (current-time))`

Writing snippets

1 个赞


但是你得看看文档 yasnippet可以执行代码 你可以做很多的事情