diff options
-rw-r--r-- | init.el | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -855,6 +855,23 @@ | |||
855 | 855 | ||
856 | 856 | ||
857 | ;; --------------------------------- | 857 | ;; --------------------------------- |
858 | ;; Insert date/time at POINT | ||
859 | ;; ------------------------- | ||
860 | ;; [YYYY-MM-DD HH:mm] | ||
861 | ;; --------------------------------- | ||
862 | |||
863 | (defvar mm/date-time-format "[%Y-%m-%d %H:%M]" | ||
864 | "Format of the date to insert with `mm/insert-date-time' function. See help of `format-time-string' for alternative formats.") | ||
865 | |||
866 | (defun mm/insert-date-time () | ||
867 | "Insert the current date time in the format of `mm/date-time-format' at POINT." | ||
868 | (interactive) | ||
869 | (insert (format-time-string mm/date-time-format (current-time)))) | ||
870 | p | ||
871 | (global-set-key (kbd "C-c d") (lambda () (interactive) (mm/insert-date-time))) | ||
872 | |||
873 | |||
874 | ;; --------------------------------- | ||
858 | ;; Improved Help buffer | 875 | ;; Improved Help buffer |
859 | ;; -------------------- | 876 | ;; -------------------- |
860 | ;; Helpful provides a more | 877 | ;; Helpful provides a more |