blob: 2df4c43876b8fefd007981abd7e243d626701f05 (
plain) (
blame)
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
|
#+startup: content indent
This file is my emacs config, written as an org file. To export it,
run ~M-x org-babel-tangle~.
* Initial stuff
#+begin_src emacs-lisp :tangle "init.el"
; -*- lexical-binding: t; -*-
; NOTE: This file is automatically generated from init.org. Changes
; should go there, not here.
#+end_src
* Put all the customisation stuff in its own file
When new packages are installed, or settings are changed in the
customisation interface, emacs automatically saves this
information. By default, it is put into the init file, but this is
noisy, and I prefer it to be in another file.
** Set the custom file
#+begin_src emacs-lisp :tangle "init.el"
(setq custom-file (locate-user-emacs-file "custom.el"))
#+end_src
** Load the custom file's contents
#+begin_src emacs-lisp :tangle "init.el"
(load custom-file t)
#+end_src
* Setup package archive
Some packages I use come from melpa.
#+begin_src emacs-lisp :tangle "init.el"
(require 'package)
(package-initialize)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
#+end_src
* Configure use-package
Tell use-package to assume ~:defer t~.
#+begin_src emacs-lisp :tangle "init.el"
(setq use-package-always-defer t)
#+end_src
Tell it to assume ~:ensure t~ as well.
#+begin_src emacs-lisp :tangle init.el
(require 'use-package-ensure)
(setq use-package-always-ensure t)
#+end_src
* Basic configuration
#+begin_src emacs-lisp :tangle "init.el" :noweb yes
(use-package emacs
:demand t
:custom
<<basic-custom>>
:config
<<basic-config>>
)
#+end_src
** Startup
Remove the splash screen
#+begin_src emacs-lisp :noweb-ref basic-custom
(inhibit-splash-screen t)
#+end_src
Use a specific org file as the initial buffer.
#+begin_src emacs-lisp :noweb-ref basic-custom
(initial-buffer-choice "~/org-files/startup.org")
#+end_src
** System-specific setup
*** MacOS
#+begin_src emacs-lisp :noweb-ref basic-config
(when (eq system-type 'darwin)
(setq mac-right-option-modifier 'none))
#+end_src
* Appearence configuration
** Modus theme
Load a nice looking theme.
#+begin_src emacs-lisp :tangle "init.el"
(use-package modus-themes
:demand t
:custom
(modus-themes-mixed-fonts t)
(modus-themes-variable-pitch-ui t)
(modus-themes-disable-other-themes t)
:config
(modus-themes-load-theme 'modus-operandi-tinted))
#+end_src
** Default fonts
#+begin_src emacs-lisp :noweb-ref basic-config
(set-face-attribute 'default nil :family "Iosevka" :height 140)
(set-face-attribute 'fixed-pitch nil :family "Iosevka Extended")
(set-face-attribute 'fixed-pitch-serif nil :family "Iosevka Slab Extended")
(set-face-attribute 'variable-pitch nil :family "Iosevka Etoile")
#+end_src
** Disable UI elements
Remove the menu bar
#+begin_src emacs-lisp :noweb-ref basic-config
(menu-bar-mode -1)
#+end_src
Remove the scroll bars
#+begin_src emacs-lisp :noweb-ref basic-config
(scroll-bar-mode -1)
#+end_src
Remove the tool bar
#+begin_src emacs-lisp :noweb-ref basic-config
(tool-bar-mode -1)
#+end_src
* Minibuffer
Customisation of defaults.
#+begin_src emacs-lisp :noweb-ref basic-custom
(completion-eager-display t)
(completion-eager-update t)
(completion-show-help nil)
(completion-show-inline-help nil)
(completions-detailed t)
(completions-group t)
(completions-max-height 10)
(completions-sort 'historical)
(minibuffer-completion-auto-choose t)
(read-buffer-completion-ignore-case t)
(read-file-name-completion-ignore-case t)
#+end_src
Enable electric mode by default.
#+begin_src emacs-lisp :noweb-ref basic-config
(minibuffer-electric-default-mode)
#+end_src
* Magit
#+begin_src emacs-lisp :tangle "init.el"
(use-package magit)
#+end_src
* Ghostel (terminal)
#+begin_src emacs-lisp :tangle "init.el"
(use-package ghostel
:bind (("C-c t" . ghostel-new)))
#+end_src
* Mediawiki
#+begin_src emacs-lisp :tangle "init.el"
(use-package mediawiki
:custom
(mediawiki-site-defaut "dyalog")
:config
(add-to-list 'mediawiki-site-alist
'("dyalog" "https://wiki.bramley.dyalog.com" "peterm" nil ""
:description "Dyalog internal wiki" :first-page "User:Peterm")))
#+end_src
* Project
#+begin_src emacs-lisp :tangle "init.el"
(use-package project
:custom
(project-mode-line t))
#+end_src
* Org mode and associated packages
** Base org package
#+begin_src emacs-lisp :tangle "init.el"
(use-package org
:bind
(("C-c l" . org-store-link)
("C-c a" . org-agenda)
("C-c c" . org-capture)))
#+end_src
** Org roam
#+begin_src emacs-lisp :tangle "init.el"
(use-package org-roam
:custom
(org-roam-directory (file-truename "~/org-files/roam"))
:config
(org-roam-db-autosync-mode))
#+end_src
* vc-fossil
Load support for fossil-scm.
#+begin_src emacs-lisp :tangle "init.el"
(use-package vc-fossil
:init (add-to-list 'vc-handled-backends 'Fossil t))
#+end_src
* Automatically tangle the file on
# Local Variables:
# eval: (add-hook 'after-save-hook #'org-babel-tangle nil t)
# End:
|