-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
init.el
200 lines (166 loc) · 5.82 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
;;; init.el --- user-init-file -*- lexical-binding: t -*-
;;; Early birds
(progn ; startup
(defvar before-user-init-time (current-time)
"Value of `current-time' when Emacs begins loading `user-init-file'.")
(message "Loading Emacs...done (%.3fs)"
(float-time (time-subtract before-user-init-time
before-init-time)))
(setq user-init-file (or load-file-name buffer-file-name))
(setq user-emacs-directory (file-name-directory user-init-file))
(message "Loading %s..." user-init-file)
(when (< emacs-major-version 27)
(setq package-enable-at-startup nil)
;; (package-initialize)
(load-file (expand-file-name "early-init.el" user-emacs-directory)))
(setq inhibit-startup-buffer-menu t)
(setq inhibit-startup-screen t)
(setq inhibit-startup-echo-area-message "locutus")
(setq initial-buffer-choice t)
(setq initial-scratch-message "")
(when (fboundp 'scroll-bar-mode)
(scroll-bar-mode 0))
(when (fboundp 'tool-bar-mode)
(tool-bar-mode 0))
(menu-bar-mode 0))
(eval-and-compile ; `borg'
(add-to-list 'load-path (expand-file-name "lib/borg" user-emacs-directory))
(require 'borg)
(borg-initialize))
(eval-and-compile ; `use-package'
(setopt use-package-enable-imenu-support t)
(setopt use-package-verbose t)
(require 'use-package))
(use-package compat)
(use-package dash
:config (global-dash-fontify-mode))
(use-package eieio)
(use-package auto-compile
:config
(setq auto-compile-display-buffer nil)
(setq auto-compile-mode-line-counter t)
(setq auto-compile-source-recreate-deletes-dest t)
(setq auto-compile-toggle-deletes-nonlib-dest t)
(setq auto-compile-update-autoloads t))
(use-package epkg
:defer t
:init
(setq epkg-repository
(expand-file-name "var/epkgs/" user-emacs-directory))
(setq epkg-database-connector
(if (>= emacs-major-version 29) 'sqlite-builtin 'sqlite-module)))
(use-package custom
:no-require t
:config
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(when (file-exists-p custom-file)
(load custom-file)))
(use-package server
:functions (server-running-p)
:config (or (server-running-p) (server-mode)))
(progn ; startup
(message "Loading early birds...done (%.3fs)"
(float-time (time-subtract (current-time)
before-user-init-time))))
;;; Long tail
(use-package diff-hl
:config
(setq diff-hl-draw-borders nil)
(global-diff-hl-mode)
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh t))
(use-package diff-mode
:defer t
:config
(when (>= emacs-major-version 27)
(set-face-attribute 'diff-refine-changed nil :extend t)
(set-face-attribute 'diff-refine-removed nil :extend t)
(set-face-attribute 'diff-refine-added nil :extend t)))
(use-package dired
:defer t
:config (setq dired-listing-switches "-alh"))
(use-package eldoc
:when (version< "25" emacs-version)
:config (global-eldoc-mode))
(use-package help
:defer t
:config (temp-buffer-resize-mode))
(progn ; `isearch'
(setq isearch-allow-scroll t))
(use-package lisp-mode
:config
(add-hook 'emacs-lisp-mode-hook 'outline-minor-mode)
(add-hook 'emacs-lisp-mode-hook 'reveal-mode)
(defun indent-spaces-mode ()
(setq indent-tabs-mode nil))
(add-hook 'lisp-interaction-mode-hook 'indent-spaces-mode))
(use-package magit
:defer t
:commands (magit-add-section-hook)
:config
(magit-add-section-hook 'magit-status-sections-hook
'magit-insert-modules
'magit-insert-stashes
'append))
(use-package man
:defer t
:config (setq Man-width 80))
(use-package paren
:config (show-paren-mode))
(use-package prog-mode
:config (global-prettify-symbols-mode)
(defun indicate-buffer-boundaries-left ()
(setq indicate-buffer-boundaries 'left))
(add-hook 'prog-mode-hook 'indicate-buffer-boundaries-left))
(use-package recentf
:demand t
:config (add-to-list 'recentf-exclude "^/\\(?:ssh\\|su\\|sudo\\)?x?:"))
(use-package savehist
:config (savehist-mode))
(use-package saveplace
:when (version< "25" emacs-version)
:config (save-place-mode))
(use-package simple
:config (column-number-mode))
(use-package smerge-mode
:defer t
:config
(when (>= emacs-major-version 27)
(set-face-attribute 'smerge-refined-removed nil :extend t)
(set-face-attribute 'smerge-refined-added nil :extend t)))
(progn ; `text-mode'
(add-hook 'text-mode-hook 'indicate-buffer-boundaries-left))
(use-package tramp
:defer t
:config
(add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:"))
(add-to-list 'tramp-default-proxies-alist '("localhost" nil nil))
(add-to-list 'tramp-default-proxies-alist
(list (regexp-quote (system-name)) nil nil))
(setq vc-ignore-dir-regexp
(format "\\(%s\\)\\|\\(%s\\)"
vc-ignore-dir-regexp
tramp-file-name-regexp)))
(use-package tramp-sh
:defer t
:config (cl-pushnew 'tramp-own-remote-path tramp-remote-path))
;;; Tequila worms
(progn ; startup
(message "Loading %s...done (%.3fs)" user-init-file
(float-time (time-subtract (current-time)
before-user-init-time)))
(add-hook 'after-init-hook
(lambda ()
(message
"Loading %s...done (%.3fs) [after-init]" user-init-file
(float-time (time-subtract (current-time)
before-user-init-time))))
t))
(progn ; personalize
(let ((file (expand-file-name (concat (user-real-login-name) ".el")
user-emacs-directory)))
(when (file-exists-p file)
(load file))))
;; Local Variables:
;; indent-tabs-mode: nil
;; End:
;;; init.el ends here