This repository has been archived by the owner on Apr 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.el
145 lines (109 loc) · 6.65 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
;;; init.el --- Emacs Initialization File
;;
;; Copyright (c) 2017-2019 Wojciech Kozlowski
;;
;; Author: Wojciech Kozlowski <[email protected]>
;; Created: 2017-08-17
;;
;;; License: GPLv3
;;; Commentary:
;;; Code:
;; -------------------------------------------------------------------------------------------------
;; Run init without garbage collection.
;; -------------------------------------------------------------------------------------------------
(let ((gc-cons-threshold most-positive-fixnum))
;; -----------------------------------------------------------------------------------------------
;; Helper function to get correct configuration directory.
;; -----------------------------------------------------------------------------------------------
(defun emacs-dir (rel)
"Obtain full path to REL."
(concat (file-name-as-directory user-emacs-directory) rel))
;; -----------------------------------------------------------------------------------------------
;; Initialise and setup `package'.
;; -----------------------------------------------------------------------------------------------
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
;; External .el files that are not available from MELPA.
(add-to-list 'load-path (emacs-dir "external"))
;; -----------------------------------------------------------------------------------------------
;; Load `emodule'.
;; -----------------------------------------------------------------------------------------------
(add-to-list 'load-path (emacs-dir "emodule"))
(require 'emodule)
;; -----------------------------------------------------------------------------------------------
;; Visual configuration.
;; -----------------------------------------------------------------------------------------------
;; Font ------------------------------------------------------------------------------------------
(let* ((font-name "Source Code Pro")
(font-size 10)
(font-spec (concat font-name "-" (int-to-string font-size))))
(set-frame-font font-spec nil t)
(add-to-list 'default-frame-alist `(font . ,font-spec))
(set-face-attribute 'italic nil ;; Emacs does not set italic face
:family (concat font-name "-Italic")))
;; Visual clutter --------------------------------------------------------------------------------
(scroll-bar-mode -1)
(tool-bar-mode -1)
(menu-bar-mode -1)
(blink-cursor-mode -1)
;; Theme -----------------------------------------------------------------------------------------
;; Add the necessary paths.
(add-to-list 'load-path (emacs-dir "themes"))
(add-to-list 'custom-theme-load-path (emacs-dir "themes"))
;; Load the dark theme by default.
(load-theme 'havoc-dark t) ;; Load personal theme
;; Splash screen ---------------------------------------------------------------------------------
;; Add path.
(add-to-list 'load-path (emacs-dir "init-buffer"))
(require 'init-buffer)
;; Set the initial buffer.
(setq-default init-buffer-choice 'init-buffer/goto-buffer)
;; -----------------------------------------------------------------------------------------------
;; Change file in which custom variable changes are saved.
;; -----------------------------------------------------------------------------------------------
(setq-default custom-file (emacs-dir "custom.el"))
;; -----------------------------------------------------------------------------------------------
;; Load any custom variables straight away to make sure all custom values carry over.
;; -----------------------------------------------------------------------------------------------
(load custom-file 'noerror)
;; ******************************************************************************************** ;;
;; ;;
;; MODULES ;;
;; ;;
;; -------------------------------------------------------------------------------------------- ;;
;; ;;
;; ;;
;; Visual configuration must come before this point so that the frame can be set up before any ;;
;; time consuming package management. ;;
;; ;;
;; ;;
;; ******************************************************************************************** ;;
;; -----------------------------------------------------------------------------------------------
;; Load modules.
;; -----------------------------------------------------------------------------------------------
(emodule/init '(
emacs
helm
languages
modeline
org
programming
terminal
vcs
))
;; ******************************************************************************************** ;;
;; ;;
;; ;;
;; Any configuration that is not in a module or needs to override module settings should be set ;;
;; below this point. ;;
;; ;;
;; ;;
;; -------------------------------------------------------------------------------------------- ;;
;; ;;
;; END MODULES ;;
;; ;;
;; ******************************************************************************************** ;;
) ;; Reset garbage collection settings.
(provide 'init)
;;; init.el ends here