-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.el
168 lines (116 loc) · 4.33 KB
/
config.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
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; References
;; - https://tecosaur.github.io/emacs-config/config.html
;;;; Better defaults
;; Simple settings
(setq user-full-name "tisoga"
user-mail-address "[email protected]")
(setq-default delete-by-moving-to-trash t
window-combination-resize t
x-stretch-cursor t)
(setq undo-limit 80000000
evil-want-fine-undo t
auto-save-default t
truncate-string-ellipsis "..."
password-cache-expiry nil
scroll-margin 2)
(display-time-mode 1)
;; Better key bindings
(map! :leader
:desc "M-x" "SPC" #'execute-extended-command
:desc "Buffer Switch" "TAB" #'evil-switch-to-windows-last-buffer
(:desc "Code" :prefix "c"
:desc "Comment or uncomment lines" :gnv "l" #'evilnc-comment-or-uncomment-lines)
(:desc "Git" :prefix "g"
:desc "Magit status" "s" #'magit-status)
(:desc "Project" :prefix "p"
:desc "Search project" "s" #'+ivy/project-search))
(map!
(:when (featurep! :tools lookup)
:nv "gb" #'better-jumper-jump-backward
:nv "gf" #'better-jumper-jump-forward))
;; Some evil stuff
(use-package! evil-little-word
:config
(map! :nov "w" #'evil-forward-little-word-begin
:nov "b" #'evil-backward-little-word-begin
:v "i w" #'evil-inner-little-word))
;; Frame sizing
(add-to-list 'default-frame-alist '(height . 24))
(add-to-list 'default-frame-alist '(weight . 80))
;; Auto-customisations
(setq-default custom-file (expand-file-name ".custom.el" doom-private-dir))
(when (file-exists-p custom-file)
(load custom-file))
;; Windows
(setq evil-vsplit-window-right t
evil-split-window-below t)
(defadvice! prompt-for-buffer (&rest _)
:after '(evil-window-split evil-window-vsplit)
(+ivy/switch-buffer))
(setq +ivy-buffer-preview t)
(map! :map evil-window-map
"SPC" #'rotate-layout
;; Split
"/" #'split-window-right
"-" #'split-window-below
;; Navigation
"<left>" #'evil-window-left
"<down>" #'evil-window-down
"<up>" #'evil-window-up
"<right>" #'evil-window-right
;; Swapping windows
"C-<left>" #'+evil/window-move-left
"C-<down>" #'+evil/window-move-down
"C-<up>" #'+evil/window-move-up
"C-<right>" #'+evil/window-move-right
)
;; Buffer defaults
(setq-default major-mode 'org-mode)
;;;; Doom configuration
;; Font
(setq doom-font (font-spec :family "JetBrains Mono" :size 18)
doom-big-font (font-spec :family "JetBrains Mono" :size 36))
;; Theme and modeline
(setq doom-theme 'doom-vibrant)
(remove-hook 'window-setup-hook #'doom-init-theme-h)
(add-hook 'after-init-hook #'doom-init-theme-h 'append)
(delq! t custom-theme-load-path)
(custom-set-faces!
'(doom-modeline-buffer-modified :foreground "orange"))
(defun doom-modeline-conditional-buffer-encoding ()
"We expect the encoding to be LF UTF-8, so only show the modeline when this is not the case"
(setq-local doom-modeline-buffer-encoding
(unless (and (memq (plist-get (coding-system-plist buffer-file-coding-system) :category)
'(coding-category-undecided coding-category-utf-8))
(not (memq (coding-system-eol-type buffer-file-coding-system) '(1 2))))
t)))
(add-hook 'after-change-major-mode-hook #'doom-modeline-conditional-buffer-encoding)
(setq doom-modeline-icon nil)
;; Misc
(setq display-line-numbers-type 'relative)
;; Company
(after! company
(setq company-idle-delay 0.2
company-minimum-prefix-length 3)
(add-hook 'evil-normal-state-entry-hook #'company-abort)) ;; make aborting less annoying
(setq-default history-length 1000)
(setq-default prescient-history-length 1000)
;; Evil
(after! evil
(setq evil-kill-on-visual-paste nil))
;; Info colours
(use-package! info-colors
:commands (info-colors-fontify-node))
(add-hook 'Info-selection-hook 'info-colors-fontify-node)
;; Which key
(setq which-key-idle-delay 0.5)
;;;; Language configuration
;; Plaintext
(after! text-mode
(add-hook! 'text-mode-hook
;; Apply ANSI color codes
(with-silent-modifications
(ansi-color-apply-on-region (point-min) (point-max)))))