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)
32 ;; general keybindings
33 ;; ===================
35 ;; create and use a minimal global map using just the self-insert command
36 ;; bindings and a selection of some to me very common keystrokes
37 (setq minimal-map (make-sparse-keymap))
38 (substitute-key-definition 'self-insert-command 'self-insert-command
39 minimal-map global-map)
40 (use-global-map minimal-map)
41 (global-set-key (kbd "DEL") 'backward-delete-char-untabify)
42 (global-set-key (kbd "RET") 'newline)
43 (global-set-key (kbd "TAB") 'indent-for-tab-command)
44 (global-set-key (kbd "<up>") 'previous-line)
45 (global-set-key (kbd "<down>") 'next-line)
46 (global-set-key (kbd "<left>") 'left-char)
47 (global-set-key (kbd "<right>") 'right-char)
48 (global-set-key (kbd "<prior>") 'scroll-down-command)
49 (global-set-key (kbd "<next>") 'scroll-up-command)
50 (global-set-key (kbd "M-x") 'execute-extended-command)
51 (global-set-key (kbd "C-g") 'keyboard-quit)
52 ;(global-set-key (kbd "<f3>") 'kmacro-start-macro-or-insert-counter)
53 ;(global-set-key (kbd "<f4>") 'kmacro-end-or-call-macro)
54 ;; note how to switch back to the original map: (use-global-map global-map)
55 (setq shr-map (make-sparse-keymap)) ; got annoying in elfeed-show on URLs
61 ;; incremental minibuffer completion
70 (setq-default indent-tabs-mode nil)
71 (setq-default tab-width 4)
72 (setq indent-line-function 'insert-tab)
74 ;; show trailing whitespace
75 (setq-default show-trailing-whitespace 1)
77 ;; on save, ask whether to ensure text file's last line ends in a
79 (setq require-final-newline 1)
81 ;; use dedicated directory for version-controlled, endless backups;
82 ;; never delete old versions
83 (setq make-backup-files t
84 backup-directory-alist `(("." . "~/.emacs_backups"))
87 delete-old-versions 1) ;; neither t nor nil: never delete
94 ;; where we get packages from
95 (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
96 ("melpa-unstable" . "https://melpa.org/packages/")
97 ("melpa-stable" . "https://stable.melpa.org/packages/")))
99 ;; ensure certain packages are installed (actually, we use Debian repos here)
100 ;; credit to <https://stackoverflow.com/a/10093312>
101 ;(setq package-list '(elfeed ledger-mode))
102 ;(package-initialize)
103 ;(dolist (package package-list)
104 ; (unless (package-installed-p package)
105 ; (package-install package)))
109 ;;; window management
110 ;;; =================
112 ;;; track window configurations to allow window config undo
120 (setq send-mail-function 'smtpmail-send-it)
121 (setq smtpmail-smtp-server "core.plomlompom.com")
122 (setq smtpmail-smtp-service 465)
123 (setq smtpmail-stream-type 'ssl)
124 (setq smtpmail-smtp-user "plom")
125 (setq mml-secure-openpgp-encrypt-to-self t)
126 (add-hook 'message-setup-hook 'mml-secure-sign-pgpmime)
128 ;; constructs From: domain if mail composer directly called (from without
129 ;; notmuch), but we don't actually intend to do that
130 ;(setq mail-host-address "plomlompom.com")
132 ;; otherwise notmuch becomes extremely slow in some cases
133 (setq-default notmuch-show-indent-content nil)
135 ;; this only works if we use notmuch-mua-send instead of message-send
136 (setq notmuch-fcc-dirs '(("plom@plomlompom.com" . "maildir/Sent")))
138 ;; this gets rid of "i-did-not-set--mail-host-address--so-tickle-me"
140 (setq mail-host-address "plomlompom.com")
142 ;; notmuch saved searches
143 (setq notmuch-saved-searches
144 '((:name "inbox" :query "tag:unread and folder:inbox")
145 (:name "all" :query "tag:unread not folder:maildir/Trash")
146 (:name "plomlompom.de" :query "tag:unread and folder:maildir/plomlompom.de")
147 (:name "nebenan" :query "tag:unread and folder:maildir/nebenan")
148 (:name "reflect-info" :query "tag:unread and folder:maildir/reflect-info")
149 (:name "gmail" :query "tag:unread and folder:maildir/gmail.com")
150 (:name "mutter" :query "tag:unread and folder:maildir/mutter")))
155 ;; unsure why, but to re-set the key map, we not only have to explicitely do it
156 ;; only after org-mode loading, but also have to explicitely overwrite the
157 ;; C-c keybinding; TODO: investigate
158 (with-eval-after-load 'org
159 (setq org-mode-map (make-sparse-keymap))
160 (define-key org-mode-map (kbd "C-c") nil)
161 (define-key org-mode-map (kbd "TAB") 'org-cycle)
162 (define-key org-mode-map (kbd "<backtab>") 'org-shifttab))
164 ;; basic org-capture config
165 (setq org-capture-templates
166 '(("x" "test" plain (file "~/org/notes.org") "%T: %?")))
167 (add-hook 'org-capture-mode-hook 'evil-insert-state)
169 ;; agenda view on startup
170 (load-library "find-lisp")
171 (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
172 (setq org-agenda-span 90)
173 (setq org-agenda-use-time-grid nil)
174 (add-hook 'emacs-startup-hook (lambda ()
176 (switch-to-buffer "*Org Agenda*")
179 ;;; for calendar, use ISO date style
180 ;(setq calendar-date-style 'iso)
181 ;(setq diary-number-of-entries 7)
183 ;(setq org-agenda-time-grid '((today require-timed remove-match)
184 ; #("----------------" 0 16 (org-heading t))
185 ; (0 200 400 600 800 1000 1200
186 ; 1400 1600 1800 2000 2200)))
188 ;; empty org-agenda-mode keybindings
189 (add-hook 'org-agenda-mode-hook
191 (setq org-agenda-mode-map (make-sparse-keymap))))
192 (add-hook 'org-agenda-mode-hook
194 (use-local-map (make-sparse-keymap))))
197 (setq org-publish-project-alist
200 :base-directory "~/org/web/"
201 :base-extension "org"
202 :publishing-directory "~/html/"
204 :publishing-function org-html-publish-to-html
205 :headline-levels 4 ; Just the default for this project.
209 ;; use [ki:] syntax to hide stuff from exports
210 (defun classify-information (text backend info)
211 "Replaces '[ki:WHATEVER]' with '[klassifizierte Information]'."
212 (replace-regexp-in-string "\\[ki:[^\]]*\]" "[klassifizierte Information]" text))
213 (add-hook 'org-export-filter-plain-text-functions 'classify-information)
215 ;; add HTML validator link to exports
216 (setq org-html-validation-link "<a href=\"https://validator.w3.org/check?uri=referer\">Validate</a>")
222 (load "~/public_repos/plomvi.el/plomvi.el")
223 (global-set-key (kbd "C-c") 'plomvi-activate)
224 (plomvi-global-mode 1)
231 (setq Info-mode-map (make-sparse-keymap))
232 (define-key Info-mode-map (kbd "RET") 'Info-follow-nearest-node)
233 (define-key Info-mode-map (kbd "u") 'Info-up)
234 (define-key Info-mode-map (kbd "TAB") 'Info-next-reference)
235 (define-key Info-mode-map (kbd "<backtab>") 'Info-prev-reference)
236 (define-key Info-mode-map (kbd "H") 'Info-history-back)
237 (define-key Info-mode-map (kbd "L") 'Info-history-forward)
238 (define-key Info-mode-map (kbd "I") 'Info-goto-node)
239 (define-key Info-mode-map (kbd "i") 'Info-index)
246 (setq help-mode-map (make-sparse-keymap))
247 (define-key help-mode-map (kbd "TAB") 'forward-button)
248 (define-key help-mode-map (kbd "RET") 'help-follow)
249 (define-key help-mode-map (kbd "<backtab>") 'backward-button)
256 (require 'elfeed) ; needed so we can set the font faces
257 (set-face-background 'elfeed-search-title-face "magenta")
258 (set-face-background 'elfeed-search-unread-count-face "magenta")
260 '("https://capsurvival.blogspot.com/feeds/posts/default"
261 "https://jungle.world/rss.xml"
262 "http://news.dieweltistgarnichtso.net/bin/index.xml"
263 "https://taz.de/!s=&ExportStatus=Intern&SuchRahmen=Online;rss/"
264 "http://www.tagesschau.de/xml/atom"))
265 (setq elfeed-search-mode-map (make-sparse-keymap))
266 (define-key elfeed-search-mode-map (kbd "RET") 'elfeed-search-show-entry)
267 (defun elfeed-search-mark-as-read() (interactive)
268 (elfeed-search-untag-all 'unread))
269 (define-key elfeed-search-mode-map (kbd "r") 'elfeed-search-mark-as-read)
270 (define-key elfeed-search-mode-map (kbd "R") 'elfeed-search-tag-all-unread)
271 (define-key elfeed-search-mode-map (kbd "f") 'elfeed-search-live-filter)
272 (define-key elfeed-search-mode-map (kbd "u") 'elfeed-update)
273 (setq elfeed-show-mode-map (make-sparse-keymap))
274 (define-key elfeed-show-mode-map (kbd "u") 'elfeed)
275 (define-key elfeed-show-mode-map (kbd "TAB") 'shr-next-link)
276 (define-key elfeed-show-mode-map (kbd "<backtab>") 'shr-previous-link)
277 (define-key elfeed-show-mode-map (kbd "a") 'elfeed-show-prev)
278 (define-key elfeed-show-mode-map (kbd "d") 'elfeed-show-next)
279 (define-key elfeed-show-mode-map (kbd "y") 'shr-copy-url)
280 (define-key elfeed-show-mode-map (kbd "RET") 'shr-browse-url)
287 (setq eww-mode-map (make-sparse-keymap))
288 (define-key eww-mode-map (kbd "TAB") 'shr-next-link)
289 (define-key eww-mode-map (kbd "<backtab>") 'shr-previous-link)
290 (define-key eww-mode-map (kbd "H") 'eww-back-url)
291 (define-key eww-mode-map (kbd "L") 'eww-forward-url)
297 (setq ledger-mode-map (make-sparse-keymap))
298 (define-key ledger-mode-map (kbd "TAB") 'ledger-magic-tab)
302 ;; unset other maps so they don't disturb C-c keybinding
303 ;; =====================================================
304 ;; TODO: saner solution would be a default-activated minor mode that binds
306 (setq conf-mode-map (make-sparse-keymap))
307 (setq sh-mode-map (make-sparse-keymap))
308 (setq python-mode-map (make-sparse-keymap))