diff options
author | Mountain Man <43313373+MountainMan1312@users.noreply.github.com> | 2023-05-20 13:27:08 -0400 |
---|---|---|
committer | Mountain Man <43313373+MountainMan1312@users.noreply.github.com> | 2023-05-20 13:27:08 -0400 |
commit | 165272e79b8c6e884d9a37cf6a071f478142a02b (patch) | |
tree | e02aa924a06c814d09c7569dca635d85e7004bc3 /init.el | |
parent | Switch `S-<home>` keybind to `C-<home>` to fix shift-select behavior (diff) | |
download | mmosmacs-165272e79b8c6e884d9a37cf6a071f478142a02b.tar.gz mmosmacs-165272e79b8c6e884d9a37cf6a071f478142a02b.tar.bz2 mmosmacs-165272e79b8c6e884d9a37cf6a071f478142a02b.zip |
Add keybind to insert date/time at POINT
Diffstat (limited to 'init.el')
-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 |