4 ;; need no stinkin emacs help screen as start up, and no menu bar
5 (setq inhibit-startup-screen t)
8 ;; highlight cursor line, parentheses
9 (global-hl-line-mode 1)
12 ;; show line numbers, use separator space
14 (setq linum-format "%d ")
16 ;; count cursor column, row in mode line
17 (setq column-number-mode t)
19 ;; settings to make GUI tolerable
22 (add-to-list 'default-frame-alist '(foreground-color . "white"))
23 (add-to-list 'default-frame-alist '(background-color . "black"))
24 (set-face-attribute 'default nil :height 80)
27 (setq linum-format "%d")))
29 ;; use as default browser what XDG offers
30 (setq-default browse-url-browser-function 'browse-url-xdg-open)
34 ;; general keybindings
35 ;; ===================
37 ;; create and use a minimal global map using just the self-insert command
38 ;; bindings and a selection of some to me very common keystrokes
39 (setq minimal-map (make-sparse-keymap))
40 (substitute-key-definition 'self-insert-command 'self-insert-command
41 minimal-map global-map)
42 (use-global-map minimal-map)
43 (global-set-key (kbd "DEL") 'backward-delete-char-untabify)
44 (global-set-key (kbd "RET") 'newline)
45 (global-set-key (kbd "TAB") 'indent-for-tab-command)
46 (global-set-key (kbd "<up>") 'previous-line)
47 (global-set-key (kbd "<down>") 'next-line)
48 (global-set-key (kbd "<left>") 'left-char)
49 (global-set-key (kbd "<right>") 'right-char)
50 (global-set-key (kbd "<prior>") 'scroll-down-command)
51 (global-set-key (kbd "<next>") 'scroll-up-command)
52 (global-set-key (kbd "M-x") 'execute-extended-command)
53 (global-set-key (kbd "C-g") 'keyboard-quit)
54 ;(global-set-key (kbd "<f3>") 'kmacro-start-macro-or-insert-counter)
55 ;(global-set-key (kbd "<f4>") 'kmacro-end-or-call-macro)
56 ;; note how to switch back to the original map: (use-global-map global-map)
57 (setq shr-map (make-sparse-keymap)) ; got annoying in elfeed-show on URLs
64 ;; incremental minibuffer completion
73 (setq-default indent-tabs-mode nil)
74 (setq-default tab-width 4)
75 (setq indent-line-function 'insert-tab)
77 ;; show trailing whitespace
78 (setq-default show-trailing-whitespace 1)
80 ;; on save, ask whether to ensure text file's last line ends in a
82 (setq require-final-newline 1)
84 ;; use dedicated directory for version-controlled, endless backups;
85 ;; never delete old versions
86 (setq make-backup-files t
87 backup-directory-alist `(("." . "~/.emacs_backups"))
90 delete-old-versions 1) ;; neither t nor nil: never delete
96 ;; where we get packages from
97 (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
98 ("melpa-unstable" . "https://melpa.org/packages/")
99 ("melpa-stable" . "https://stable.melpa.org/packages/")))
101 ;; ensure certain packages are installed (actually, we use Debian repos here)
102 ;; credit to <https://stackoverflow.com/a/10093312>
103 ;(setq package-list '(elfeed ledger-mode))
104 ;(package-initialize)
105 ;(dolist (package package-list)
106 ; (unless (package-installed-p package)
107 ; (package-install package)))
111 ;;; window management
112 ;;; =================
114 ;;; track window configurations to allow window config undo
122 (setq send-mail-function 'smtpmail-send-it)
123 (setq smtpmail-smtp-server "mail.plomlompom.com")
124 (setq smtpmail-smtp-service 465)
125 (setq smtpmail-stream-type 'ssl)
126 (setq smtpmail-smtp-user "plom")
127 (setq mml-secure-openpgp-encrypt-to-self t)
128 (add-hook 'message-setup-hook 'mml-secure-sign-pgpmime)
130 ;; constructs From: domain if mail composer directly called (from without
131 ;; notmuch), but we don't actually intend to do that
132 ;(setq mail-host-address "plomlompom.com")
134 ;; otherwise notmuch becomes extremely slow in some cases
135 (setq-default notmuch-show-indent-content nil)
137 ;; this only works if we use notmuch-mua-send instead of message-send
138 (setq notmuch-fcc-dirs '(("plom@plomlompom.com" . "maildir/Sent")))
140 ;; this gets rid of "i-did-not-set--mail-host-address--so-tickle-me"
142 (setq mail-host-address "plomlompom.com")
144 ;; notmuch saved searches
145 (setq notmuch-saved-searches
146 '((:name "inbox" :query "tag:unread and folder:inbox")
147 (:name "all" :query "tag:unread not folder:maildir/Trash")
148 (:name "plomlompom.de" :query "tag:unread and folder:maildir/plomlompom.de")
149 (:name "nebenan" :query "tag:unread and folder:maildir/nebenan")
150 (:name "reflect-info" :query "tag:unread and folder:maildir/reflect-info")
151 (:name "gmail" :query "tag:unread and folder:maildir/gmail.com")
152 (:name "mutter" :query "tag:unread and folder:maildir/mutter")))
159 ;; unsure why, but to re-set the key map, we not only have to explicitely do it
160 ;; only after org-mode loading, but also have to explicitely overwrite the
161 ;; C-c keybinding; TODO: investigate
162 (with-eval-after-load 'org
163 (setq org-mode-map (make-sparse-keymap))
164 (define-key org-mode-map (kbd "C-c") nil)
165 (define-key org-mode-map (kbd "TAB") 'org-cycle)
166 (define-key org-mode-map (kbd "<backtab>") 'org-shifttab))
168 ;; don't truncate lines by default
169 (setq org-startup-truncated nil)
171 ;; basic org-capture config
172 (setq org-capture-templates
173 '(("x" "test" plain (file "~/org/notes.org") "%T: %?")))
174 (add-hook 'org-capture-mode-hook 'evil-insert-state)
176 ;; agenda view on startup
177 (load-library "find-lisp")
178 (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
179 (setq org-agenda-span 90)
180 (setq org-agenda-use-time-grid nil)
181 (add-hook 'emacs-startup-hook (lambda ()
183 (switch-to-buffer "*Org Agenda*")
186 ;;; for calendar, use ISO date style
187 ;(setq calendar-date-style 'iso)
188 ;(setq diary-number-of-entries 7)
190 ;(setq org-agenda-time-grid '((today require-timed remove-match)
191 ; #("----------------" 0 16 (org-heading t))
192 ; (0 200 400 600 800 1000 1200
193 ; 1400 1600 1800 2000 2200)))
195 ;; empty org-agenda-mode keybindings
196 (add-hook 'org-agenda-mode-hook
198 (setq org-agenda-mode-map (make-sparse-keymap))))
199 (add-hook 'org-agenda-mode-hook
201 (use-local-map (make-sparse-keymap))))
204 (setq org-publish-project-alist
207 :base-directory "~/org/web/"
208 :base-extension "org"
209 :publishing-directory "~/html/"
211 :publishing-function org-html-publish-to-html
212 :headline-levels 4 ; Just the default for this project.
216 ;; use [ki:] syntax to hide stuff from exports
217 (defun classify-information (text backend info)
218 "Replaces '[ki:WHATEVER]' with '[klassifizierte Information]'."
219 (replace-regexp-in-string "\\[ki:[^\]]*\]" "[klassifizierte Information]" text))
220 (add-hook 'org-export-filter-plain-text-functions 'classify-information)
222 ;; add HTML validator link to exports
223 (setq org-html-validation-link "<a href=\"https://validator.w3.org/check?uri=referer\">Validate</a>")
230 (setq Info-mode-map (make-sparse-keymap))
231 (define-key Info-mode-map (kbd "RET") 'Info-follow-nearest-node)
232 (define-key Info-mode-map (kbd "u") 'Info-up)
233 (define-key Info-mode-map (kbd "TAB") 'Info-next-reference)
234 (define-key Info-mode-map (kbd "<backtab>") 'Info-prev-reference)
235 (define-key Info-mode-map (kbd "H") 'Info-history-back)
236 (define-key Info-mode-map (kbd "L") 'Info-history-forward)
237 (define-key Info-mode-map (kbd "I") 'Info-goto-node)
238 (define-key Info-mode-map (kbd "i") 'Info-index)
245 (setq help-mode-map (make-sparse-keymap))
246 (define-key help-mode-map (kbd "TAB") 'forward-button)
247 (define-key help-mode-map (kbd "RET") 'help-follow)
248 (define-key help-mode-map (kbd "<backtab>") 'backward-button)
255 (require 'elfeed) ; needed so we can set the font faces
256 (set-face-background 'elfeed-search-title-face "magenta")
257 (set-face-background 'elfeed-search-unread-count-face "magenta")
259 '("https://capsurvival.blogspot.com/feeds/posts/default"
260 "https://jungle.world/rss.xml"
261 "http://news.dieweltistgarnichtso.net/bin/index.xml"
262 "https://taz.de/!s=&ExportStatus=Intern&SuchRahmen=Online;rss/"
263 "http://www.tagesschau.de/xml/atom"))
264 (setq elfeed-search-mode-map (make-sparse-keymap))
265 (define-key elfeed-search-mode-map (kbd "RET") 'elfeed-search-show-entry)
266 (defun elfeed-search-mark-as-read() (interactive)
267 (elfeed-search-untag-all 'unread))
268 (define-key elfeed-search-mode-map (kbd "r") 'elfeed-search-mark-as-read)
269 (define-key elfeed-search-mode-map (kbd "R") 'elfeed-search-tag-all-unread)
270 (define-key elfeed-search-mode-map (kbd "f") 'elfeed-search-live-filter)
271 (define-key elfeed-search-mode-map (kbd "u") 'elfeed-update)
272 (setq elfeed-show-mode-map (make-sparse-keymap))
273 (define-key elfeed-show-mode-map (kbd "u") 'elfeed)
274 (define-key elfeed-show-mode-map (kbd "TAB") 'shr-next-link)
275 (define-key elfeed-show-mode-map (kbd "<backtab>") 'shr-previous-link)
276 (define-key elfeed-show-mode-map (kbd "a") 'elfeed-show-prev)
277 (define-key elfeed-show-mode-map (kbd "d") 'elfeed-show-next)
278 (define-key elfeed-show-mode-map (kbd "y") 'shr-copy-url)
279 (define-key elfeed-show-mode-map (kbd "RET") 'shr-browse-url)
286 (setq eww-mode-map (make-sparse-keymap))
287 (define-key eww-mode-map (kbd "TAB") 'shr-next-link)
288 (define-key eww-mode-map (kbd "<backtab>") 'shr-previous-link)
289 (define-key eww-mode-map (kbd "H") 'eww-back-url)
290 (define-key eww-mode-map (kbd "L") 'eww-forward-url)
296 (setq ledger-mode-map (make-sparse-keymap))
297 (define-key ledger-mode-map (kbd "TAB") 'ledger-magic-tab)
304 (defvar plomvi-return-combo (kbd "C-c"))
305 (load "~/public_repos/plomvi.el/plomvi.el")
306 (plomvi-global-mode 1)