-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperso-org.el
41 lines (33 loc) · 1000 Bytes
/
perso-org.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
;;; package --- Org Mode
;;; Commentary:
;;; Code:
;;; to expand literal prog (eg. `<s') shortcuts
(require 'org-tempo)
(require 'package)
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
(org-babel-do-load-languages
'org-babel-load-languages
'((shell . t)
(emacs-lisp . t)))
(add-hook 'org-mode-hook
(lambda ()
(set-fill-column 60)
(auto-fill-mode 1)))
(defun perso/org/insert-time ()
"Add the time."
(interactive)
(let* ((seconds (floor (time-to-seconds (current-time))))
(time-string (format-time-string "%H:%M" (seconds-to-time seconds))))
(insert time-string)
(org-indent-line)
(insert "\n-----")
(org-indent-line)
(insert "\n")
(org-indent-line)))
;;;;;;;;;;;;;;;;;
;; keybindings ;;
;;;;;;;;;;;;;;;;;
(define-key org-mode-map "\C-c\M-." 'perso/org/insert-time)
(define-key org-mode-map (kbd "C-! <return>") 'org-time-stamp-inactive)
(provide 'perso-org)
;;; perso-org.el ends here