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
97 ;; where we get packages from
98 (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
99 ("melpa-unstable" . "https://melpa.org/packages/")
100 ("melpa-stable" . "https://stable.melpa.org/packages/")))
102 ;; ensure certain packages are installed (actually, we use Debian repos here)
103 ;; credit to <https://stackoverflow.com/a/10093312>
104 ;(setq package-list '(elfeed ledger-mode))
105 ;(package-initialize)
106 ;(dolist (package package-list)
107 ; (unless (package-installed-p package)
108 ; (package-install package)))
112 ;;; window management
113 ;;; =================
115 ;;; track window configurations to allow window config undo
123 (setq send-mail-function 'smtpmail-send-it)
124 (setq smtpmail-smtp-server "core.plomlompom.com")
125 (setq smtpmail-smtp-service 465)
126 (setq smtpmail-stream-type 'ssl)
127 (setq smtpmail-smtp-user "plom")
128 (setq mml-secure-openpgp-encrypt-to-self t)
129 (add-hook 'message-setup-hook 'mml-secure-sign-pgpmime)
131 ;; constructs From: domain if mail composer directly called (from without
132 ;; notmuch), but we don't actually intend to do that
133 ;(setq mail-host-address "plomlompom.com")
135 ;; otherwise notmuch becomes extremely slow in some cases
136 (setq-default notmuch-show-indent-content nil)
138 ;; this only works if we use notmuch-mua-send instead of message-send
139 (setq notmuch-fcc-dirs '(("plom@plomlompom.com" . "maildir/Sent")))
141 ;; this gets rid of "i-did-not-set--mail-host-address--so-tickle-me"
143 (setq mail-host-address "plomlompom.com")
145 ;; notmuch saved searches
146 (setq notmuch-saved-searches
147 '((:name "inbox" :query "tag:unread and folder:inbox")
148 (:name "all" :query "tag:unread not folder:maildir/Trash")
149 (:name "plomlompom.de" :query "tag:unread and folder:maildir/plomlompom.de")
150 (:name "nebenan" :query "tag:unread and folder:maildir/nebenan")
151 (:name "reflect-info" :query "tag:unread and folder:maildir/reflect-info")
152 (:name "gmail" :query "tag:unread and folder:maildir/gmail.com")
153 (:name "mutter" :query "tag:unread and folder:maildir/mutter")))
160 ;; unsure why, but to re-set the key map, we not only have to explicitely do it
161 ;; only after org-mode loading, but also have to explicitely overwrite the
162 ;; C-c keybinding; TODO: investigate
163 (with-eval-after-load 'org
164 (setq org-mode-map (make-sparse-keymap))
165 (define-key org-mode-map (kbd "C-c") nil)
166 (define-key org-mode-map (kbd "TAB") 'org-cycle)
167 (define-key org-mode-map (kbd "<backtab>") 'org-shifttab))
169 ;; basic org-capture config
170 (setq org-capture-templates
171 '(("x" "test" plain (file "~/org/notes.org") "%T: %?")))
172 (add-hook 'org-capture-mode-hook 'evil-insert-state)
174 ;; agenda view on startup
175 (load-library "find-lisp")
176 (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
177 (setq org-agenda-span 90)
178 (setq org-agenda-use-time-grid nil)
179 (add-hook 'emacs-startup-hook (lambda ()
181 (switch-to-buffer "*Org Agenda*")
184 ;;; for calendar, use ISO date style
185 ;(setq calendar-date-style 'iso)
186 ;(setq diary-number-of-entries 7)
188 ;(setq org-agenda-time-grid '((today require-timed remove-match)
189 ; #("----------------" 0 16 (org-heading t))
190 ; (0 200 400 600 800 1000 1200
191 ; 1400 1600 1800 2000 2200)))
193 ;; empty org-agenda-mode keybindings
194 (add-hook 'org-agenda-mode-hook
196 (setq org-agenda-mode-map (make-sparse-keymap))))
197 (add-hook 'org-agenda-mode-hook
199 (use-local-map (make-sparse-keymap))))
202 (setq org-publish-project-alist
205 :base-directory "~/org/web/"
206 :base-extension "org"
207 :publishing-directory "~/html/"
209 :publishing-function org-html-publish-to-html
210 :headline-levels 4 ; Just the default for this project.
214 ;; use [ki:] syntax to hide stuff from exports
215 (defun classify-information (text backend info)
216 "Replaces '[ki:WHATEVER]' with '[klassifizierte Information]'."
217 (replace-regexp-in-string "\\[ki:[^\]]*\]" "[klassifizierte Information]" text))
218 (add-hook 'org-export-filter-plain-text-functions 'classify-information)
220 ;; add HTML validator link to exports
221 (setq org-html-validation-link "<a href=\"https://validator.w3.org/check?uri=referer\">Validate</a>")
228 (setq Info-mode-map (make-sparse-keymap))
229 (define-key Info-mode-map (kbd "RET") 'Info-follow-nearest-node)
230 (define-key Info-mode-map (kbd "u") 'Info-up)
231 (define-key Info-mode-map (kbd "TAB") 'Info-next-reference)
232 (define-key Info-mode-map (kbd "<backtab>") 'Info-prev-reference)
233 (define-key Info-mode-map (kbd "H") 'Info-history-back)
234 (define-key Info-mode-map (kbd "L") 'Info-history-forward)
235 (define-key Info-mode-map (kbd "I") 'Info-goto-node)
236 (define-key Info-mode-map (kbd "i") 'Info-index)
243 (setq help-mode-map (make-sparse-keymap))
244 (define-key help-mode-map (kbd "TAB") 'forward-button)
245 (define-key help-mode-map (kbd "RET") 'help-follow)
246 (define-key help-mode-map (kbd "<backtab>") 'backward-button)
253 (require 'elfeed) ; needed so we can set the font faces
254 (set-face-background 'elfeed-search-title-face "magenta")
255 (set-face-background 'elfeed-search-unread-count-face "magenta")
257 '("https://capsurvival.blogspot.com/feeds/posts/default"
258 "https://jungle.world/rss.xml"
259 "http://news.dieweltistgarnichtso.net/bin/index.xml"
260 "https://taz.de/!s=&ExportStatus=Intern&SuchRahmen=Online;rss/"
261 "http://www.tagesschau.de/xml/atom"))
262 (setq elfeed-search-mode-map (make-sparse-keymap))
263 (define-key elfeed-search-mode-map (kbd "RET") 'elfeed-search-show-entry)
264 (defun elfeed-search-mark-as-read() (interactive)
265 (elfeed-search-untag-all 'unread))
266 (define-key elfeed-search-mode-map (kbd "r") 'elfeed-search-mark-as-read)
267 (define-key elfeed-search-mode-map (kbd "R") 'elfeed-search-tag-all-unread)
268 (define-key elfeed-search-mode-map (kbd "f") 'elfeed-search-live-filter)
269 (define-key elfeed-search-mode-map (kbd "u") 'elfeed-update)
270 (setq elfeed-show-mode-map (make-sparse-keymap))
271 (define-key elfeed-show-mode-map (kbd "u") 'elfeed)
272 (define-key elfeed-show-mode-map (kbd "TAB") 'shr-next-link)
273 (define-key elfeed-show-mode-map (kbd "<backtab>") 'shr-previous-link)
274 (define-key elfeed-show-mode-map (kbd "a") 'elfeed-show-prev)
275 (define-key elfeed-show-mode-map (kbd "d") 'elfeed-show-next)
276 (define-key elfeed-show-mode-map (kbd "y") 'shr-copy-url)
277 (define-key elfeed-show-mode-map (kbd "RET") 'shr-browse-url)
284 (setq eww-mode-map (make-sparse-keymap))
285 (define-key eww-mode-map (kbd "TAB") 'shr-next-link)
286 (define-key eww-mode-map (kbd "<backtab>") 'shr-previous-link)
287 (define-key eww-mode-map (kbd "H") 'eww-back-url)
288 (define-key eww-mode-map (kbd "L") 'eww-forward-url)
294 (setq ledger-mode-map (make-sparse-keymap))
295 (define-key ledger-mode-map (kbd "TAB") 'ledger-magic-tab)
302 (defvar plomvi-return-combo (kbd "C-c"))
303 (load "~/public_repos/plomvi.el/plomvi.el")
304 (plomvi-global-mode 1)