-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathinit.el
116 lines (94 loc) · 3.08 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
;;-*- lexical-binding: t -*-
;;; Init
(push (expand-file-name "site-lisp" user-emacs-directory) load-path)
(require 'lunary)
(require 'cowboy)
(require 'package)
;;; Custom file
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(luna-safe-load custom-file)
;;; Dump
(luna-if-dump
(progn
(setq load-path luna-dumped-load-path)
(global-font-lock-mode)
(transient-mark-mode)
;; Re-run mode hooks.
(add-hook 'after-init-hook
(lambda ()
(switch-to-buffer "*scratch*")
(lisp-interaction-mode))))
;; Add load-paths and load autoload files.
(luna-load-relative "star/recipe.el")
(package-initialize)
(cowboy-add-load-path))
;;; Benchmark
;; (require 'benchmark-init)
;; (add-hook 'after-init-hook 'benchmark-init/deactivate)
;; (benchmark-init/activate)
;;; Configs
(luna-key-def-preset :leader
:keymaps 'override
:prefix (if (display-graphic-p) "C-SPC" "C-@"))
(luna-key-def-preset :leader-prefix
:prefix (if (display-graphic-p) "C-SPC" "C-@"))
(luna-load-relative "star/etc.el")
(luna-load-relative "star/key.el")
(luna-load-relative "star/angel.el")
(luna-load-relative "star/ui.el")
(luna-load-relative "star/mode-line.el")
(luna-load-relative "star/edit.el")
(luna-load-relative "star/completion.el")
(luna-load-relative "star/checker.el")
(luna-load-relative "star/python.el")
(luna-load-relative "star/git.el")
(luna-load-relative "star/dir.el")
(luna-load-relative "star/org-mode.el")
(luna-load-relative "star/writing.el")
(luna-load-relative "star/tex.el")
(luna-load-relative "star/simple-mode.el")
(luna-load-relative "star/blog.el")
(luna-load-relative "star/app.el")
(require 'utility)
(setq initial-buffer-choice #'luna-splash-screen)
;;; Customize
;;;; Server
(luna-run-server)
;;;; Theme
(when (window-system)
(luna-load-theme 'pale))
(luna-on "Brown"
(luna-safe-load (expand-file-name "brown-init.el" user-emacs-directory)))
;;; Mac
(luna-when-mac
(setq mac-option-modifier 'meta
mac-command-modifier 'super
mac-pass-command-to-system nil ; fix cmd h
mac-system-move-file-to-trash-use-finder t)
(global-set-key (kbd "s-c") #'kill-ring-save)
(global-set-key (kbd "s-v") #'yank)
;; I sometimes hit this by accident.
(global-set-key (kbd "s-H") #'ignore)
(setq scroll-up-aggressively 0.01
scroll-down-aggressively 0.01
redisplay-skip-fontification-on-input t)
(setq mouse-wheel-flip-direction t))
;;; Linux
(luna-on "blanche"
(setq source-directory (expand-file-name "~/emacs"))
(setq x-super-keysym 'ctrl)
(setq x-ctrl-keysym 'super))
;;; Local init
(let ((local-init (expand-file-name
"local-init.el" user-emacs-directory)))
(when (file-exists-p local-init)
(luna-safe-load local-init)))
;;; Emacs devel
(defun run-treesit-tests (build)
"Run tree-sitter tests for BUILD."
(interactive (list (completing-read "Build: " '("emacs" "emacs-head") nil t)))
(let ((test-file
(expand-file-name "test/src/treesit-tests.el"
(expand-file-name build "~"))))
(load test-file)
(ert "t")))