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")
145 ;; unsure why, but to re-set the key map, we not only have to explicitely do it
146 ;; only after org-mode loading, but also have to explicitely overwrite the
147 ;; C-c keybinding; TODO: investigate
148 (with-eval-after-load 'org
149 (setq org-mode-map (make-sparse-keymap))
150 (define-key org-mode-map (kbd "C-c") nil)
151 (define-key org-mode-map (kbd "TAB") 'org-cycle)
152 (define-key org-mode-map (kbd "<backtab>") 'org-shifttab))
154 ;; basic org-capture config
155 (setq org-capture-templates
156 '(("x" "test" plain (file "~/org/notes.org") "%T: %?")))
157 (add-hook 'org-capture-mode-hook 'evil-insert-state)
159 ;; agenda view on startup
160 (load-library "find-lisp")
161 (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
162 (setq org-agenda-span 90)
163 (setq org-agenda-use-time-grid nil)
164 (add-hook 'emacs-startup-hook (lambda ()
166 (switch-to-buffer "*Org Agenda*")
169 ;;; for calendar, use ISO date style
170 ;(setq calendar-date-style 'iso)
171 ;(setq diary-number-of-entries 7)
173 ;(setq org-agenda-time-grid '((today require-timed remove-match)
174 ; #("----------------" 0 16 (org-heading t))
175 ; (0 200 400 600 800 1000 1200
176 ; 1400 1600 1800 2000 2200)))
178 ;; empty org-agenda-mode keybindings
179 (add-hook 'org-agenda-mode-hook
181 (setq org-agenda-mode-map (make-sparse-keymap))))
182 (add-hook 'org-agenda-mode-hook
184 (use-local-map (make-sparse-keymap))))
187 (setq org-publish-project-alist
190 :base-directory "~/org/web/"
191 :base-extension "org"
192 :publishing-directory "~/html/"
194 :publishing-function org-html-publish-to-html
195 :headline-levels 4 ; Just the default for this project.
199 ;; use [ki:] syntax to hide stuff from exports
200 (defun classify-information (text backend info)
201 "Replaces '[ki:WHATEVER]' with '[klassifizierte Information]'."
202 (replace-regexp-in-string "\\[ki:[^\]]*\]" "[klassifizierte Information]" text))
203 (add-hook 'org-export-filter-plain-text-functions 'classify-information)
205 ;; add HTML validator link to exports
206 (setq org-html-validation-link "<a href=\"https://validator.w3.org/check?uri=referer\">Validate</a>")
212 (load "~/public_repos/plomvi.el/plomvi.el")
213 (global-set-key (kbd "C-c") 'plomvi-activate)
214 (plomvi-global-mode 1)
221 (setq Info-mode-map (make-sparse-keymap))
222 (define-key Info-mode-map (kbd "RET") 'Info-follow-nearest-node)
223 (define-key Info-mode-map (kbd "u") 'Info-up)
224 (define-key Info-mode-map (kbd "TAB") 'Info-next-reference)
225 (define-key Info-mode-map (kbd "<backtab>") 'Info-prev-reference)
226 (define-key Info-mode-map (kbd "H") 'Info-history-back)
227 (define-key Info-mode-map (kbd "L") 'Info-history-forward)
228 (define-key Info-mode-map (kbd "I") 'Info-goto-node)
229 (define-key Info-mode-map (kbd "i") 'Info-index)
234 (setq help-mode-map (make-sparse-keymap))
235 (define-key help-mode-map (kbd "TAB") 'forward-button)
236 (define-key help-mode-map (kbd "RET") 'help-follow)
237 (define-key help-mode-map (kbd "<backtab>") 'backward-button)
242 (require 'elfeed) ; needed so we can set the font faces
243 (set-face-background 'elfeed-search-title-face "magenta")
244 (set-face-background 'elfeed-search-unread-count-face "magenta")
246 '("https://capsurvival.blogspot.com/feeds/posts/default"
247 "https://jungle.world/rss.xml"
248 "http://news.dieweltistgarnichtso.net/bin/index.xml"
249 "https://taz.de/!s=&ExportStatus=Intern&SuchRahmen=Online;rss/"
250 "http://www.tagesschau.de/xml/atom"))
251 (setq elfeed-search-mode-map (make-sparse-keymap))
252 (define-key elfeed-search-mode-map (kbd "RET") 'elfeed-search-show-entry)
253 (defun elfeed-search-mark-as-read() (interactive)
254 (elfeed-search-untag-all 'unread))
255 (define-key elfeed-search-mode-map (kbd "r") 'elfeed-search-mark-as-read)
256 (define-key elfeed-search-mode-map (kbd "R") 'elfeed-search-tag-all-unread)
257 (define-key elfeed-search-mode-map (kbd "f") 'elfeed-search-live-filter)
258 (define-key elfeed-search-mode-map (kbd "u") 'elfeed-update)
259 (setq elfeed-show-mode-map (make-sparse-keymap))
260 (define-key elfeed-show-mode-map (kbd "u") 'elfeed)
261 (define-key elfeed-show-mode-map (kbd "TAB") 'shr-next-link)
262 (define-key elfeed-show-mode-map (kbd "<backtab>") 'shr-previous-link)
263 (define-key elfeed-show-mode-map (kbd "a") 'elfeed-show-prev)
264 (define-key elfeed-show-mode-map (kbd "d") 'elfeed-show-next)
265 (define-key elfeed-show-mode-map (kbd "y") 'shr-copy-url)
266 (define-key elfeed-show-mode-map (kbd "RET") 'shr-browse-url)
271 (setq eww-mode-map (make-sparse-keymap))
272 (define-key eww-mode-map (kbd "TAB") 'shr-next-link)
273 (define-key eww-mode-map (kbd "<backtab>") 'shr-previous-link)
274 (define-key eww-mode-map (kbd "H") 'eww-back-url)
275 (define-key eww-mode-map (kbd "L") 'eww-forward-url)
279 (setq ledger-mode-map (make-sparse-keymap))
280 (define-key ledger-mode-map (kbd "TAB") 'ledger-magic-tab)
283 ;; unset other maps so they don't disturb C-c keybinding
284 ;; =====================================================
285 ;; TODO: saner solution would be a default-activated minor mode that binds
287 (setq conf-mode-map (make-sparse-keymap))
288 (setq sh-mode-map (make-sparse-keymap))
289 (setq python-mode-map (make-sparse-keymap))