-
Notifications
You must be signed in to change notification settings - Fork 4
/
init.el
52 lines (46 loc) · 1.53 KB
/
init.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
42
43
44
45
46
47
48
49
50
51
52
;;; -*- lexical-binding: t -*-
;; Early load org-mode
(straight-use-package 'org)
(straight-use-package 'diminish)
(require 'org)
(require 'diminish)
;; Define helper command for reloading configuration
(defun meomacs-refresh ()
"Refresh and tangle configuration."
(interactive)
(meomacs-load-config "private" t)
(meomacs-load-config "laf" t)
(meomacs-load-config "editor" t)
(meomacs-load-config "writing" t)
(meomacs-load-config "programming" t)
(meomacs-load-config "addons" t))
;; Define helper command for open configuration file.
(defun meomacs-open-configuration ()
"Open meomacs.org under `user-emacs-directory'."
(interactive)
(let ((config (completing-read "Open configuration: "
'("private"
"laf"
"editor"
"writing"
"programming"
"addons")
nil
t)))
(find-file (expand-file-name (format "%s.org" config) user-emacs-directory))))
;; Define helper macro to parse key binding tables
(defmacro meomacs-keymap-table (keymap table)
`(progn
(unless (boundp (quote ,keymap))
(defvar ,keymap (make-keymap)))
(let ((parse-and-def (lambda (x)
(keymap-set ,keymap (car x) (intern (cadr x))))))
(mapcar parse-and-def ,table))
(defalias (quote ,keymap) ,keymap)))
(global-set-key (kbd "<f9>") 'meomacs-open-configuration)
(global-set-key (kbd "<f12>") 'meomacs-refresh)
;; Load main configuration
(meomacs-load-config "editor")
(meomacs-load-config "writing")
(meomacs-load-config "programming")
(meomacs-load-config "addons" t)