-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
621 lines (453 loc) · 20.5 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
;;; -*- lexical-binding: t -*-
;; ====
;; INIT
;; Package system and sources.
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
;; We will use 'use-package' to install and configure packages.
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile (require 'use-package))
;; No need to out 'ensure' everywhere, since we don't use anything else to install packages.
(setq use-package-always-ensure t)
;; Pass system shell environment to Emacs. This is important primarily for shell inside Emacs, but also things like Org mode export to Tex PDF don't work, since it relies on running external command pdflatex, which is loaded from PATH.
(use-package exec-path-from-shell
:ensure t)
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
;; Store custom-file separately, don't freak out when it's not found
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file 'noerror)
;; Set path for private config. private.el is not part of Castlemacs and you can use it for your personal
;; additions. Do not change init.el yourself, it will make updates harder.
(add-hook
'after-init-hook
(lambda ()
(let ((private-file (concat user-emacs-directory "private.el")))
(when (file-exists-p private-file)
(load-file private-file)))))
;; =============
;; MODIFIER KEYS
;; s - command
;; S - shift
;; M - option
;; C - control
;; Both command keys are 'Super'
(setq mac-right-command-modifier 'super)
(setq mac-command-modifier 'super)
;; Option or Alt is naturally 'Meta'
(setq mac-option-modifier 'meta)
;; Right Alt (option) can be used to enter symbols like em dashes '—' and euros '€' and stuff.
;; My keyboard annoyingly sends the windows key as right option so I need to set this meta as well.
(setq mac-right-option-modifier 'meta)
;; Control is control, and you also need to change Caps Lock to Control in the Keyboard
;; preferences in macOS.
;; =============
;; SANE DEFAULTS
;; Smoother and nicer scrolling
(setq scroll-margin 10
scroll-step 1
next-line-add-newlines nil
scroll-conservatively 10000
scroll-preserve-screen-position 1)
(setq mouse-wheel-follow-mouse 't)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1)))
;; Use ESC as universal get me out of here command
(define-key key-translation-map (kbd "ESC") (kbd "C-g"))
;; Don't bother with auto save and backups.
(setq auto-save-default nil)
(setq make-backup-files nil)
;; Warn when opening files bigger than 100MB
(setq large-file-warning-threshold 100000000)
;; Move file to trash instead of removing.
(setq-default delete-by-moving-to-trash t)
;; Revert (update) buffers automatically when underlying files are changed externally.
(global-auto-revert-mode t)
(setq
inhibit-startup-message t ; Don't show the startup message...
inhibit-startup-screen t ; ... or screen
cursor-in-non-selected-windows t ; Hide the cursor in inactive windows
echo-keystrokes 0.1 ; Show keystrokes right away, don't show the message in the scratch buffer
initial-scratch-message nil ; Empty scratch buffer
initial-major-mode 'org-mode ; Org mode by default
sentence-end-double-space nil ; Sentences should end in one space, come on!
confirm-kill-emacs 'y-or-n-p ; y and n instead of yes and no when quitting
help-window-select t ; Select help window so it's easy to quit it with 'q'
)
(fset 'yes-or-no-p 'y-or-n-p) ; y and n instead of yes and no everywhere else
(delete-selection-mode 1) ; Delete selected text when typing
(global-unset-key (kbd "s-p")) ; Don't print
;; We need Emacs kill ring and system clipboard to be independent. Simpleclip is the solution to that.
(use-package simpleclip
:config
(simpleclip-mode 1))
;; Shortcuts you'd expect from macOS app.
(global-set-key (kbd "s-s") 'save-buffer) ;; save
(global-set-key (kbd "s-S") 'write-file) ;; save as
(global-set-key (kbd "s-q") 'save-buffers-kill-emacs) ;; quit
(global-set-key (kbd "s-a") 'mark-whole-buffer) ;; select all
;; Delete trailing spaces and add new line in the end of a file on save.
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(setq require-final-newline t)
;; Linear undo and redo.
(use-package undo-tree
:diminish undo-tree-mode
:init
(progn
(global-undo-tree-mode)
(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/tmp/undo"))
undo-tree-auto-save-history t
undo-tree-visualizer-timestamps t
undo-tree-visualizer-diff t)))
(global-set-key (kbd "s-z") 'undo-tree-undo)
(global-set-key (kbd "s-Z") 'undo-tree-redo)
;; =======
;; VISUALS
;; Enable transparent title bar on macOS
(when (memq window-system '(mac ns))
(add-to-list 'default-frame-alist '(ns-appearance . dark)) ;; {light, dark}
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)))
;; Font
(when (member "SF Mono" (font-family-list))
(set-face-attribute 'default nil :font "SF Mono 16"))
(setq-default line-spacing 3)
;; Nice and simple default light theme.
;; (use-package poet-theme)
(load-theme 'misterioso)
;; Pretty icons
(use-package all-the-icons)
;; MUST DO M-x all-the-icons-install-fonts after
;; Hide toolbar and scroll bar
(tool-bar-mode -1)
(scroll-bar-mode -1)
;; Always wrap lines
(global-visual-line-mode 1)
;; Highlight current line
(global-hl-line-mode 0)
;; Show parens and other pairs.
(use-package smartparens
:diminish
:config
(require 'smartparens-config)
(smartparens-global-mode t)
(show-smartparens-global-mode t))
;; Hide minor modes from modeline
(use-package rich-minority
:config
(rich-minority-mode 1)
(setf rm-blacklist ""))
;; Set colors to distinguish between active and inactive windows
;; (set-face-attribute 'mode-line nil :background "SlateGray1")
;; (set-face-attribute 'mode-line-inactive nil :background "grey93")
;; File tree
(use-package neotree
:config
(setq neo-window-width 32
neo-create-file-auto-open t
neo-banner-message nil
neo-show-updir-line t
neo-window-fixed-size nil
neo-vc-integration nil
neo-mode-line-type 'neotree
neo-smart-open t
neo-show-hidden-files t
neo-mode-line-type 'none
neo-auto-indent-point t)
(setq neo-theme (if (display-graphic-p) 'nerd 'arrow))
(setq neo-hidden-regexp-list '("venv" "\\.pyc$" "~$" "\\.git" "__pycache__" ".DS_Store"))
(global-set-key (kbd "s-B") 'neotree-toggle)) ;; Cmd+Shift+b toggle tree
;; Show filename in the title bar.
(setq-default frame-title-format "%b")
;; Never use tabs, use spaces instead.
(setq tab-width 4)
(setq js-indent-level 4)
(setq css-indent-offset 4)
(setq c-basic-offset 4)
(setq-default indent-tabs-mode nil)
(setq-default c-basic-offset 4)
(setq-default tab-width 4)
(setq-default c-basic-indent 4)
;; Show keybindings cheat-sheet
(use-package which-key
:config
(which-key-mode)
(setq which-key-idle-delay 0.2))
;; ================
;; BASIC NAVIGATION
(global-set-key (kbd "s-;") 'forward-word) ;; move forward a word
;; Kill line with CMD-Backspace. Note that thanks to Simpleclip, killing doesn't rewrite the system clipboard.
;; Kill one word with Alt+Backspace.
;; Kill forward word with Alt-Shift-Backspace.
(global-set-key (kbd "s-<backspace>") 'kill-whole-line)
(global-set-key (kbd "M-S-<backspace>") 'kill-word)
;; Use Cmd for movement and selection.
(global-set-key (kbd "s-<right>") (kbd "C-e")) ;; End of line
(global-set-key (kbd "S-s-<right>") (kbd "C-S-e")) ;; Select to end of line
(global-set-key (kbd "s-<left>") (kbd "M-m")) ;; Beginning of line (first non-whitespace character)
(global-set-key (kbd "S-s-<left>") (kbd "M-S-m")) ;; Select to beginning of line
(global-set-key (kbd "s-<up>") 'beginning-of-buffer) ;; First line
(global-set-key (kbd "s-<down>") 'end-of-buffer) ;; Last line
;; Thanks to Bozhidar Batsov
;; http://emacsredux.com/blog/2013/]05/22/smarter-navigation-to-the-beginning-of-a-line/
(defun smarter-move-beginning-of-line (arg)
"Move point back to indentation of beginning of line.
Move point to the first non-whitespace character on this line.
If point is already there, move to the beginning of the line.
Effectively toggle between the first non-whitespace character and
the beginning of the line.
If ARG is not nil or 1, move forward ARG - 1 lines first. If
point reaches the beginning or end of the buffer, stop there."
(interactive "^p")
(setq arg (or arg 1))
;; Move lines first
(when (/= arg 1)
(let ((line-move-visual nil))
(forward-line (1- arg))))
(let ((orig-point (point)))
(back-to-indentation)
(when (= orig-point (point))
(move-beginning-of-line 1))))
(global-set-key (kbd "C-a") 'smarter-move-beginning-of-line)
(global-set-key (kbd "s-<left>") 'smarter-move-beginning-of-line)
;; Many commands in Emacs write the current position into mark ring.
;; These custom functions allow for quick movement backward and forward.
;; For example, if you were editing line 6, then did a search with Cmd+f, did something and want to come back,
;; press Cmd+, to go back to line 6. Cmd+. to go forward.
;; These keys are the same buttons as < and >, think of them as arrows.
(defun my-pop-local-mark-ring ()
(interactive)
(set-mark-command t))
(defun unpop-to-mark-command ()
"Unpop off mark ring. Does nothing if mark ring is empty."
(interactive)
(when mark-ring
(setq mark-ring (cons (copy-marker (mark-marker)) mark-ring))
(set-marker (mark-marker) (car (last mark-ring)) (current-buffer))
(when (null (mark t)) (ding))
(setq mark-ring (nbutlast mark-ring))
(goto-char (marker-position (car (last mark-ring))))))
(global-set-key (kbd "s-,") 'my-pop-local-mark-ring) ;; Command - ,
(global-set-key (kbd "s-.") 'unpop-to-mark-command) ;; Command - .
;; Same keys with Shift will move you back and forward between open buffers.
(global-set-key (kbd "s-<") 'previous-buffer)
(global-set-key (kbd "s->") 'next-buffer)
;; ============
;; TEXT EDITING
;; Expand-region allows to gradually expand selection inside words, sentences, expressions, etc.
(use-package expand-region
:config
(global-set-key (kbd "s-'") 'er/expand-region) ;; Cmd - ' (apostrophe) to expand
(global-set-key (kbd "s-\"") 'er/contract-region)) ;; Cmd - " (same, but with shift) to contract
;; Move-text lines around with meta-up/down.
(use-package move-text
:config
(move-text-default-bindings))
;; Quickly insert new lines above or below the current line, with correct indentation.
(defun smart-open-line ()
"Insert an empty line after the current line. Position the cursor at its beginning, according to the current mode."
(interactive)
(move-end-of-line nil)
(newline-and-indent))
(defun smart-open-line-above ()
"Insert an empty line above the current line. Position the cursor at it's beginning, according to the current mode."
(interactive)
(move-beginning-of-line nil)
(newline-and-indent)
(forward-line -1)
(indent-according-to-mode))
(global-set-key (kbd "s-<return>") 'smart-open-line) ;; Cmd+Return new line below
(global-set-key (kbd "s-S-<return>") 'smart-open-line-above) ;; Cmd+Shift+Return new line above
;; Upcase and lowercase word or region, if selected.
;; To capitalize or un-capitalize word use Alt+c and Alt+l
(global-set-key (kbd "M-u") 'upcase-dwim) ;; Alt+u upcase
(global-set-key (kbd "M-l") 'downcase-dwim) ;; Alt-l lowercase
;; Comment line or region.
(global-set-key (kbd "s-/") 'comment-line)
;; Visually find and replace text
(use-package visual-regexp
:config
(define-key global-map (kbd "M-s-f") 'vr/replace)
(define-key global-map (kbd "s-r") 'vr/replace)) ;; Cmd+r find and replace
;; =================
;; WINDOW MANAGEMENT
;; This is rather radical, but saves from a lot of frustration.
;; When split is automatic, always split windows vertically
(setq split-height-threshold 0)
(setq split-width-threshold nil)
(global-set-key (kbd "s-1") (kbd "C-x 1")) ;; Cmd-1 kill other windows (keep 1)
(global-set-key (kbd "s-2") (kbd "C-x 2")) ;; Cmd-2 split horizontally
(global-set-key (kbd "s-3") (kbd "C-x 3")) ;; Cmd-3 split vertically
(global-set-key (kbd "s-0") (kbd "C-x 0")) ;; Cmd-0...
;; Cmd-w to close is mac required.
(global-set-key (kbd "s-w") (kbd "C-x 0")) ;; ...and Cmd-w to close current window
;; Move between windows with Control-Command-Arrow and with =Cmd= just like in iTerm.
(use-package windmove
:config
(global-set-key (kbd "<C-s-left>") 'windmove-left) ;; Ctrl+Cmd+left go to left window
(global-set-key (kbd "s-[") 'windmove-left) ;; Cmd+[ go to left window
(global-set-key (kbd "<C-s-right>") 'windmove-right) ;; Ctrl+Cmd+right go to right window
(global-set-key (kbd "s-]") 'windmove-right) ;; Cmd+] go to right window
(global-set-key (kbd "<C-s-up>") 'windmove-up) ;; Ctrl+Cmd+up go to upper window
(global-set-key (kbd "s-{") 'windmove-up) ;; Cmd+Shift+[ go to upper window
(global-set-key (kbd "<C-s-down>") 'windmove-down) ;; Ctrl+Cmd+down go to down window
(global-set-key (kbd "s-}") 'windmove-down)) ;; Cmd+Shift+] got to down window
;; Enable winner mode to quickly restore window configurations
(winner-mode 1)
(global-set-key (kbd "M-s-[") 'winner-undo)
(global-set-key (kbd "M-s-]") 'winner-redo)
;; ==========================================
;; MENUS AND COMPLETION (not code completion)
;; Use minimalist Ivy for most suggestions.
(use-package ivy
:diminish ;; don't show Ivy in minor mode list
:config
(ivy-mode 1) ;; enable Ivy everywhere
(setq ivy-use-virtual-buffers t) ;; show bookmarks and recent files in buffer list
(setq ivy-count-format "(%d/%d) ")
(setq enable-recursive-minibuffers t)
(setq ivy-re-builders-alist
'((swiper . ivy--regex-plus)
(t . ivy--regex-fuzzy))) ;; enable fuzzy searching everywhere except for Swiper
(global-set-key (kbd "s-b") 'ivy-switch-buffer) ;; Cmd+b show buffers and recent files
(global-set-key (kbd "M-s-b") 'ivy-resume)) ;; Alt+Cmd+b resume whatever Ivy was doing
;; Swiper is a better local finder.
(use-package swiper
:config
(global-set-key "\C-s" 'swiper) ;; Default Emacs Isearch forward...
(global-set-key "\C-r" 'swiper) ;; ... and Isearch backward replaced with Swiper
(global-set-key (kbd "s-f") 'swiper)) ;; Cmd+f find text
;; Better menus with Counsel (a layer on top of Ivy)
(use-package counsel
:config
(global-set-key (kbd "M-x") 'counsel-M-x) ;; Alt+x run command
(global-set-key (kbd "s-P") 'counsel-M-x) ;; Cmd+Shift+p run command
(global-set-key (kbd "C-x C-f") 'counsel-find-file) ;; Replace built-in Emacs 'find file' (open file) with Counsel
(global-set-key (kbd "s-o") 'counsel-find-file)) ;; Cmd+o open file
(use-package smex) ;; show recent commands when invoking Alt-x (or Cmd+Shift+p)
(use-package flx) ;; enable fuzzy matching
(use-package avy) ;; enable avy for quick navigation
;; Make Ivy a bit more friendly by adding information to ivy buffers, e.g. description of commands in Alt-x, meta info when switching buffers, etc.
(use-package ivy-rich
:config
(ivy-rich-mode 1)
(setq ivy-rich-path-style 'abbrev)) ;; Abbreviate paths using abbreviate-file-name (e.g. replace “/home/username” with “~”)
;; ========================
;; VERSION CONTROL WITH GIT
;; Magit
(use-package magit
:config
(global-set-key (kbd "s-g") 'magit-status)) ;; Cmd+g for git status
;; Show changes in the gutter
(use-package git-gutter
:diminish
:config
(global-git-gutter-mode 't)
(set-face-background 'git-gutter:modified 'nil) ;; background color
(set-face-foreground 'git-gutter:added "green4")
(set-face-foreground 'git-gutter:deleted "red"))
;; ===============
;; CODE COMPLETION
(use-package company
:config
(setq company-idle-delay 0.1)
(setq company-global-modes '(not org-mode))
(setq company-minimum-prefix-length 1)
(add-hook 'after-init-hook 'global-company-mode))
;; Set the company completion vocabulary to css and html when in web-mode.
(defun my-web-mode-hook ()
(set (make-local-variable 'company-backends) '(company-css company-web-html company-yasnippet company-files)))
;; ===========================
;; SPELLCHECKING AND THESAURUS
;; Spellchecking requires an external command to be available. Install aspell on your Mac, then make it the default checker for Emacs' ispell. Note that personal dictionary is located at ~/.aspell.LANG.pws by default.
(setq ispell-program-name "aspell")
;; Popup window for spellchecking
(use-package flyspell-correct)
(use-package flyspell-correct-popup)
;; Enable spellcheck on the fly for all text modes. This includes org, latex and LaTeX.
(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'prog-mode-hook 'flyspell-prog-mode)
;; Enable right mouse click on macOS to see the list of suggestions.
(eval-after-load "flyspell"
'(progn
(define-key flyspell-mouse-map [down-mouse-3] #'flyspell-correct-word)
(define-key flyspell-mouse-map [mouse-3] #'undefined)))
;; Spellcheck current word
(define-key flyspell-mode-map (kbd "s-\\") 'flyspell-correct-previous-word-generic) ;; Cmd+\ spellcheck word with popup
(define-key flyspell-mode-map (kbd "C-s-\\") 'ispell-word) ;; Ctrl+Cmd+\ spellcheck word using built UI
;; Search for synonyms
(use-package powerthesaurus
:config
(global-set-key (kbd "s-|") 'powerthesaurus-lookup-word-dwim)) ;; Cmd+Shift+\ search thesaurus
;; Word definition search
(use-package define-word
:config
(global-set-key (kbd "M-\\") 'define-word-at-point))
;; =========
;; DASHBOARD
(use-package dashboard
:ensure t
:config
(dashboard-setup-startup-hook))
(setq dashboard-banner-logo-title "⌘ welcome to castleORG")
;; Set the banner
(setq dashboard-startup-banner 'logo)
(setq dashboard-items '((recents . 5)
(bookmarks . 5)
(agenda . 5)
(registers . 5)))
;; =============
;; MODIFIER KEYS
;; s - command
;; S - shift
;; M - option
;; C - control
;; ========
;; ORG MODE
;; Some basic Org defaults
(use-package org
:config
(setq org-startup-indented t) ;; Visually indent sections. This looks better for smaller files.
(setq org-src-tab-acts-natively t) ;; Tab in source blocks should act like in major mode
(setq org-src-preserve-indentation t)
(setq org-log-into-drawer t) ;; State changes for todos and also notes should go into a Logbook drawer
(setq org-src-fontify-natively t) ;; Code highlighting in code blocks
(setq org-log-done 'time) ;; Add closed date when todo goes to DONE state
(setq org-support-shift-select t)) ;; Allow shift selection with arrows.
(use-package org-bullets)
(require 'org-bullets)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(setq org-bullets-bullet-list
'("◉" "○"))
;; Store all my org files in ~/org.
(setq org-directory "~/Dropbox/org")
;; And all of those files should be in included agenda.
(setq org-agenda-files '("~/Dropbox/org"))
;; Open main org file with C-c o
(global-set-key (kbd "M-s-o") (lambda () (interactive) (find-file "~/Dropbox/org/main.org")))
;; View inbox with C-c i
;; DONE change to an inbox item processed view - don't just look at raw file.
(global-set-key (kbd "s-t") (lambda () (interactive) (org-todo-list)))
;; Start capture with C-c c
(global-set-key (kbd "s-g") 'org-capture)
;; Open org-agenda
(global-set-key (kbd "s-e") 'org-agenda)
(global-set-key (kbd "s-d") 'org-agenda-list)
;; For org-capture, set default file to save into
(setq org-default-notes-file "~/Dropbox/org/inbox.org")
;; Open config file by pressing C-x and then C
(global-set-key (kbd "C-x C") (lambda () (interactive) (find-file "~/.emacs.d/init.el")))
;; Open private config file by pressing C-x and then c
;; Contain custom settings to private.el to ensure easy Castlemacs updates.
(global-set-key (kbd "C-x c") (lambda () (interactive) (find-file "~/.emacs.d/private.el")))
;; =======
;; THE END