2017-12-03 09:19:05 +01:00
|
|
|
|
;;; Init.el --- Daniel's Emacs Configuration -*- lexical-binding: t -*-
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
2017-11-11 11:44:20 +01:00
|
|
|
|
;; This is the main entry point for Emacs to load this configuration. The
|
|
|
|
|
;; structure is roughly as follows:
|
2022-03-18 17:05:23 +01:00
|
|
|
|
;; - first comes some preliminary setup, mostly setting up `package’;
|
|
|
|
|
;; - the main activation of the configuration is done in the function
|
2017-11-11 11:44:20 +01:00
|
|
|
|
;; `db/run-init’, which is installed in `after-init-hook’; it is thus run
|
|
|
|
|
;; after init.el has been read
|
2022-03-18 17:05:23 +01:00
|
|
|
|
;; - then comes setting up all the packages that can be used by this
|
2017-11-11 11:44:20 +01:00
|
|
|
|
;; configuration; most of these packages are not loaded however, and only
|
|
|
|
|
;; configuration hooks are installed (using `use-package’); this way a user
|
2019-12-20 20:28:26 +01:00
|
|
|
|
;; can choose in `db/run-init’ which configuration to activate without
|
2017-11-11 11:44:20 +01:00
|
|
|
|
;; changing much of the rest of the file.
|
2022-03-18 17:05:23 +01:00
|
|
|
|
;; - this file also introduces a new customization group `personal-settings’
|
2017-11-12 12:35:36 +01:00
|
|
|
|
;; containing variables (mostly file paths) that must be set to enable some
|
2019-12-20 20:28:26 +01:00
|
|
|
|
;; of the provided functionality.
|
2017-11-11 11:44:20 +01:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
|
|
|
2020-09-12 13:15:27 +02:00
|
|
|
|
;; * Preliminaries (constants and path settings)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(defconst emacs-d (file-name-directory
|
|
|
|
|
(file-chase-links load-file-name))
|
|
|
|
|
"The giant turtle on which the world rests.")
|
|
|
|
|
|
2017-11-11 11:44:30 +01:00
|
|
|
|
(defconst on-windows (memq system-type '(windows-nt cygwin))
|
|
|
|
|
"Non-nil if and only if this instance of Emacs runs on Windows.")
|
|
|
|
|
|
2020-09-12 13:15:27 +02:00
|
|
|
|
(setq custom-file (expand-file-name "private/custom.el" emacs-d)
|
|
|
|
|
custom-theme-directory (expand-file-name "themes/" emacs-d))
|
|
|
|
|
|
|
|
|
|
(add-to-list 'load-path (expand-file-name "site-lisp" emacs-d))
|
|
|
|
|
|
|
|
|
|
;; Ensure that ~/.emacs.d/private exists, because we want to store data there
|
|
|
|
|
(let ((private-data-dir (expand-file-name "private/" emacs-d)))
|
|
|
|
|
(unless (file-directory-p private-data-dir)
|
|
|
|
|
(make-directory private-data-dir)))
|
|
|
|
|
|
2017-11-11 11:44:30 +01:00
|
|
|
|
|
|
|
|
|
;; * Packages
|
|
|
|
|
|
2021-03-28 19:55:59 +02:00
|
|
|
|
(setq package-archives
|
|
|
|
|
'(("melpa" . "https://melpa.org/packages/")
|
|
|
|
|
("gnu" . "https://elpa.gnu.org/packages/")
|
|
|
|
|
("melpa-stable" . "https://stable.melpa.org/packages/")
|
2022-05-15 17:13:51 +02:00
|
|
|
|
("org" . "https://orgmode.org/elpa/")
|
|
|
|
|
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
|
2021-03-28 19:55:59 +02:00
|
|
|
|
|
2020-08-15 16:49:32 +02:00
|
|
|
|
(when (< emacs-major-version 27)
|
2020-08-27 15:20:24 +02:00
|
|
|
|
;; Before Emacs 27.1, we had to do package initialization ourselves. In Emacs
|
2021-03-28 19:55:59 +02:00
|
|
|
|
;; 27.1 and later, it's done directly after loading early-init.el. See
|
2020-08-15 16:53:19 +02:00
|
|
|
|
;; https://www.gnu.org/software/emacs/news/NEWS.27.1
|
2020-08-15 16:49:32 +02:00
|
|
|
|
(load-file (expand-file-name "early-init.el" emacs-d))
|
|
|
|
|
(package-initialize))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2018-01-27 17:31:50 +01:00
|
|
|
|
(eval-when-compile
|
2020-09-12 09:07:10 +02:00
|
|
|
|
(setq use-package-enable-imenu-support t
|
2020-09-12 11:32:39 +02:00
|
|
|
|
use-package-always-defer t
|
|
|
|
|
use-package-verbose t
|
|
|
|
|
use-package-minimum-reported-time 0.01)
|
2020-09-11 16:47:28 +02:00
|
|
|
|
|
2020-08-11 17:38:23 +02:00
|
|
|
|
(dolist (package '(bind-key use-package))
|
2018-01-27 17:31:50 +01:00
|
|
|
|
(unless (package-installed-p package)
|
|
|
|
|
(package-install package))
|
|
|
|
|
(require package)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2019-12-21 19:01:25 +01:00
|
|
|
|
(add-to-list 'package-pinned-packages '(use-package . "melpa-stable"))
|
|
|
|
|
(add-to-list 'package-pinned-packages '(bind-key . "melpa-stable"))
|
2019-12-21 18:52:50 +01:00
|
|
|
|
|
2017-12-15 21:45:12 +01:00
|
|
|
|
(put 'use-package 'lisp-indent-function 1)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; * Mode activation
|
|
|
|
|
|
|
|
|
|
(defun db/run-init ()
|
|
|
|
|
"Run main initialization after everything is set up."
|
|
|
|
|
|
2018-11-03 16:18:00 +01:00
|
|
|
|
(message "Running main initialization ...")
|
2018-11-03 16:06:05 +01:00
|
|
|
|
|
2017-09-13 19:56:12 +02:00
|
|
|
|
;; Activate modes (builtin)
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(show-paren-mode 1)
|
|
|
|
|
(transient-mark-mode 1)
|
|
|
|
|
(global-font-lock-mode 1)
|
|
|
|
|
(column-number-mode 1)
|
|
|
|
|
;; (display-time)
|
|
|
|
|
(delete-selection-mode 1)
|
|
|
|
|
|
|
|
|
|
(dolist (mode '(tool-bar-mode
|
|
|
|
|
scroll-bar-mode
|
|
|
|
|
menu-bar-mode
|
2018-03-25 21:03:14 +02:00
|
|
|
|
blink-cursor-mode
|
|
|
|
|
tooltip-mode))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(when (fboundp mode)
|
|
|
|
|
(funcall mode 0)))
|
|
|
|
|
|
|
|
|
|
(when (<= 24 emacs-major-version)
|
|
|
|
|
(electric-indent-mode -1))
|
|
|
|
|
|
|
|
|
|
(appt-activate +1)
|
|
|
|
|
(savehist-mode 1)
|
|
|
|
|
|
|
|
|
|
(size-indication-mode 1)
|
|
|
|
|
(display-battery-mode -1)
|
|
|
|
|
|
2017-09-13 19:56:12 +02:00
|
|
|
|
(electric-pair-mode +1)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(recentf-mode t)
|
|
|
|
|
(winner-mode 1)
|
|
|
|
|
(global-auto-revert-mode -1)
|
|
|
|
|
(which-function-mode +1)
|
2019-02-09 14:05:29 +01:00
|
|
|
|
(global-eldoc-mode +1)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2017-09-13 19:56:12 +02:00
|
|
|
|
;; Activate modes (packages)
|
|
|
|
|
|
|
|
|
|
(dolist (mode '(global-undo-tree-mode
|
|
|
|
|
ace-window-display-mode
|
|
|
|
|
key-chord-mode
|
|
|
|
|
ivy-mode
|
2019-04-14 13:44:39 +02:00
|
|
|
|
minions-mode
|
2018-11-02 20:57:34 +01:00
|
|
|
|
which-key-mode
|
2019-12-20 17:34:05 +01:00
|
|
|
|
projectile-mode
|
2019-12-20 17:39:13 +01:00
|
|
|
|
yas-global-mode
|
2021-05-30 10:39:09 +02:00
|
|
|
|
global-git-commit-mode))
|
2018-08-01 16:19:54 +02:00
|
|
|
|
(with-demoted-errors "Cannot activate mode: %s"
|
2017-10-28 19:34:58 +02:00
|
|
|
|
(funcall mode +1)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2021-11-08 19:15:12 +01:00
|
|
|
|
;; This causes inacceptable lack when drawing buffers, so disable it for now.
|
|
|
|
|
;; Needs to be investigated further.
|
|
|
|
|
|
|
|
|
|
;; (with-demoted-errors "Cannot activate moody: %s"
|
|
|
|
|
;; (moody-replace-mode-line-buffer-identification)
|
|
|
|
|
;; (moody-replace-vc-mode))
|
2019-04-14 14:06:10 +02:00
|
|
|
|
|
2019-11-11 18:29:17 +01:00
|
|
|
|
(with-demoted-errors "Cannot activate `vlf': %s"
|
|
|
|
|
(require 'vlf-setup))
|
|
|
|
|
|
2020-08-27 11:49:42 +02:00
|
|
|
|
;; Explicitly require helm, because autoloading is difficult with helm's
|
|
|
|
|
;; separate `helm-command-prefix-key' mechanism.
|
|
|
|
|
(require 'helm)
|
|
|
|
|
|
2020-08-28 20:12:29 +02:00
|
|
|
|
(when (package-installed-p 'org-roam)
|
2021-09-04 14:46:43 +02:00
|
|
|
|
(org-roam-db-autosync-mode))
|
2020-08-28 20:12:29 +02:00
|
|
|
|
|
2017-09-15 16:27:56 +02:00
|
|
|
|
;; Global Hooks
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2018-01-27 17:48:27 +01:00
|
|
|
|
(add-hook 'minibuffer-setup-hook 'cursor-intangible-mode)
|
|
|
|
|
(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
|
|
|
|
|
(add-hook 'prog-mode-hook 'page-break-lines-mode)
|
2020-09-12 11:32:52 +02:00
|
|
|
|
(add-hook 'prog-mode-hook 'subword-mode)
|
2021-09-30 15:08:14 +02:00
|
|
|
|
(add-hook 'prog-mode-hook 'hl-line-mode)
|
2019-03-02 11:14:37 +01:00
|
|
|
|
(add-hook 'lisp-mode-hook 'turn-on-lispy-when-available)
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(when (<= 24 emacs-major-version)
|
2018-01-27 17:48:27 +01:00
|
|
|
|
(add-hook 'prog-mode-hook 'electric-indent-local-mode))
|
2019-03-02 11:14:37 +01:00
|
|
|
|
|
2019-03-02 11:15:28 +01:00
|
|
|
|
(add-hook 'text-mode-hook 'turn-on-auto-fill)
|
2020-02-20 21:08:53 +01:00
|
|
|
|
(add-hook 'text-mode-hook 'abbrev-mode)
|
2021-09-30 15:08:14 +02:00
|
|
|
|
(add-hook 'text-mode-hook 'hl-line-mode)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2017-11-11 12:03:39 +01:00
|
|
|
|
;; Auto-Modes
|
|
|
|
|
|
|
|
|
|
(dolist (mode-spec '(("\\.clj\\'" . clojure-mode)
|
|
|
|
|
("\\.cl\\'" . lisp-mode)
|
|
|
|
|
("\\.lisp\\'" . lisp-mode)
|
|
|
|
|
("\\.plx\\’" . cperl-mode)
|
|
|
|
|
("\\.hs\\'" . haskell-mode)
|
|
|
|
|
("\\.lhs\\'" . haskell-mode)
|
|
|
|
|
("\\.md\\'" . markdown-mode)
|
|
|
|
|
("\\.html\\'" . nxml-mode)
|
|
|
|
|
("\\.xml\\'" . nxml-mode)))
|
|
|
|
|
(add-to-list 'auto-mode-alist mode-spec))
|
|
|
|
|
|
2017-08-04 17:49:43 +02:00
|
|
|
|
;; Top-Level Keybindings
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(bind-key "<XF86Back>" #'winner-undo)
|
|
|
|
|
(bind-key "<XF86Forward>" #'winner-redo)
|
2021-05-01 20:27:34 +02:00
|
|
|
|
(bind-key "<Scroll_Lock>" 'scroll-lock-mode)
|
2020-09-12 08:52:02 +02:00
|
|
|
|
(bind-key "<f10>" #'magit-status)
|
2020-07-31 16:22:09 +02:00
|
|
|
|
(bind-key "<f1>" #'db/run-or-hide-eshell)
|
2020-07-01 21:28:55 +02:00
|
|
|
|
(bind-key "<f2>" #'hydra-feature-shortcuts/body)
|
2021-09-11 09:32:05 +02:00
|
|
|
|
(bind-key "<f5>" #'rgrep)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "<f6>" #'hydra-zoom/body)
|
|
|
|
|
(bind-key "<f7>" #'dictcc)
|
2020-09-12 11:14:37 +02:00
|
|
|
|
(bind-key "<f8>" #'bm-toggle)
|
2021-03-20 15:45:49 +01:00
|
|
|
|
(bind-key "<f9>" #'hydra-org-linking/body)
|
2020-09-12 11:14:37 +02:00
|
|
|
|
(bind-key "<C-f8>" #'bm-next)
|
|
|
|
|
(bind-key "<C-S-f8>" #'bm-previous)
|
2020-09-12 08:52:02 +02:00
|
|
|
|
(bind-key "C-," #'mc/skip-to-previous-like-this)
|
|
|
|
|
(bind-key "C-." #'mc/skip-to-next-like-this)
|
2017-09-29 21:25:41 +02:00
|
|
|
|
(bind-key "C-;" #'iedit-mode)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "C-<" #'mc/mark-previous-like-this)
|
|
|
|
|
(bind-key "C->" #'mc/mark-next-like-this)
|
|
|
|
|
(bind-key "C-@" #'er/expand-region)
|
|
|
|
|
(bind-key "C-M-\\" #'crux-cleanup-buffer-or-region)
|
|
|
|
|
(bind-key "C-S-c C-S-c" #'mc/edit-lines)
|
|
|
|
|
(bind-key "C-Z" #'undo-tree-redo)
|
|
|
|
|
(bind-key "C-c C-<" #'mc/mark-all-like-this)
|
|
|
|
|
(bind-key "C-c C-r" #'ivy-resume)
|
|
|
|
|
(bind-key "C-c D" #'define-word)
|
|
|
|
|
(bind-key "C-c J" #'avy-goto-word-or-subword-1)
|
|
|
|
|
(bind-key "C-c a" #'org-agenda)
|
|
|
|
|
(bind-key "C-c c" #'org-capture)
|
|
|
|
|
(bind-key "C-c d" #'define-word-at-point)
|
|
|
|
|
(bind-key "C-c e" #'crux-eval-and-replace)
|
2019-04-11 09:03:37 +02:00
|
|
|
|
(bind-key "C-c i" #'ispell-change-dictionary)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "C-c j" #'avy-goto-char-timer)
|
|
|
|
|
(bind-key "C-c l" #'org-store-link)
|
2020-06-27 10:16:53 +02:00
|
|
|
|
(bind-key "C-c m" #'music-control/body)
|
2021-09-04 14:53:58 +02:00
|
|
|
|
(bind-key "C-c n f" #'org-roam-node-find)
|
|
|
|
|
(bind-key "C-c n i" #'org-roam-node-insert)
|
|
|
|
|
(bind-key "C-c n c" #'org-roam-capture)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "C-c o" #'hydra-org-clock/body)
|
|
|
|
|
(bind-key "C-c s" #'synonyms)
|
2020-11-28 09:22:17 +01:00
|
|
|
|
(bind-key "C-c t" #'hydra-toggle/body)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "C-h C-f" #'find-function)
|
|
|
|
|
(bind-key "C-h C-k" #'find-function-on-key)
|
2020-11-14 15:17:14 +01:00
|
|
|
|
(bind-key "C-h C-v" #'find-variable)
|
2020-09-12 09:20:02 +02:00
|
|
|
|
(bind-key "C-x 4 C-j" #'dired-jump-other-window)
|
2020-09-12 08:52:02 +02:00
|
|
|
|
(bind-key "C-x C-b" #'ibuffer)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "C-x C-d" #'dired)
|
2020-09-12 09:20:02 +02:00
|
|
|
|
(bind-key "C-x C-j" #'dired-jump)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "C-x C-r" #'revert-buffer)
|
|
|
|
|
(bind-key "C-x SPC" #'hydra-rectangle/body)
|
2020-09-12 08:52:02 +02:00
|
|
|
|
(bind-key "C-x g" #'db/helm-shortcuts)
|
2019-12-13 15:28:46 +01:00
|
|
|
|
(bind-key "C-x r E" #'db/bookmark-add-external)
|
2019-01-25 20:39:01 +01:00
|
|
|
|
(bind-key "C-x r M" #'db/bookmark-add-url)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "C-x r v" #'list-registers)
|
2020-09-12 08:51:35 +02:00
|
|
|
|
(bind-key "C-z" #'goto-last-change)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "M-/" #'hippie-expand)
|
|
|
|
|
(bind-key "M-:" #'pp-eval-expression)
|
|
|
|
|
(bind-key "M-=" #'count-words)
|
|
|
|
|
(bind-key "M-SPC" #'cycle-spacing)
|
|
|
|
|
(bind-key "M-Z" #'zap-to-char)
|
2020-09-12 08:52:02 +02:00
|
|
|
|
(bind-key "M-i" #'swiper-from-isearch isearch-mode-map)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "M-j" #'(lambda () (interactive) (join-line -1)))
|
|
|
|
|
(bind-key "M-z" #'zap-up-to-char)
|
2020-09-12 08:52:02 +02:00
|
|
|
|
(bind-key [remap fill-paragraph] #'endless/fill-or-unfill)
|
|
|
|
|
(bind-key [remap keyboard-quit] #'keyboard-quit-context+)
|
2020-06-20 12:05:23 +02:00
|
|
|
|
(unbind-key "<insert>" global-map)
|
|
|
|
|
(unbind-key "<kp-insert>" global-map)
|
2020-06-20 12:01:19 +02:00
|
|
|
|
(unbind-key "C-x C-c" global-map)
|
2020-09-12 08:52:02 +02:00
|
|
|
|
(unbind-key "M-o" global-map)
|
2017-09-14 19:35:50 +02:00
|
|
|
|
|
|
|
|
|
;; Overwrite certain keybindings only if packages are avilable
|
|
|
|
|
|
|
|
|
|
(when (package-installed-p 'counsel)
|
2017-09-15 17:53:59 +02:00
|
|
|
|
(bind-key "M-x" #'counsel-M-x) ; gets nicer sorting with smex installed
|
2017-09-14 19:35:50 +02:00
|
|
|
|
(bind-key "C-c r" #'counsel-recentf)
|
|
|
|
|
(bind-key "C-x C-f" #'counsel-find-file)
|
|
|
|
|
(bind-key "C-h f" #'counsel-describe-function)
|
|
|
|
|
(bind-key "C-h v" #'counsel-describe-variable)
|
2020-01-03 10:24:15 +01:00
|
|
|
|
(bind-key "C-h b" #'counsel-descbinds)
|
2020-12-07 18:42:41 +01:00
|
|
|
|
(bind-key "C-S-s" #'counsel-grep-or-swiper))
|
2017-09-14 19:35:50 +02:00
|
|
|
|
|
|
|
|
|
(when (package-installed-p 'helm)
|
2018-11-03 08:40:35 +01:00
|
|
|
|
(bind-key "M-y" #'helm-show-kill-ring))
|
2017-09-14 19:35:50 +02:00
|
|
|
|
|
|
|
|
|
(when (package-installed-p 'crux)
|
|
|
|
|
(bind-key [remap kill-whole-line] #'crux-kill-whole-line)
|
|
|
|
|
(bind-key [remap open-line] #'crux-smart-open-line-above))
|
|
|
|
|
|
|
|
|
|
(when (package-installed-p 'ace-window)
|
|
|
|
|
(bind-key "C-x o" #'ace-window))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2019-03-02 09:45:31 +01:00
|
|
|
|
(when (package-installed-p 'avy)
|
|
|
|
|
(bind-key "M-g M-g" #'avy-goto-line)
|
|
|
|
|
(bind-key "M-g g" #'avy-goto-line))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
;; Environment Variables
|
|
|
|
|
|
2017-11-11 09:06:41 +01:00
|
|
|
|
(unless on-windows
|
2018-08-01 16:19:54 +02:00
|
|
|
|
(with-demoted-errors "Cannot import environment variables: %s"
|
2017-10-30 20:05:54 +01:00
|
|
|
|
(exec-path-from-shell-copy-envs '("SSH_AUTH_SOCK"
|
|
|
|
|
"SSH_AGENT_PID"
|
|
|
|
|
"PATH"
|
|
|
|
|
"TEXMFHOME"
|
|
|
|
|
"PERL5LIB"
|
|
|
|
|
"PERL_LOCAL_LIB_ROOT"
|
|
|
|
|
"PERL_MB_OPT"
|
|
|
|
|
"PERL_MM_OPT"))))
|
2017-08-12 10:53:17 +02:00
|
|
|
|
|
2018-01-12 20:52:24 +01:00
|
|
|
|
;; Start Server when not running already
|
2017-09-15 13:40:10 +02:00
|
|
|
|
|
2020-09-02 11:53:07 +02:00
|
|
|
|
;; The following condition should actually always be false, since we have
|
|
|
|
|
;; neither loaded the server package yet nor have explicitly started the
|
|
|
|
|
;; server process. Also the --daemon command line switches will start the
|
|
|
|
|
;; server only later, after initialization (and they do so unconditionally,
|
|
|
|
|
;; thus restarting the server we have started here). However, for robustness,
|
|
|
|
|
;; we keep the condition nevertheless, since when a server process is already
|
|
|
|
|
;; present, we really don't have to do anything. Furthermore, calling
|
|
|
|
|
;; `db/run-init' again in a running Emacs will not restart the server (but
|
|
|
|
|
;; then, why whould one want to do this?).
|
2020-09-02 15:04:54 +02:00
|
|
|
|
(if (and (boundp 'server-process) server-process)
|
|
|
|
|
(message "Server already running, not restarting.")
|
2020-09-02 11:12:24 +02:00
|
|
|
|
|
2020-09-02 15:04:54 +02:00
|
|
|
|
(require 'server)
|
2020-09-02 11:12:24 +02:00
|
|
|
|
(let ((server-file (expand-file-name server-name
|
|
|
|
|
(if server-use-tcp server-auth-dir server-socket-dir))))
|
|
|
|
|
(if (file-exists-p server-file)
|
|
|
|
|
(warn "Server file already exists, but no server process is running. Check %s and restart server manually."
|
|
|
|
|
server-file)
|
|
|
|
|
|
|
|
|
|
(server-start)
|
2021-01-16 14:34:48 +01:00
|
|
|
|
(cl-ecase (server-running-p)
|
2020-09-02 11:12:24 +02:00
|
|
|
|
((t) t) ; server is running
|
|
|
|
|
(nil (warn "Server not running, check logs and restart manually."))
|
|
|
|
|
(t (warn "`server-running-p' returned neither nil nor t. Check and restart server manually if required."))))))
|
2017-09-15 13:40:10 +02:00
|
|
|
|
|
2019-12-13 16:07:36 +01:00
|
|
|
|
;; Load custom code
|
|
|
|
|
|
|
|
|
|
(dolist (file db/after-init-load-files)
|
|
|
|
|
(message "Loading %s" file)
|
|
|
|
|
(with-demoted-errors "Error loading file: %s"
|
|
|
|
|
(load-file file)))
|
|
|
|
|
|
2018-11-03 16:18:00 +01:00
|
|
|
|
;; Finish
|
|
|
|
|
|
2018-11-03 16:06:05 +01:00
|
|
|
|
(message "Running main initialization ... done")
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
t)
|
|
|
|
|
|
|
|
|
|
(add-hook 'after-init-hook #'db/run-init)
|
|
|
|
|
|
|
|
|
|
|
2017-10-17 22:21:28 +02:00
|
|
|
|
;; * Personal customization
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2020-01-11 12:35:53 +01:00
|
|
|
|
(use-package db-customize
|
2020-09-12 10:35:05 +02:00
|
|
|
|
:demand t
|
2020-01-11 12:35:53 +01:00
|
|
|
|
:defines (db/jabber-id
|
|
|
|
|
db/important-documents-path
|
|
|
|
|
db/path-to-onenote
|
|
|
|
|
db/path-to-outlook
|
2020-06-26 22:07:39 +02:00
|
|
|
|
db/cert-file-directory
|
|
|
|
|
org-working-task-id
|
|
|
|
|
org-break-task-id
|
|
|
|
|
org-home-task-id
|
|
|
|
|
db/org-clock-current-task-file
|
2020-08-27 12:16:54 +02:00
|
|
|
|
db/org-default-org-file
|
2020-06-26 22:07:39 +02:00
|
|
|
|
db/org-default-work-file
|
|
|
|
|
db/org-default-home-file
|
|
|
|
|
db/org-default-notes-file
|
|
|
|
|
db/org-default-refile-file
|
|
|
|
|
db/after-init-load-files))
|
2019-12-13 16:07:36 +01:00
|
|
|
|
|
2017-10-17 22:21:28 +02:00
|
|
|
|
|
2019-02-02 15:39:16 +01:00
|
|
|
|
;; * General configuration
|
2017-10-17 22:21:28 +02:00
|
|
|
|
|
2020-09-12 12:54:01 +02:00
|
|
|
|
(use-package cl-lib
|
|
|
|
|
:demand t)
|
|
|
|
|
|
|
|
|
|
(use-package subr-x
|
|
|
|
|
:demand t)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(set-default-coding-systems 'utf-8)
|
|
|
|
|
(prefer-coding-system 'utf-8)
|
|
|
|
|
(set-terminal-coding-system 'utf-8)
|
|
|
|
|
(set-keyboard-coding-system 'utf-8)
|
|
|
|
|
(setq buffer-file-coding-system 'utf-8)
|
|
|
|
|
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
|
|
|
|
|
|
|
|
|
|
(setq inhibit-startup-message t
|
2020-11-21 11:27:17 +01:00
|
|
|
|
inhibit-default-init t
|
2020-09-11 16:49:57 +02:00
|
|
|
|
frame-inhibit-implied-resize t
|
2017-07-16 18:07:00 +02:00
|
|
|
|
initial-scratch-message nil
|
2017-09-24 12:35:06 +02:00
|
|
|
|
initial-major-mode 'fundamental-mode
|
2017-07-16 18:07:00 +02:00
|
|
|
|
ring-bell-function #'ignore
|
|
|
|
|
garbage-collection-messages nil
|
2019-04-28 11:25:11 +02:00
|
|
|
|
load-prefer-newer nil ; t breaks `org-reload'
|
2020-12-05 20:37:10 +01:00
|
|
|
|
auth-sources '("~/.authinfo.gpg")
|
|
|
|
|
auth-source-save-behavior nil)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(fset 'yes-or-no-p 'y-or-n-p)
|
|
|
|
|
|
|
|
|
|
(setq-default fill-column 80)
|
|
|
|
|
(setq-default indent-tabs-mode nil)
|
|
|
|
|
|
|
|
|
|
(setq frame-title-format "emacs")
|
|
|
|
|
|
|
|
|
|
(setq select-enable-clipboard t
|
|
|
|
|
select-enable-primary t
|
|
|
|
|
save-interprogram-paste-before-kill t
|
|
|
|
|
mouse-yank-at-point t
|
|
|
|
|
require-final-newline nil
|
|
|
|
|
sentence-end-double-space t
|
|
|
|
|
recenter-positions '(top middle bottom)
|
|
|
|
|
scroll-conservatively 10
|
|
|
|
|
message-log-max t
|
|
|
|
|
inhibit-eol-conversion nil
|
|
|
|
|
tab-always-indent 'complete
|
2021-04-16 15:17:25 +02:00
|
|
|
|
completion-cycle-threshold 10
|
2017-07-16 18:07:00 +02:00
|
|
|
|
enable-recursive-minibuffers t
|
|
|
|
|
set-mark-command-repeat-pop t
|
2018-02-22 16:28:44 +01:00
|
|
|
|
large-file-warning-threshold 10000000
|
2017-07-16 18:07:00 +02:00
|
|
|
|
echo-keystrokes 0.1
|
|
|
|
|
delete-by-moving-to-trash t
|
|
|
|
|
delete-trailing-lines nil
|
|
|
|
|
x-underline-at-descent-line t
|
2018-11-02 18:17:51 +01:00
|
|
|
|
search-whitespace-regexp "[ \t\r\n]+"
|
2020-04-17 19:16:23 +02:00
|
|
|
|
visual-line-fringe-indicators '(left-curly-arrow right-curly-arrow)
|
|
|
|
|
history-delete-duplicates t
|
2021-04-22 15:26:26 +02:00
|
|
|
|
track-eol t
|
2022-08-04 18:49:55 +02:00
|
|
|
|
gc-cons-threshold (* 100 1024 1024) ; 100mb
|
2022-04-29 09:05:18 +02:00
|
|
|
|
read-process-output-max (* 1024 1024) ; 1mb
|
2022-08-04 18:49:55 +02:00
|
|
|
|
next-error-message-highlight t
|
|
|
|
|
help-enable-symbol-autoload t
|
|
|
|
|
describe-bindings-outline t
|
|
|
|
|
redisplay-skip-fontification-on-input t)
|
2019-01-25 21:36:22 +01:00
|
|
|
|
|
|
|
|
|
(when (memq system-type '(gnu gnu/linux gnu/kfreebsd))
|
|
|
|
|
(setq x-wait-for-event-timeout nil))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2017-11-11 09:06:41 +01:00
|
|
|
|
(when on-windows
|
2017-11-11 08:50:39 +01:00
|
|
|
|
;; treat memory for display time ... but hey, this is Windows, memory doesn’t
|
|
|
|
|
;; matter!
|
|
|
|
|
(setq inhibit-compacting-font-caches t))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
;; don't let the cursor go into minibuffer prompt
|
|
|
|
|
(setq minibuffer-prompt-properties '(read-only t
|
|
|
|
|
face minibuffer-prompt
|
|
|
|
|
cursor-intangible t))
|
|
|
|
|
|
|
|
|
|
;; Make M-v undo C-v
|
|
|
|
|
(setq scroll-preserve-screen-position 'always)
|
|
|
|
|
|
|
|
|
|
;; Backups and Autosave
|
|
|
|
|
(defvar backup-dir (expand-file-name "ebackup/" emacs-d))
|
|
|
|
|
(defvar autosave-dir (expand-file-name "eautosave/" emacs-d))
|
|
|
|
|
(setq make-backup-files t
|
|
|
|
|
backup-directory-alist (list (cons ".*" backup-dir))
|
|
|
|
|
auto-save-list-file-prefix autosave-dir
|
|
|
|
|
auto-save-file-name-transforms `((".*" ,autosave-dir t))
|
|
|
|
|
version-control t
|
|
|
|
|
kept-old-versions 2
|
|
|
|
|
kept-new-versions 4
|
|
|
|
|
delete-old-versions t
|
|
|
|
|
vc-make-backup-files t)
|
|
|
|
|
|
2020-01-12 17:52:08 +01:00
|
|
|
|
(setq undo-limit 80000000)
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(setq-default async-shell-command-buffer 'new-buffer)
|
|
|
|
|
(add-to-list 'display-buffer-alist
|
2020-09-12 13:30:53 +02:00
|
|
|
|
'("^\\*Async Shell Command*" . (display-buffer-no-window)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(put 'set-goal-column 'disabled nil)
|
|
|
|
|
(put 'upcase-region 'disabled nil)
|
|
|
|
|
(put 'downcase-region 'disabled nil)
|
|
|
|
|
(put 'narrow-to-region 'disabled nil)
|
|
|
|
|
|
|
|
|
|
(setq-default savehist-file (expand-file-name "savehist" emacs-d))
|
|
|
|
|
|
2018-11-02 18:17:51 +01:00
|
|
|
|
(setq default-input-method "TeX")
|
|
|
|
|
|
2019-10-21 17:28:30 +02:00
|
|
|
|
|
|
|
|
|
;; * Fixes
|
|
|
|
|
|
|
|
|
|
(with-eval-after-load 'enriched
|
|
|
|
|
(defun enriched-decode-display-prop (start end &optional params)
|
|
|
|
|
(ignore params)
|
|
|
|
|
(list start end)))
|
|
|
|
|
|
2020-09-12 14:41:22 +02:00
|
|
|
|
;; Disable gconf settings, as it might interfere with ours. Cf.
|
|
|
|
|
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25228 and
|
|
|
|
|
;; https://emacs.stackexchange.com/questions/32641/something-changes-the-default-face-in-my-emacs.
|
|
|
|
|
(define-key special-event-map [config-changed-event] 'ignore)
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2020-09-12 14:20:30 +02:00
|
|
|
|
;; * Builtin Packages
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package misc
|
|
|
|
|
:commands (zap-up-to-char zap-to-char))
|
|
|
|
|
|
|
|
|
|
(use-package grep
|
|
|
|
|
:commands (rgrep zrgrep)
|
2018-11-03 18:55:20 +01:00
|
|
|
|
:bind (:map grep-mode-map
|
|
|
|
|
("C-x C-q" . wgrep-change-to-wgrep-mode)
|
|
|
|
|
("C-c C-c" . wgrep-finish-edit)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package winner
|
|
|
|
|
:commands (winner-mode winner-undo winner-redo))
|
|
|
|
|
|
|
|
|
|
(use-package abbrev
|
2020-11-21 10:55:53 +01:00
|
|
|
|
:init (setq save-abbrevs 'silently
|
|
|
|
|
abbrev-file-name (expand-file-name "private/abbrev_defs"))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:diminish abbrev-mode)
|
|
|
|
|
|
|
|
|
|
(use-package appt
|
|
|
|
|
:commands (appt-activate)
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq appt-display-mode-line nil))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package ispell
|
2019-04-11 09:00:04 +02:00
|
|
|
|
:commands (ispell-change-directory))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package mailcap
|
|
|
|
|
:config (progn
|
2017-11-11 17:43:27 +01:00
|
|
|
|
;; Remove doc-view so pdf will open with default viewer
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(setcdr
|
|
|
|
|
(assoc "application" mailcap-mime-data)
|
|
|
|
|
(remove '("pdf"
|
|
|
|
|
(viewer . doc-view-mode)
|
|
|
|
|
(type . "application/pdf")
|
|
|
|
|
(test eq window-system 'x))
|
|
|
|
|
(cdr (assoc "application" mailcap-mime-data))))))
|
|
|
|
|
|
|
|
|
|
(use-package quail
|
2018-01-27 17:30:43 +01:00
|
|
|
|
:config (add-hook 'input-method-activate-hook
|
|
|
|
|
#'db/add-symbols-to-TeX-input-method))
|
|
|
|
|
|
2020-09-11 17:19:07 +02:00
|
|
|
|
(use-package isearch
|
|
|
|
|
:init (setq isearch-allow-scroll t))
|
|
|
|
|
|
2018-01-12 20:52:24 +01:00
|
|
|
|
(use-package server
|
2020-09-02 11:17:38 +02:00
|
|
|
|
:commands (server-running-p server-start)
|
|
|
|
|
:init (setq server-log t))
|
2018-01-12 20:52:24 +01:00
|
|
|
|
|
2019-01-25 20:45:22 +01:00
|
|
|
|
(use-package bookmark
|
|
|
|
|
:init (setq bookmark-default-file (expand-file-name "private/bookmarks"
|
2022-08-04 21:08:59 +02:00
|
|
|
|
emacs-d)
|
|
|
|
|
bookmark-menu-confirm-deletion t))
|
2019-01-25 20:45:22 +01:00
|
|
|
|
|
2020-09-12 11:01:42 +02:00
|
|
|
|
(use-package warnings
|
|
|
|
|
:config (cl-pushnew '(undo discard-info) warning-suppress-types
|
|
|
|
|
:test #'equal))
|
|
|
|
|
|
|
|
|
|
(use-package calender
|
|
|
|
|
:init (setq calendar-date-style 'iso
|
2022-05-15 17:13:07 +02:00
|
|
|
|
calendar-time-zone-style 'numeric
|
2020-09-12 11:01:42 +02:00
|
|
|
|
calendar-week-start-day 1 ; Monday
|
|
|
|
|
calendar-bahai-all-holidays-flag nil
|
|
|
|
|
calendar-chinese-all-holidays-flag nil
|
|
|
|
|
calendar-christian-all-holidays-flag t
|
|
|
|
|
calendar-islamic-all-holidays-flag nil
|
|
|
|
|
calendar-hebrew-all-holidays-flag nil
|
|
|
|
|
holiday-general-holidays '((holiday-fixed 1 1 "New Year's Day")
|
|
|
|
|
(holiday-fixed 2 14 "Valentine's Day")
|
|
|
|
|
(holiday-fixed 4 1 "April Fools' Day")
|
|
|
|
|
(holiday-fixed 5 1 "Labour Day")
|
|
|
|
|
(holiday-fixed 10 3 "German Unity Day")
|
|
|
|
|
(holiday-fixed 10 31 "Reformation Day")
|
|
|
|
|
(holiday-float 11 3 -1 "Day of Repentance and Prayer" 22)
|
|
|
|
|
(holiday-float 11 4 4 "Thanksgiving"))
|
|
|
|
|
holiday-other-holidays '((holiday-fixed 2 13 "Jahrestag Zerstörung Dresden 1945")
|
|
|
|
|
(holiday-fixed 5 25 "Towel Day")
|
|
|
|
|
(holiday-fixed 6 4 "Tiananmen Massacre 1989")
|
|
|
|
|
(holiday-fixed 6 5 "Snowden-Veröffentlichungen 2013")
|
|
|
|
|
(holiday-fixed 6 6 "D-Day 1944")
|
|
|
|
|
(holiday-fixed 6 8 "Yoneda Appreciation Day")
|
|
|
|
|
(holiday-fixed 6 10 "Jahrestag Zerstörung von Oradour-sur-Glane 1944")
|
|
|
|
|
(holiday-fixed 6 10 "Jahrestag Massaker von Distomo 1944")
|
|
|
|
|
(holiday-fixed 6 16 "Bloomsday")
|
|
|
|
|
(holiday-fixed 7 20 "Jahrestag Attentat auf Hitler 1944")
|
|
|
|
|
(holiday-fixed 7 21 "Jahrestag der 1. Mondlandung 1969")
|
|
|
|
|
(holiday-fixed 7 21 "Jahrestag Massaker von Vassieux-en-Vercors 1944")
|
|
|
|
|
(holiday-fixed 7 28 "Start WWI 1914")
|
|
|
|
|
(holiday-fixed 11 11 "End WWI 1918"))
|
|
|
|
|
diary-show-holidays-flag t
|
|
|
|
|
calendar-view-holidays-initially-flag nil))
|
|
|
|
|
|
|
|
|
|
(use-package re-builder
|
|
|
|
|
:commands (re-builder)
|
|
|
|
|
:init (setq reb-re-syntax 'string))
|
|
|
|
|
|
|
|
|
|
(use-package browser-url
|
|
|
|
|
:init (setq browse-url-browser-function 'browse-url-generic
|
|
|
|
|
browse-url-generic-program "firefox"))
|
|
|
|
|
|
2020-09-12 14:20:30 +02:00
|
|
|
|
(use-package tramp
|
2022-02-23 18:10:17 +01:00
|
|
|
|
:init (setq tramp-default-method (if on-windows "pscp" "scp")
|
|
|
|
|
tramp-completion-use-auth-sources nil))
|
2020-09-12 14:20:30 +02:00
|
|
|
|
|
|
|
|
|
(use-package calc
|
|
|
|
|
;; https://florian.adamsky.it/2016/03/31/emacs-calc-for-programmers-and-cs.html
|
2020-11-14 21:06:22 +01:00
|
|
|
|
:defines (math-additional-units
|
|
|
|
|
math-units-table)
|
2020-09-12 14:20:30 +02:00
|
|
|
|
:init (setq math-additional-units
|
|
|
|
|
'((bit nil "Bit")
|
|
|
|
|
(byte "8 * bit" "Byte")
|
|
|
|
|
(bps "bit / s" "Bit per second"))
|
|
|
|
|
math-units-table nil))
|
|
|
|
|
|
2020-11-28 09:29:11 +01:00
|
|
|
|
(use-package tab-bar
|
2022-08-04 17:22:35 +02:00
|
|
|
|
:init (setq tab-bar-show t
|
|
|
|
|
tab-bar-format '(tab-bar-format-tabs
|
|
|
|
|
tab-bar-separator
|
|
|
|
|
;; tab-bar-format-align-right
|
|
|
|
|
;; current-time-string
|
|
|
|
|
))
|
2020-11-28 09:29:11 +01:00
|
|
|
|
:config (progn
|
|
|
|
|
(tab-bar-history-mode +1)))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2020-09-12 10:58:30 +02:00
|
|
|
|
;; * Essential external packages
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2021-11-07 07:05:24 +01:00
|
|
|
|
(use-package dash
|
2022-05-25 17:53:20 +02:00
|
|
|
|
:defer nil
|
2021-11-07 07:05:24 +01:00
|
|
|
|
:config (progn
|
|
|
|
|
(global-dash-fontify-mode)
|
|
|
|
|
(dash-register-info-lookup)))
|
2019-02-02 14:34:19 +01:00
|
|
|
|
|
2019-12-21 18:52:50 +01:00
|
|
|
|
(use-package hydra
|
|
|
|
|
:pin "melpa-stable")
|
2019-12-20 15:28:24 +01:00
|
|
|
|
|
2019-12-21 19:01:25 +01:00
|
|
|
|
;; `lv' is a dependency of `hydra'
|
|
|
|
|
(add-to-list 'package-pinned-packages '(lv . "melpa-stable"))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package db-utils
|
|
|
|
|
:commands (endless/fill-or-unfill
|
|
|
|
|
db/delete-trailing-whitespace-maybe
|
|
|
|
|
db/run-or-hide-shell
|
2020-07-01 21:28:55 +02:00
|
|
|
|
db/gnus
|
|
|
|
|
db/org-agenda
|
|
|
|
|
db/scratch
|
|
|
|
|
db/find-user-init-file
|
2017-07-16 18:07:00 +02:00
|
|
|
|
db/run-or-hide-ansi-term
|
2018-01-13 14:19:12 +01:00
|
|
|
|
db/hex-to-ascii
|
2019-03-02 11:15:07 +01:00
|
|
|
|
db/text-to-hex
|
2018-11-02 20:24:16 +01:00
|
|
|
|
conditionally-enable-lispy
|
2019-03-02 11:14:37 +01:00
|
|
|
|
turn-on-lispy-when-available
|
2020-11-28 08:50:47 +01:00
|
|
|
|
turn-on-flycheck-when-file
|
2018-11-10 08:33:47 +01:00
|
|
|
|
db/sort-nsm-permanent-settings
|
|
|
|
|
endless/colorize-compilation
|
|
|
|
|
db/turn-off-local-electric-pair-mode
|
2018-11-03 20:55:13 +01:00
|
|
|
|
db/add-symbols-to-TeX-input-method
|
2018-11-18 15:37:58 +01:00
|
|
|
|
db/two-monitors-xrandr
|
2018-11-21 10:38:05 +01:00
|
|
|
|
db/one-monitor-xrandr
|
2019-01-25 20:39:01 +01:00
|
|
|
|
db/pretty-print-xml
|
|
|
|
|
db/bookmark-add-external
|
2019-01-27 12:10:44 +01:00
|
|
|
|
db/bookmark-add-url
|
2019-05-31 21:28:44 +02:00
|
|
|
|
db/lookup-smime-key
|
2019-08-31 12:02:02 +02:00
|
|
|
|
db/dired-from-shell-command
|
2020-04-17 18:58:18 +02:00
|
|
|
|
db/system-open
|
|
|
|
|
db/switch-to-dark-theme
|
2020-08-26 10:30:25 +02:00
|
|
|
|
db/switch-to-light-theme
|
2020-12-12 18:05:57 +01:00
|
|
|
|
keyboard-quit-context+
|
|
|
|
|
db/convert-lf-to-crlf-in-buffer
|
2021-01-17 09:15:01 +01:00
|
|
|
|
db/convert-crlf-to-lf-in-buffer
|
2022-06-13 21:15:49 +02:00
|
|
|
|
db/sync-magit-repos-from-projectile
|
2022-08-04 18:58:42 +02:00
|
|
|
|
db/replace-variables-in-string
|
|
|
|
|
db/dired-ediff-files))
|
2019-08-31 11:39:04 +02:00
|
|
|
|
|
2019-03-02 11:06:55 +01:00
|
|
|
|
(use-package db-hydras
|
2019-04-11 09:03:37 +02:00
|
|
|
|
:commands (hydra-toggle/body
|
2019-03-02 11:06:55 +01:00
|
|
|
|
hydra-zoom/body
|
2020-07-01 21:28:55 +02:00
|
|
|
|
hydra-rectangle/body
|
2020-09-19 14:02:50 +02:00
|
|
|
|
db/define-feature-shortcuts-hydra
|
2020-07-01 21:28:55 +02:00
|
|
|
|
hydra-feature-shortcuts/body))
|
2019-03-02 11:06:55 +01:00
|
|
|
|
|
2017-07-31 13:20:42 +02:00
|
|
|
|
(use-package exec-path-from-shell
|
2019-12-21 18:52:50 +01:00
|
|
|
|
:pin "melpa-stable"
|
2017-07-31 13:20:42 +02:00
|
|
|
|
:commands (exec-path-from-shell-copy-envs))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2020-09-12 11:49:37 +02:00
|
|
|
|
(use-package crux
|
|
|
|
|
:ensure t
|
|
|
|
|
:commands (crux-eval-and-replace
|
|
|
|
|
crux-smart-open-line-above
|
|
|
|
|
crux-kill-whole-line
|
|
|
|
|
crux-cleanup-buffer-or-region
|
|
|
|
|
crux-delete-buffer-and-file))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; * Text editing
|
|
|
|
|
|
|
|
|
|
(use-package electric
|
|
|
|
|
:commands (electric-quote-mode))
|
|
|
|
|
|
|
|
|
|
(use-package elec-pair
|
|
|
|
|
:commands (electric-pair-mode)
|
|
|
|
|
:config (progn
|
|
|
|
|
(add-to-list 'electric-pair-pairs '(?“ . ?”))
|
|
|
|
|
(add-to-list 'electric-pair-text-pairs '(?“ . ?”))
|
|
|
|
|
(add-to-list 'electric-pair-pairs '(?„ . ?“))
|
|
|
|
|
(add-to-list 'electric-pair-text-pairs '(?„ . ?“))))
|
|
|
|
|
|
|
|
|
|
(use-package flyspell
|
|
|
|
|
:commands (flyspell-mode turn-on-flyspell)
|
|
|
|
|
:config (progn
|
|
|
|
|
(unbind-key "C-M-i" flyspell-mode-map)
|
|
|
|
|
(unbind-key "C-c $" flyspell-mode-map)))
|
|
|
|
|
|
|
|
|
|
(use-package key-chord
|
2021-01-16 14:35:40 +01:00
|
|
|
|
:ensure t
|
2020-09-12 11:49:37 +02:00
|
|
|
|
:commands (key-chord-mode)
|
|
|
|
|
:config (progn
|
|
|
|
|
(key-chord-define-global "``" "“")
|
|
|
|
|
(key-chord-define-global "''" "”")
|
|
|
|
|
(key-chord-define-global ",," "„")))
|
|
|
|
|
|
|
|
|
|
(use-package multiple-cursors
|
|
|
|
|
:pin "melpa-stable"
|
|
|
|
|
:ensure t
|
|
|
|
|
:commands (mc/edit-lines
|
|
|
|
|
mc/mark-next-like-this
|
|
|
|
|
mc/mark-previous-like-this
|
|
|
|
|
mc/mark-all-like-this))
|
|
|
|
|
|
|
|
|
|
(use-package synonyms
|
|
|
|
|
:commands (synonyms))
|
|
|
|
|
|
|
|
|
|
(use-package undo-tree
|
|
|
|
|
:ensure t
|
|
|
|
|
:commands (global-undo-tree-mode
|
|
|
|
|
undo
|
|
|
|
|
undo-tree-redo)
|
|
|
|
|
:init (setq undo-tree-visualizer-timestamps t
|
2022-04-30 15:12:39 +02:00
|
|
|
|
undo-tree-visualizer-diff t
|
2022-05-15 10:58:19 +02:00
|
|
|
|
undo-tree-auto-save-history nil
|
2022-04-30 15:12:39 +02:00
|
|
|
|
undo-tree-history-directory-alist `(("." . ,(expand-file-name "ebackup/" emacs-d))))
|
2020-09-12 11:49:37 +02:00
|
|
|
|
:diminish undo-tree-mode)
|
|
|
|
|
|
|
|
|
|
(use-package wgrep
|
|
|
|
|
:ensure t
|
|
|
|
|
:commands (wgrep-finish-edit
|
|
|
|
|
wgrep-change-to-wgrep-mode))
|
|
|
|
|
|
|
|
|
|
(use-package yasnippet
|
2020-11-14 21:06:22 +01:00
|
|
|
|
:commands (yas-minor-mode-on
|
|
|
|
|
yas-minor-mode
|
|
|
|
|
yas-global-mode
|
|
|
|
|
yas-reload-all)
|
2021-06-19 14:31:05 +02:00
|
|
|
|
:ensure t
|
2020-09-12 11:49:37 +02:00
|
|
|
|
:diminish yas-minor-mode
|
|
|
|
|
:config (yas-reload-all))
|
|
|
|
|
|
2018-11-02 20:24:16 +01:00
|
|
|
|
|
|
|
|
|
;; * Org
|
|
|
|
|
|
2018-11-03 10:28:49 +01:00
|
|
|
|
(use-package db-org
|
2020-01-05 13:36:37 +01:00
|
|
|
|
:commands (db/check-special-org-files-in-agenda
|
|
|
|
|
db/verify-refile-target
|
2018-11-03 11:15:20 +01:00
|
|
|
|
org-reset-checkbox-state-maybe
|
|
|
|
|
db/find-parent-task
|
2018-11-03 10:28:49 +01:00
|
|
|
|
db/ensure-running-clock
|
2018-11-03 10:59:41 +01:00
|
|
|
|
db/save-current-org-task-to-file
|
2019-08-31 11:26:04 +02:00
|
|
|
|
db/org-update-frame-title-with-current-clock
|
2018-11-18 15:37:58 +01:00
|
|
|
|
db/org-clock-out
|
|
|
|
|
db/org-clock-in-break-task
|
|
|
|
|
db/org-clock-in-home-task
|
|
|
|
|
db/org-clock-in-work-task
|
2020-06-27 08:56:53 +02:00
|
|
|
|
db/show-current-org-task
|
2018-11-03 10:59:41 +01:00
|
|
|
|
endless/org-ispell
|
|
|
|
|
db/org-agenda-list-deadlines
|
|
|
|
|
db/org-agenda-skip-tag
|
2018-11-03 11:18:40 +01:00
|
|
|
|
hydra-org-agenda-view/body
|
2021-01-29 17:11:55 +01:00
|
|
|
|
db/org-agenda-insert-efforts
|
2018-11-03 11:37:31 +01:00
|
|
|
|
org-babel-execute:hy
|
2022-07-21 21:54:35 +02:00
|
|
|
|
db/org-eval-subtree-no-confirm
|
2018-11-03 11:37:31 +01:00
|
|
|
|
db/org-timestamp-difference
|
2018-11-03 11:39:39 +01:00
|
|
|
|
db/org-capture-code-snippet
|
2018-11-18 16:39:43 +01:00
|
|
|
|
hydra-org-clock/body
|
2020-01-19 17:17:47 +01:00
|
|
|
|
db/make-org-capture-frame
|
2020-01-19 17:21:14 +01:00
|
|
|
|
db/org-onenote-open
|
|
|
|
|
db/org-outlook-open
|
2020-06-26 23:21:37 +02:00
|
|
|
|
db/org-rfc-open
|
2022-03-30 08:42:06 +02:00
|
|
|
|
db/org-clear-stored-links
|
2020-06-26 23:21:37 +02:00
|
|
|
|
db/org-cleanup-continuous-clocks
|
|
|
|
|
db/find-csv-in-org
|
|
|
|
|
db/org-mark-current-default-task
|
|
|
|
|
db/export-diary
|
2020-09-26 14:14:45 +02:00
|
|
|
|
db/org-copy-template-for-periodic-task
|
2021-12-15 09:43:50 +01:00
|
|
|
|
db/org-copy-template
|
2021-12-13 21:36:04 +01:00
|
|
|
|
db/org-copy-body-from-item-to-point
|
2020-09-26 16:44:11 +02:00
|
|
|
|
db/org-find-links-to-current-item
|
2021-03-20 12:32:48 +01:00
|
|
|
|
db/org-add-link-to-other-item
|
2021-03-20 15:45:49 +01:00
|
|
|
|
db/org-add-link-to-current-clock
|
2022-05-14 11:33:31 +02:00
|
|
|
|
hydra-org-linking/body
|
2022-08-28 19:07:51 +02:00
|
|
|
|
org-dblock-write:db/org-backlinks
|
|
|
|
|
db/org-goto-first-open-checkbox-in-subtree))
|
2018-11-03 10:28:49 +01:00
|
|
|
|
|
2018-11-02 20:24:16 +01:00
|
|
|
|
(use-package org
|
2020-05-11 19:14:28 +02:00
|
|
|
|
:pin "gnu"
|
2018-11-03 09:45:00 +01:00
|
|
|
|
:bind (:map org-mode-map
|
|
|
|
|
([remap org-return] . org-return-indent))
|
2020-01-30 15:32:38 +01:00
|
|
|
|
:init (progn
|
|
|
|
|
(setq org-deadline-warning-days 14
|
|
|
|
|
org-read-date-popup-calendar t
|
|
|
|
|
org-insert-heading-respect-content t
|
|
|
|
|
org-adapt-indentation nil
|
|
|
|
|
org-edit-timestamp-down-means-later t
|
|
|
|
|
org-archive-location "%s_archive.gpg::"
|
|
|
|
|
org-image-actual-width nil
|
2020-09-11 17:03:45 +02:00
|
|
|
|
org-imenu-depth 10
|
2020-01-30 15:32:38 +01:00
|
|
|
|
org-footnote-section nil
|
|
|
|
|
org-log-into-drawer "LOGBOOK"
|
2020-01-30 15:36:22 +01:00
|
|
|
|
org-log-reschedule 'note
|
2020-01-30 15:32:38 +01:00
|
|
|
|
org-log-redeadline 'note
|
|
|
|
|
org-log-note-clock-out nil
|
2020-01-31 07:34:28 +01:00
|
|
|
|
org-log-done 'note
|
2020-01-30 15:32:38 +01:00
|
|
|
|
org-clone-delete-id t
|
|
|
|
|
org-catch-invisible-edits 'error
|
|
|
|
|
org-M-RET-may-split-line '((default . nil))
|
|
|
|
|
org-highlight-latex-and-related '(latex)
|
|
|
|
|
org-use-sub-superscripts '{}
|
|
|
|
|
org-src-fontify-natively t
|
|
|
|
|
org-src-preserve-indentation t
|
2020-12-30 11:23:33 +01:00
|
|
|
|
org-src-tab-acts-natively nil
|
2020-01-30 15:32:38 +01:00
|
|
|
|
org-ellipsis "⤵"
|
|
|
|
|
org-fontify-done-headline nil
|
|
|
|
|
org-cycle-separator-lines 0
|
2021-11-28 14:41:39 +01:00
|
|
|
|
org-special-ctrl-a/e t
|
2022-01-29 15:37:35 +01:00
|
|
|
|
org-highlight-latex-and-related nil
|
2022-03-11 11:40:36 +01:00
|
|
|
|
org-attach-store-link-p 'attached
|
2022-03-11 11:46:56 +01:00
|
|
|
|
org-attach-auto-tag nil
|
2022-05-21 08:28:48 +02:00
|
|
|
|
org-bookmark-names-plist nil
|
2020-01-30 15:32:38 +01:00
|
|
|
|
|
2021-09-08 17:41:51 +02:00
|
|
|
|
org-blank-before-new-entry '((heading . t)
|
|
|
|
|
(plain-list-item . t))
|
|
|
|
|
|
2020-01-30 15:32:38 +01:00
|
|
|
|
org-duration-format '(("y") ("w") ("d") (special . h:mm))
|
|
|
|
|
|
|
|
|
|
org-treat-S-cursor-todo-selection-as-state-change nil
|
|
|
|
|
|
|
|
|
|
org-global-properties
|
2020-10-03 10:33:23 +02:00
|
|
|
|
'(("Effort_ALL" . "0:00 0:05 0:10 0:15 0:30 0:45 1:00 2:00 3:00 4:00 6:00 8:00"))
|
2020-01-30 15:32:38 +01:00
|
|
|
|
|
|
|
|
|
org-columns-default-format
|
2021-01-29 15:41:08 +01:00
|
|
|
|
"%80ITEM(Task) %10Effort(Effort) %10CLOCKSUM")
|
2020-01-30 15:32:38 +01:00
|
|
|
|
|
|
|
|
|
;; Keywords and Tags
|
|
|
|
|
|
|
|
|
|
(setq org-todo-keywords
|
2022-08-15 18:41:18 +02:00
|
|
|
|
'((sequence "TODO(t)" "CONT(n!)" "REFINE(f!)" "|" "DONE(d@)")
|
2020-01-30 15:32:38 +01:00
|
|
|
|
(sequence "GOTO(g)" "ATTN(a)" "|" "DONE(d@)")
|
|
|
|
|
(sequence "READ(r)" "CONT(n!)" "|" "DONE(d@)")
|
|
|
|
|
(sequence "DELG(e@/!)" "WAIT(w@/!)" "HOLD(h@/!)"
|
2022-08-15 18:43:17 +02:00
|
|
|
|
"|" "CANC(c@/!)"))
|
2020-01-30 15:32:38 +01:00
|
|
|
|
|
|
|
|
|
org-todo-state-tags-triggers
|
2020-01-30 15:42:55 +01:00
|
|
|
|
'(("WAIT" ("HOLD") ("WAIT" . t))
|
2020-07-04 15:12:57 +02:00
|
|
|
|
("DELG" ("HOLD") ("WAIT" . t))
|
2020-01-30 15:42:55 +01:00
|
|
|
|
("HOLD" ("HOLD" . t) ("WAIT"))
|
|
|
|
|
(done ("HOLD") ("WAIT"))
|
2021-02-19 16:31:17 +01:00
|
|
|
|
("TODO" ("HOLD") ("WAIT") ("DATE") ("READ"))
|
|
|
|
|
("READ" ("READ" . t) ("DATE") ("HOLD") ("WAIT"))
|
|
|
|
|
("GOTO" ("DATE" . t) ("READ") ("HOLD") ("WAIT"))
|
2022-08-15 18:41:18 +02:00
|
|
|
|
("CONT" ("DATE") ("HOLD") ("WAIT") ("READ"))
|
|
|
|
|
("REFINE" ("DATE") ("HOLD") ("WAIT") ("READ"))
|
2021-02-19 16:31:17 +01:00
|
|
|
|
("ATTN" ("DATE" . t) ("READ") ("HOLD") ("WAIT"))
|
2020-07-06 17:13:02 +02:00
|
|
|
|
("" ("HOLD") ("WAIT") ("DATE") ("READ")))
|
2020-01-30 15:32:38 +01:00
|
|
|
|
|
|
|
|
|
org-tag-alist
|
2022-06-28 20:25:47 +02:00
|
|
|
|
'((:startgroup)
|
2020-01-30 15:32:38 +01:00
|
|
|
|
("WORK" . ?w)
|
|
|
|
|
("HOME" . ?h)
|
|
|
|
|
("FUN" . ?f)
|
|
|
|
|
("UNTAGGED" . ?u)
|
2022-06-28 20:25:47 +02:00
|
|
|
|
(:endgroup)
|
2020-01-31 10:41:08 +01:00
|
|
|
|
("NOTE" . ?n)
|
2022-06-28 20:25:47 +02:00
|
|
|
|
(:startgroup)
|
2020-09-06 10:45:25 +02:00
|
|
|
|
("PERIODIC" . ?p)
|
2020-09-06 10:55:03 +02:00
|
|
|
|
("NOP" . ?o)
|
2022-03-27 09:41:51 +02:00
|
|
|
|
("TOPIC" . ?t)
|
2022-06-28 20:25:47 +02:00
|
|
|
|
("TEMPLATE" . ?l)
|
|
|
|
|
("GOAL" . ?g)
|
|
|
|
|
(:endgroup))
|
2020-01-30 15:32:38 +01:00
|
|
|
|
|
2021-08-17 10:54:10 +02:00
|
|
|
|
org-tags-exclude-from-inheritance
|
2022-06-28 20:25:47 +02:00
|
|
|
|
'("NOP" "TOPIC" "GOAL")
|
2021-08-17 10:54:10 +02:00
|
|
|
|
|
2020-01-30 15:32:38 +01:00
|
|
|
|
org-fast-tag-selection-single-key 'expert)
|
|
|
|
|
|
|
|
|
|
;; Faces
|
|
|
|
|
|
|
|
|
|
(setq org-todo-keyword-faces
|
|
|
|
|
'(("TODO" :foreground "red" :weight normal)
|
|
|
|
|
("GOTO" :foreground "red" :weight normal)
|
|
|
|
|
("READ" :foreground "red" :weight normal)
|
|
|
|
|
("CONT" :foreground "DeepSkyBlue" :weight normal)
|
|
|
|
|
("ATTN" :foreground "DeepSkyBlue" :weight normal)
|
|
|
|
|
("DONE" :foreground "forest green" :weight normal)
|
|
|
|
|
("DELG" :foreground "dark orange" :weight normal)
|
2022-08-15 18:41:18 +02:00
|
|
|
|
("REFINE" :foreground "tomato" :weight normal)
|
2020-01-30 15:32:38 +01:00
|
|
|
|
("WAIT" :foreground "orange" :weight normal)
|
|
|
|
|
("HOLD" :foreground "magenta" :weight normal)
|
2022-08-15 18:43:17 +02:00
|
|
|
|
("CANC" :foreground "lime green" :weight normal))
|
2020-01-30 15:32:38 +01:00
|
|
|
|
|
|
|
|
|
org-priority-faces
|
|
|
|
|
'((?A . (:foreground "Red" :weight bold))
|
|
|
|
|
(?B . (:foreground "firebrick"))
|
|
|
|
|
(?C . (:foreground "tomato"))))
|
|
|
|
|
|
|
|
|
|
;; Refiling
|
|
|
|
|
|
|
|
|
|
(setq org-refile-targets '((org-agenda-files . (:maxlevel . 9))
|
2020-12-03 18:06:25 +01:00
|
|
|
|
(nil . (:maxlevel . 9))
|
|
|
|
|
(db/org-default-notes-file . (:maxlevel . 9)))
|
2022-08-14 10:39:35 +02:00
|
|
|
|
org-refile-use-outline-path 'buffer-name
|
2020-05-25 20:21:15 +02:00
|
|
|
|
org-refile-use-cache t
|
2020-01-30 15:32:38 +01:00
|
|
|
|
org-refile-allow-creating-parent-nodes 'confirm
|
|
|
|
|
org-indirect-buffer-display 'current-window
|
|
|
|
|
org-outline-path-complete-in-steps nil
|
|
|
|
|
org-refile-target-verify-function 'db/verify-refile-target)
|
|
|
|
|
|
|
|
|
|
;; Bable
|
|
|
|
|
|
|
|
|
|
(setq org-babel-load-languages '((shell . t)
|
|
|
|
|
(emacs-lisp . t))))
|
2018-11-02 20:24:16 +01:00
|
|
|
|
:config (progn
|
2020-09-26 11:12:11 +02:00
|
|
|
|
|
2018-11-03 11:19:02 +01:00
|
|
|
|
;; Reset checkboxes if the RESET_CHECK_BOXES property is set
|
|
|
|
|
(add-hook 'org-after-todo-state-change-hook 'org-reset-checkbox-state-maybe)
|
|
|
|
|
|
2020-05-15 11:13:26 +02:00
|
|
|
|
;; Statically color links sponding to whether the file exists, but
|
|
|
|
|
;; this turns out to be slow on Windows; we can use `org-lint' for
|
|
|
|
|
;; this when necessary)
|
|
|
|
|
(org-link-set-parameters "file" :face 'org-link)
|
2018-11-03 10:59:41 +01:00
|
|
|
|
|
|
|
|
|
;; File Apps
|
|
|
|
|
|
|
|
|
|
(add-to-list 'org-file-apps '(directory . emacs))
|
|
|
|
|
|
|
|
|
|
(add-to-list 'org-file-apps '("\\.docx?\\'" . default))
|
|
|
|
|
(add-to-list 'org-file-apps '("\\.pptx?\\'" . default))
|
|
|
|
|
(add-to-list 'org-file-apps '("\\.xlsx?\\'" . default))
|
|
|
|
|
|
|
|
|
|
(when (eq system-type 'cygwin)
|
|
|
|
|
(add-to-list 'org-file-apps '(t . "cygstart %s") t))
|
|
|
|
|
|
2019-05-31 21:28:44 +02:00
|
|
|
|
;; Custom link types for Windows
|
|
|
|
|
(when (eq system-type 'windows-nt)
|
|
|
|
|
(org-link-set-parameters "onenote" :follow #'db/org-onenote-open)
|
|
|
|
|
(org-link-set-parameters "outlook" :follow #'db/org-outlook-open))
|
|
|
|
|
|
2022-03-30 08:44:15 +02:00
|
|
|
|
;; Mark some org mode regions to be skipped by ispell
|
2018-11-03 10:59:41 +01:00
|
|
|
|
(add-hook 'org-mode-hook #'endless/org-ispell)
|
2018-11-02 20:24:16 +01:00
|
|
|
|
|
2019-05-31 21:38:05 +02:00
|
|
|
|
;; Link type for RFCs
|
|
|
|
|
(org-link-set-parameters "rfc" :follow #'db/org-rfc-open)
|
|
|
|
|
|
2018-11-03 11:19:30 +01:00
|
|
|
|
;; Some timers
|
|
|
|
|
|
2018-11-02 20:24:16 +01:00
|
|
|
|
(unless (memq #'org-clock-save
|
|
|
|
|
(mapcar #'timer--function timer-list))
|
2022-05-27 14:46:54 +02:00
|
|
|
|
(run-with-timer 0 3600 #'org-clock-save))
|
|
|
|
|
|
|
|
|
|
;; Hack: The default implementation is too slow, because it is
|
|
|
|
|
;; parsing all properties of an entry by default. Let’s simplify
|
|
|
|
|
;; this to only parse what we are looking for. This makes tag
|
|
|
|
|
;; search *much* faster!
|
|
|
|
|
(with-eval-after-load 'org
|
|
|
|
|
(defun org-cached-entry-get (pom property)
|
|
|
|
|
(if (or (eq t org-use-property-inheritance)
|
|
|
|
|
(and (stringp org-use-property-inheritance)
|
|
|
|
|
(let ((case-fold-search t))
|
|
|
|
|
(string-match-p org-use-property-inheritance property)))
|
|
|
|
|
(and (listp org-use-property-inheritance)
|
|
|
|
|
(member-ignore-case property org-use-property-inheritance)))
|
|
|
|
|
;; Caching is not possible, check it directly.
|
|
|
|
|
(org-entry-get pom property 'inherit)
|
|
|
|
|
;; This is different in the original implementation
|
|
|
|
|
(org-entry-get pom property))))))
|
2018-11-02 20:24:16 +01:00
|
|
|
|
|
2021-01-24 14:48:34 +01:00
|
|
|
|
;; Drag-and-Drop images into org-mode buffer
|
|
|
|
|
(use-package org-download
|
|
|
|
|
:commands (org-download-yank
|
|
|
|
|
org-download-screenshot
|
|
|
|
|
org-download-clipboard)
|
|
|
|
|
:init (setq org-download-method 'attach))
|
|
|
|
|
|
2022-03-27 11:49:44 +02:00
|
|
|
|
;; Extended query language and dynamic blocks
|
2022-03-27 11:58:52 +02:00
|
|
|
|
(use-package org-ql-search
|
|
|
|
|
:ensure org-ql
|
2022-03-27 11:49:44 +02:00
|
|
|
|
:commands (org-ql-view
|
|
|
|
|
org-ql-search
|
2022-06-09 19:51:28 +02:00
|
|
|
|
org-dblock-write:org-ql)
|
|
|
|
|
|
|
|
|
|
:config (progn
|
|
|
|
|
|
|
|
|
|
;; Redefine the regular expression for link searches to allow
|
|
|
|
|
;; brackets in the description. This function comes straight from
|
|
|
|
|
;; org-ql.el
|
|
|
|
|
(cl-defun org-ql--link-regexp (&key description-or-target description target)
|
|
|
|
|
"Return a regexp matching Org links according to arguments.
|
|
|
|
|
Each argument is treated as a regexp (so non-regexp strings
|
|
|
|
|
should be quoted before being passed to this function). If
|
|
|
|
|
DESCRIPTION-OR-TARGET, match it in either description or target.
|
|
|
|
|
If DESCRIPTION, match it in the description. If TARGET, match it
|
|
|
|
|
in the target. If both DESCRIPTION and TARGET, match both,
|
|
|
|
|
respectively."
|
|
|
|
|
(cl-labels
|
2022-08-05 09:15:33 +02:00
|
|
|
|
((no-desc (match)
|
|
|
|
|
(rx-to-string `(seq (or bol (1+ blank))
|
|
|
|
|
"[[" (0+ (not (any "]"))) (regexp ,match) (0+ (not (any "]")))
|
|
|
|
|
"]]")))
|
|
|
|
|
(match-both (description target)
|
|
|
|
|
(rx-to-string `(seq (or bol (1+ blank))
|
|
|
|
|
"[[" (0+ (not (any "]"))) (regexp ,target) (0+ (not (any "]")))
|
|
|
|
|
;; Added .* wildcards
|
|
|
|
|
"][" (regexp ".*") (regexp ,description) (regexp ".*")
|
|
|
|
|
"]]")))
|
2022-06-09 19:51:28 +02:00
|
|
|
|
;; Note that these actually allow empty descriptions
|
|
|
|
|
;; or targets, depending on what they are matching.
|
2022-08-05 09:15:33 +02:00
|
|
|
|
(match-desc (match)
|
|
|
|
|
(rx-to-string `(seq (or bol (1+ blank))
|
|
|
|
|
"[[" (0+ (not (any "]")))
|
|
|
|
|
;; Added .* wildcards
|
|
|
|
|
"][" (regexp ".*") (regexp ,match) (regexp ".*")
|
|
|
|
|
"]]")))
|
|
|
|
|
(match-target (match)
|
|
|
|
|
(rx-to-string `(seq (or bol (1+ blank))
|
|
|
|
|
"[[" (0+ (not (any "]"))) (regexp ,match) (0+ (not (any "]")))
|
|
|
|
|
;; Removed pattern for description
|
|
|
|
|
"][" ))))
|
2022-06-09 19:51:28 +02:00
|
|
|
|
(cond (description-or-target
|
|
|
|
|
(rx-to-string `(or (regexp ,(no-desc description-or-target))
|
|
|
|
|
(regexp ,(match-desc description-or-target))
|
|
|
|
|
(regexp ,(match-target description-or-target)))))
|
|
|
|
|
((and description target)
|
|
|
|
|
(match-both description target))
|
|
|
|
|
(description (match-desc description))
|
|
|
|
|
(target (rx-to-string `(or (regexp ,(no-desc target))
|
|
|
|
|
(regexp ,(match-target target))))))))))
|
2022-03-27 11:49:44 +02:00
|
|
|
|
|
2020-09-12 09:50:47 +02:00
|
|
|
|
(use-package ol
|
2022-03-30 08:42:06 +02:00
|
|
|
|
:init (setq org-link-keep-stored-after-insertion t)
|
2020-09-12 09:50:47 +02:00
|
|
|
|
:commands (org-store-link))
|
|
|
|
|
|
2020-09-06 16:06:32 +02:00
|
|
|
|
(use-package org-id
|
2021-03-28 20:01:29 +02:00
|
|
|
|
:init (setq org-id-link-to-org-use-id t))
|
2020-09-06 16:06:32 +02:00
|
|
|
|
|
2018-11-03 09:38:35 +01:00
|
|
|
|
(use-package org-clock
|
2018-11-03 15:45:55 +01:00
|
|
|
|
:commands (org-clock-save)
|
2020-06-08 12:51:10 +02:00
|
|
|
|
:init (progn
|
2021-09-04 16:16:54 +02:00
|
|
|
|
(setq org-clock-history-length 35
|
2020-06-08 12:51:10 +02:00
|
|
|
|
org-clock-in-resume t
|
|
|
|
|
org-clock-into-drawer t
|
|
|
|
|
org-clock-idle-time nil
|
|
|
|
|
org-clock-out-remove-zero-time-clocks t
|
|
|
|
|
org-clock-out-when-done '("DONE" "CANC" "WAIT" "HOLD")
|
|
|
|
|
org-clock-auto-clock-resolution 'when-no-clock-is-running
|
|
|
|
|
org-clock-mode-line-total 'auto
|
|
|
|
|
org-clock-report-include-clocking-task t
|
2022-05-22 17:37:33 +02:00
|
|
|
|
org-clock-in-switch-to-state #'(lambda (_)
|
|
|
|
|
(when (not
|
|
|
|
|
(and (boundp 'org-capture-mode)
|
|
|
|
|
org-capture-mode))
|
|
|
|
|
(cond
|
2022-08-05 09:15:33 +02:00
|
|
|
|
((member (org-get-todo-state)
|
|
|
|
|
(list "TODO" "READ"))
|
|
|
|
|
"CONT")
|
|
|
|
|
((member (org-get-todo-state)
|
|
|
|
|
(list "GOTO"))
|
|
|
|
|
"ATTN"))))
|
2020-06-08 12:51:10 +02:00
|
|
|
|
org-clock-persist t
|
|
|
|
|
org-clock-persist-query-resume nil
|
2022-05-27 14:56:54 +02:00
|
|
|
|
org-clock-ask-before-exiting nil
|
2020-06-08 12:51:10 +02:00
|
|
|
|
org-time-stamp-rounding-minutes '(1 1))
|
|
|
|
|
|
|
|
|
|
;; On Windows, we don't have dbus to show notifications; default to
|
|
|
|
|
;; `message' instead
|
|
|
|
|
(when on-windows
|
|
|
|
|
(setq org-show-notification-handler #'message)))
|
|
|
|
|
|
2018-11-03 09:38:35 +01:00
|
|
|
|
:config (progn
|
|
|
|
|
(org-clock-persistence-insinuate)
|
|
|
|
|
|
2019-08-22 20:37:24 +02:00
|
|
|
|
(add-hook 'org-clock-in-hook #'db/org-mark-current-default-task)
|
2019-08-31 11:26:04 +02:00
|
|
|
|
(add-hook 'org-clock-in-hook #'db/org-update-frame-title-with-current-clock)
|
2018-11-03 09:38:35 +01:00
|
|
|
|
|
|
|
|
|
;; Clock in default task if no other task is given
|
|
|
|
|
(add-hook 'org-clock-out-hook #'db/ensure-running-clock 'append)
|
|
|
|
|
|
|
|
|
|
;; Communicate the currently clocked in task to the outside world
|
2018-11-03 10:30:47 +01:00
|
|
|
|
(add-hook 'org-clock-in-hook #'db/save-current-org-task-to-file)))
|
2018-11-03 09:38:35 +01:00
|
|
|
|
|
2018-11-03 10:59:41 +01:00
|
|
|
|
;; Agenda
|
|
|
|
|
|
|
|
|
|
(use-package org-agenda
|
|
|
|
|
:commands (org-agenda)
|
|
|
|
|
:bind (:map org-agenda-mode-map
|
2020-09-12 09:40:47 +02:00
|
|
|
|
("i" . org-agenda-clock-in)
|
2018-11-03 10:59:41 +01:00
|
|
|
|
("v" . hydra-org-agenda-view/body))
|
|
|
|
|
:init (setq org-agenda-include-diary t
|
2019-11-06 19:51:33 +01:00
|
|
|
|
org-agenda-span 1
|
2018-11-03 10:59:41 +01:00
|
|
|
|
org-agenda-insert-diary-strategy 'top-level
|
|
|
|
|
org-catch-invisible-edits 'show
|
2022-06-08 16:55:38 +02:00
|
|
|
|
org-agenda-sorting-strategy '((agenda time-up priority-down effort-up category-keep)
|
|
|
|
|
(todo priority-down effort-up category-keep)
|
|
|
|
|
(tags priority-down effort-up category-keep)
|
|
|
|
|
(search priority-down effort-up category-keep))
|
2018-11-03 10:59:41 +01:00
|
|
|
|
org-agenda-window-setup 'current-window
|
|
|
|
|
org-agenda-restore-windows-after-quit t
|
|
|
|
|
org-agenda-compact-blocks nil
|
|
|
|
|
org-agenda-todo-ignore-with-date nil
|
|
|
|
|
org-agenda-todo-ignore-deadlines nil
|
|
|
|
|
org-agenda-todo-ignore-scheduled nil
|
|
|
|
|
org-agenda-todo-ignore-timestamp nil
|
|
|
|
|
org-agenda-skip-deadline-if-done t
|
|
|
|
|
org-agenda-skip-scheduled-if-done t
|
|
|
|
|
org-agenda-skip-timestamp-if-done t
|
|
|
|
|
org-agenda-skip-scheduled-if-deadline-is-shown 'not-today
|
|
|
|
|
org-agenda-tags-todo-honor-ignore-options t
|
|
|
|
|
org-agenda-start-with-log-mode nil
|
2021-06-06 16:47:58 +02:00
|
|
|
|
org-agenda-log-mode-items '(closed)
|
2022-08-21 20:07:09 +02:00
|
|
|
|
org-agenda-remove-tags nil
|
2018-11-04 18:15:49 +01:00
|
|
|
|
org-agenda-sticky nil
|
2019-06-11 21:24:36 +02:00
|
|
|
|
org-agenda-inhibit-startup nil
|
2018-11-03 10:59:41 +01:00
|
|
|
|
org-agenda-tags-todo-honor-ignore-options t
|
|
|
|
|
org-agenda-dim-blocked-tasks nil
|
|
|
|
|
org-enforce-todo-checkbox-dependencies t
|
|
|
|
|
org-enforce-todo-dependencies t
|
|
|
|
|
org-agenda-use-time-grid t
|
|
|
|
|
org-agenda-persistent-filter t
|
|
|
|
|
org-agenda-search-headline-for-time nil
|
2019-11-29 10:54:58 +01:00
|
|
|
|
org-agenda-search-view-always-boolean t
|
2018-11-03 10:59:41 +01:00
|
|
|
|
|
2021-01-29 17:11:55 +01:00
|
|
|
|
;; Show daily efforts directly in the agenda
|
|
|
|
|
org-agenda-finalize-hook '(db/org-agenda-insert-efforts)
|
|
|
|
|
|
2018-11-03 10:59:41 +01:00
|
|
|
|
org-agenda-clock-consistency-checks
|
|
|
|
|
'(:max-duration 9999999
|
2022-08-05 09:15:33 +02:00
|
|
|
|
:min-duration 0
|
|
|
|
|
:max-gap 0
|
|
|
|
|
:gap-ok-around nil
|
|
|
|
|
:default-face ((:background "DarkRed") (:foreground "white"))
|
|
|
|
|
:overlap-face nil :gap-face nil :no-end-time-face nil
|
|
|
|
|
:long-face nil :short-face nil)
|
2018-11-03 10:59:41 +01:00
|
|
|
|
|
|
|
|
|
org-agenda-clockreport-parameter-plist
|
|
|
|
|
'(:link t :maxlevel 4 :compact t :narrow 60 :fileskip0 t)
|
|
|
|
|
|
2021-08-17 10:19:44 +02:00
|
|
|
|
;; Note: projects scheduled in the future are not considered
|
|
|
|
|
;; stuck, even though they are projects by itself; the rationale
|
|
|
|
|
;; here is that projects that have an explicit SCHEDULED entry
|
|
|
|
|
;; should not be considered before this date is due.
|
2018-11-03 10:59:41 +01:00
|
|
|
|
org-stuck-projects
|
2022-06-24 15:56:46 +02:00
|
|
|
|
'("+TODO=\"\"-DATE-HOLD-NOTE-TAGS={NOP\\|TOPIC\\|SOMEWHEN\\|TEMPLATE}-SCHEDULED>=\"<+0d>\""
|
2020-06-20 11:11:10 +02:00
|
|
|
|
("CONT" "TODO" "READ" "WAIT" "GOTO" "DELG" "ATTN")
|
2020-01-10 18:23:11 +01:00
|
|
|
|
()
|
2018-11-03 10:59:41 +01:00
|
|
|
|
"")
|
|
|
|
|
|
2018-11-10 08:29:14 +01:00
|
|
|
|
org-agenda-prefix-format
|
2020-07-04 12:39:42 +02:00
|
|
|
|
'((agenda . "%11s%?-12t%-4e ")
|
2021-04-25 16:49:06 +02:00
|
|
|
|
(todo . "%-8c%-4e ")
|
|
|
|
|
(tags . "%-8c%-4e ")
|
|
|
|
|
(search . "%-8c%-4e "))
|
2018-11-10 08:29:14 +01:00
|
|
|
|
|
2018-11-03 10:59:41 +01:00
|
|
|
|
org-agenda-custom-commands
|
Rework custom agenda views
The agendas for monthly reviews and notes are gone, I don't use them. My
monthly review does not look at the agenda at all, only at my backlog.
Searching notes is done using Org's search functionality, and it's working very
fine.
The „Everything“ agenda has been renamed to „Unsupervised“. The name
„Everything“ is not apt anymore, as this view clusters items that are not
displayed in the main agenda or are stuck. The name „Unsupervised“ is a little
bit better, but may also change in the future.
Add a new view for listing all items that are not periodic and not part of the
personal backlog (i.e., not tagged with SOMEWHEN). This list should help
getting an overview over the current workload of real TODO tasks. Note that
both periodic tasks (tagged with PERIODIC, i.e., series of tasks) and regular
tasks (tagged with REGULAR, i.e., repeating tasks) are excluded from this list.
Descriptions of agenda views have been extended whereever it felt necessary.
2020-07-04 11:33:38 +02:00
|
|
|
|
`(("A" "Main Agenda"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
((agenda
|
|
|
|
|
""
|
|
|
|
|
((org-agenda-entry-types '(:timestamp :sexp :scheduled))
|
|
|
|
|
(org-deadline-warning-days 0)))
|
|
|
|
|
(db/org-agenda-list-deadlines
|
|
|
|
|
""
|
|
|
|
|
((org-agenda-overriding-header "Deadlines")
|
|
|
|
|
(org-agenda-sorting-strategy '(deadline-up priority-down))
|
|
|
|
|
(org-deadline-warning-days 30)))
|
|
|
|
|
(tags-todo "TODO={CONT\\|ATTN}-HOLD-TIMESTAMP>\"<now>\""
|
|
|
|
|
((org-agenda-overriding-header "WIP List (TODO ∈ {CONT,ATTN}, not scheduled now or in the future)")
|
|
|
|
|
(org-agenda-todo-ignore-scheduled 0)))
|
|
|
|
|
(tags-todo "TODO<>\"CONT\"-HOLD-SOMEWHEN-DATE-WAIT-TEMPLATE/-DONE"
|
|
|
|
|
((org-agenda-overriding-header "Next Actions List (not WIP, not scheduled now or in the future)")
|
|
|
|
|
(org-tags-match-list-sublevels t)
|
|
|
|
|
(org-agenda-todo-ignore-scheduled 0)))))
|
2022-06-28 20:35:59 +02:00
|
|
|
|
|
2021-11-22 17:24:34 +01:00
|
|
|
|
("B" "Backlog"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
((tags-todo "-HOLD-SOMEWHEN-DATE-PERIODIC-TEMPLATE/-DONE"
|
|
|
|
|
((org-agenda-overriding-header "Backlog: Actionable items (no periodic tasks; includes waiting-fors)")
|
|
|
|
|
(org-tags-match-list-sublevels t)))
|
|
|
|
|
(tags "TODO=\"\"-HOLD-SOMEWHEN-DATE-PERIODIC-NOTE-NOP-TOPIC-TEMPLATE"
|
|
|
|
|
((org-agenda-overriding-header "Backlog: Complex tasks (i.e., goals)")
|
|
|
|
|
(org-tags-match-list-sublevels t)))))
|
2022-06-28 20:35:59 +02:00
|
|
|
|
|
2022-06-28 20:29:14 +02:00
|
|
|
|
("C" "Checks"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
((tags "TODO=\"\"-HOLD-SOMEWHEN-DATE-PERIODIC-NOTE-NOP-TOPIC-TEMPLATE-GOAL"
|
|
|
|
|
((org-agenda-overriding-header "Goals (i.e., complex tasks) not marked with GOAL")))
|
|
|
|
|
(org-ql-block '(and (not (tags "TOPIC"))
|
|
|
|
|
(descendants (tags "TOPIC")))
|
|
|
|
|
((org-ql-block-header "Non-TOPIC items containing TOPICs")
|
|
|
|
|
(org-agenda-sorting-strategy nil)))))
|
2022-06-28 20:35:59 +02:00
|
|
|
|
|
2021-05-14 19:16:56 +02:00
|
|
|
|
("U" "Unsupervised (Waiting, Missed Appointments, Hold)"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
((tags-todo "WAIT-HOLD-SOMEWHEN"
|
|
|
|
|
((org-agenda-overriding-header "Waiting For List")
|
|
|
|
|
(org-agenda-todo-ignore-scheduled 0)))
|
|
|
|
|
(tags-todo "DATE"
|
|
|
|
|
((org-agenda-overriding-header "Missed appointments (DATEs with timestamp in the past)")
|
|
|
|
|
(org-agenda-todo-ignore-timestamp 0)))
|
|
|
|
|
(tags "REFILE"
|
|
|
|
|
((org-agenda-files (list db/org-default-refile-file))
|
|
|
|
|
(org-agenda-overriding-header "Things to refile (make it empty!)")))
|
|
|
|
|
(tags-todo "HOLD"
|
|
|
|
|
((org-agenda-overriding-header "Tasks on Hold")))))
|
Rework custom agenda views
The agendas for monthly reviews and notes are gone, I don't use them. My
monthly review does not look at the agenda at all, only at my backlog.
Searching notes is done using Org's search functionality, and it's working very
fine.
The „Everything“ agenda has been renamed to „Unsupervised“. The name
„Everything“ is not apt anymore, as this view clusters items that are not
displayed in the main agenda or are stuck. The name „Unsupervised“ is a little
bit better, but may also change in the future.
Add a new view for listing all items that are not periodic and not part of the
personal backlog (i.e., not tagged with SOMEWHEN). This list should help
getting an overview over the current workload of real TODO tasks. Note that
both periodic tasks (tagged with PERIODIC, i.e., series of tasks) and regular
tasks (tagged with REGULAR, i.e., repeating tasks) are excluded from this list.
Descriptions of agenda views have been extended whereever it felt necessary.
2020-07-04 11:33:38 +02:00
|
|
|
|
|
2022-06-28 20:35:59 +02:00
|
|
|
|
|
Rework custom agenda views
The agendas for monthly reviews and notes are gone, I don't use them. My
monthly review does not look at the agenda at all, only at my backlog.
Searching notes is done using Org's search functionality, and it's working very
fine.
The „Everything“ agenda has been renamed to „Unsupervised“. The name
„Everything“ is not apt anymore, as this view clusters items that are not
displayed in the main agenda or are stuck. The name „Unsupervised“ is a little
bit better, but may also change in the future.
Add a new view for listing all items that are not periodic and not part of the
personal backlog (i.e., not tagged with SOMEWHEN). This list should help
getting an overview over the current workload of real TODO tasks. Note that
both periodic tasks (tagged with PERIODIC, i.e., series of tasks) and regular
tasks (tagged with REGULAR, i.e., repeating tasks) are excluded from this list.
Descriptions of agenda views have been extended whereever it felt necessary.
2020-07-04 11:33:38 +02:00
|
|
|
|
("S" "Somewhen (Do if nothing else to do, i.e., personal backlog)"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
((tags "TAGS={SOMEWHEN}+TODO=\"\"-TAGS={NOP\\|TOPIC}-PERIODIC-DATE-SCHEDULED>=\"<+0d>\""
|
|
|
|
|
((org-agenda-overriding-header "Open Tasks to do SOMEWHEN (no TODO keyword, no PERIODIC, no DATE, no now or future SCHEDULED)")))
|
|
|
|
|
(tags-todo "SOMEWHEN/-CANC-DONE"
|
|
|
|
|
((org-agenda-overriding-header "Things To Do SOMEWHEN")
|
|
|
|
|
(org-agenda-todo-ignore-with-date t)
|
|
|
|
|
(org-tags-match-list-sublevels nil)))))
|
Rework custom agenda views
The agendas for monthly reviews and notes are gone, I don't use them. My
monthly review does not look at the agenda at all, only at my backlog.
Searching notes is done using Org's search functionality, and it's working very
fine.
The „Everything“ agenda has been renamed to „Unsupervised“. The name
„Everything“ is not apt anymore, as this view clusters items that are not
displayed in the main agenda or are stuck. The name „Unsupervised“ is a little
bit better, but may also change in the future.
Add a new view for listing all items that are not periodic and not part of the
personal backlog (i.e., not tagged with SOMEWHEN). This list should help
getting an overview over the current workload of real TODO tasks. Note that
both periodic tasks (tagged with PERIODIC, i.e., series of tasks) and regular
tasks (tagged with REGULAR, i.e., repeating tasks) are excluded from this list.
Descriptions of agenda views have been extended whereever it felt necessary.
2020-07-04 11:33:38 +02:00
|
|
|
|
|
2022-06-28 20:35:59 +02:00
|
|
|
|
|
2021-08-27 17:28:59 +02:00
|
|
|
|
("P" "Current Projects and Topics"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
((stuck ""
|
|
|
|
|
((org-agenda-overriding-header "Stuck Complex Tasks")))
|
|
|
|
|
(tags "TAGS={NOTE}-TODO={CANC\\|DONE}-HOLD-NOP-SCHEDULED>=\"<+0d>\""
|
|
|
|
|
((org-agenda-overriding-header "Project Notes (items explicitly tagged with NOTE but not NOP, not scheduled now or in the future)")
|
|
|
|
|
(org-agenda-prefix-format '((tags . "%-8c ")))))
|
|
|
|
|
(tags "TAGS={TOPIC}-TODO={DONE\\|CANC}-SCHEDULED>=\"<+0d>\"-HOLD-WAIT"
|
|
|
|
|
((org-agenda-overriding-header "Topics")
|
|
|
|
|
(org-agenda-prefix-format '((tags . "%-8c%l ")))
|
|
|
|
|
(org-agenda-sorting-strategy nil)))
|
|
|
|
|
(tags "TAGS={PERIODIC}-TODO={DONE\\|CANC}-HOLD-SCHEDULED>=\"<+0d>\"-HOLD-WAIT"
|
|
|
|
|
((org-agenda-overriding-header "Periodic Projects (PERIODIC, not scheduled in the future, not done, not on hold)")
|
|
|
|
|
(org-agenda-prefix-format '((tags . "%-8c ")))))))
|
2020-07-04 17:13:27 +02:00
|
|
|
|
|
2018-11-03 10:59:41 +01:00
|
|
|
|
("W" "Weekly Review"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
((agenda ""
|
|
|
|
|
((org-agenda-span 7)
|
|
|
|
|
(org-agenda-dim-blocked-tasks nil)
|
|
|
|
|
(org-agenda-skip-deadline-prewarning-if-scheduled t)))))))
|
Rework custom agenda views
The agendas for monthly reviews and notes are gone, I don't use them. My
monthly review does not look at the agenda at all, only at my backlog.
Searching notes is done using Org's search functionality, and it's working very
fine.
The „Everything“ agenda has been renamed to „Unsupervised“. The name
„Everything“ is not apt anymore, as this view clusters items that are not
displayed in the main agenda or are stuck. The name „Unsupervised“ is a little
bit better, but may also change in the future.
Add a new view for listing all items that are not periodic and not part of the
personal backlog (i.e., not tagged with SOMEWHEN). This list should help
getting an overview over the current workload of real TODO tasks. Note that
both periodic tasks (tagged with PERIODIC, i.e., series of tasks) and regular
tasks (tagged with REGULAR, i.e., repeating tasks) are excluded from this list.
Descriptions of agenda views have been extended whereever it felt necessary.
2020-07-04 11:33:38 +02:00
|
|
|
|
|
2018-11-03 10:59:41 +01:00
|
|
|
|
:config (progn
|
|
|
|
|
;; avoid important buffers to end up in `org-agenda-new-buffers’ by
|
|
|
|
|
;; opening them manually
|
|
|
|
|
(mapc #'find-file-noselect org-agenda-files)
|
|
|
|
|
|
2020-01-05 13:36:37 +01:00
|
|
|
|
(add-hook 'org-agenda-mode-hook #'hl-line-mode 'append)
|
|
|
|
|
|
|
|
|
|
(advice-add 'org-agenda
|
|
|
|
|
:before #'db/check-special-org-files-in-agenda)))
|
2018-11-03 10:59:41 +01:00
|
|
|
|
|
2018-11-03 11:37:31 +01:00
|
|
|
|
;; Capturing
|
|
|
|
|
|
|
|
|
|
(use-package org-capture
|
|
|
|
|
:commands (org-capture)
|
|
|
|
|
:init (setq org-capture-use-agenda-date nil
|
2022-03-19 20:09:06 +01:00
|
|
|
|
org-capture-bookmark nil
|
2018-11-03 11:37:31 +01:00
|
|
|
|
org-capture-templates
|
2020-06-30 16:40:05 +02:00
|
|
|
|
`(("t" "Simple Task"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
entry
|
|
|
|
|
(file db/org-default-refile-file)
|
|
|
|
|
,(concat "* TODO [#B] %^{What}\n"
|
|
|
|
|
":PROPERTIES:\n:CREATED: %U\n:END:\n"
|
|
|
|
|
"%a\n"
|
|
|
|
|
"%?")
|
|
|
|
|
:empty-lines-after 1)
|
2022-07-02 19:15:41 +02:00
|
|
|
|
("g" "Record new goal with first item"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
entry
|
|
|
|
|
(file db/org-default-refile-file)
|
|
|
|
|
,(concat "* %^{Ticket Description} (%^{Ticket Number}) :GOAL:\n"
|
|
|
|
|
":PROPERTIES:\n:CREATED: %U\n:END:\n"
|
|
|
|
|
"\n** TODO [#B] %^{First Task}\n"
|
|
|
|
|
":PROPERTIES:\n:CREATED: %U\n:END:\n"
|
|
|
|
|
"\n%?"))
|
2020-08-29 12:19:16 +02:00
|
|
|
|
("n" "Note"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
entry
|
|
|
|
|
(file db/org-default-refile-file)
|
|
|
|
|
"* Note: %^{About} :NOTE:\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n%?"
|
|
|
|
|
:empty-lines-after 1)
|
2018-11-03 11:37:31 +01:00
|
|
|
|
("d" "Date"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
entry
|
|
|
|
|
(file db/org-default-refile-file)
|
|
|
|
|
"* GOTO [#B] %^{What} :DATE:\n%^{When}t\n%a%?"
|
2022-08-28 10:12:43 +02:00
|
|
|
|
:empty-lines-after 0)
|
2019-08-22 19:20:14 +02:00
|
|
|
|
("i" "Interruptions"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
entry
|
|
|
|
|
(file db/org-default-refile-file)
|
|
|
|
|
,(concat "* DONE [#B] %^{What}\nCLOSED: %U\n"
|
|
|
|
|
":PROPERTIES:\n:CREATED: %U\n:END:\n"
|
|
|
|
|
"\nInterrupted %(with-temp-buffer (db/org-add-link-to-current-clock) (buffer-string))\n\n%?")
|
2022-08-28 10:12:43 +02:00
|
|
|
|
:clock-in t :clock-resume t :empty-lines-after 0)
|
2018-11-03 11:37:31 +01:00
|
|
|
|
("r" "respond"
|
2022-08-05 09:15:33 +02:00
|
|
|
|
entry
|
|
|
|
|
(file db/org-default-refile-file)
|
|
|
|
|
,(concat "* TODO [#B] Reply: %:subject (%:from) :EMAIL:\n"
|
|
|
|
|
":PROPERTIES:\n:CREATED: %U\n:END:\n"
|
|
|
|
|
"\n%a\n%?")
|
|
|
|
|
:empty-lines-after 1)))
|
2018-11-03 11:37:31 +01:00
|
|
|
|
:config (progn
|
|
|
|
|
;; disable usage of helm for `org-capture'
|
|
|
|
|
(with-eval-after-load 'helm-mode
|
|
|
|
|
(defvar helm-completing-read-handlers-alist) ; for the byte compiler
|
|
|
|
|
(add-to-list 'helm-completing-read-handlers-alist
|
|
|
|
|
'(org-capture . nil)))))
|
|
|
|
|
|
2018-11-03 11:18:40 +01:00
|
|
|
|
;; Babel
|
|
|
|
|
|
|
|
|
|
(use-package ob-core
|
|
|
|
|
:init (setq org-export-use-babel nil)
|
|
|
|
|
:config (setf (alist-get :results org-babel-default-header-args)
|
|
|
|
|
"output code replace"))
|
|
|
|
|
|
2020-06-15 19:56:30 +02:00
|
|
|
|
(use-package ob-sql
|
|
|
|
|
:config (progn
|
|
|
|
|
|
|
|
|
|
(defun db/ob-sql-oracle-ask-for-password (orig-fun
|
|
|
|
|
host port user password database)
|
|
|
|
|
"Ask for PASSWORD if not given, and call ORIG-FUN with arguments afterwards."
|
|
|
|
|
(cond
|
2022-08-05 09:15:33 +02:00
|
|
|
|
((not (or (and user database host port)
|
|
|
|
|
(and user database)))
|
|
|
|
|
(user-error "Insufficient login credentials given, aborting"))
|
|
|
|
|
(password
|
|
|
|
|
(funcall orig-fun host port user password database))
|
|
|
|
|
(t
|
|
|
|
|
(funcall orig-fun
|
|
|
|
|
host port user
|
|
|
|
|
(password-read (format "Password for %s@%s: " user database))
|
|
|
|
|
database))))
|
2020-06-15 19:56:30 +02:00
|
|
|
|
|
|
|
|
|
(advice-add #'org-babel-sql-dbstring-oracle
|
|
|
|
|
:around #'db/ob-sql-oracle-ask-for-password)))
|
|
|
|
|
|
2018-11-03 11:19:30 +01:00
|
|
|
|
;; Exporting
|
|
|
|
|
|
2018-11-02 20:24:16 +01:00
|
|
|
|
(use-package ox-icalendar
|
|
|
|
|
:commands (org-icalendar-combine-agenda-files)
|
|
|
|
|
:init (setq org-icalendar-include-body nil
|
|
|
|
|
org-icalendar-store-UID t
|
|
|
|
|
org-icalendar-use-deadline nil
|
|
|
|
|
org-icalendar-use-scheduled nil
|
|
|
|
|
org-icalendar-include-todo nil
|
|
|
|
|
org-icalendar-exclude-tags '("NO_EXPORT")))
|
|
|
|
|
|
|
|
|
|
(use-package ox
|
|
|
|
|
:init (setq org-export-with-broken-links 'mark
|
|
|
|
|
org-export-with-sub-superscripts '{}
|
|
|
|
|
org-export-with-author nil
|
|
|
|
|
org-export-with-date nil
|
|
|
|
|
org-export-with-toc nil
|
|
|
|
|
org-export-with-archived-trees nil
|
|
|
|
|
org-export-with-tags t
|
|
|
|
|
org-export-with-priority nil
|
|
|
|
|
org-export-with-creator nil
|
|
|
|
|
org-export-with-entities t
|
|
|
|
|
org-export-with-special-strings t
|
|
|
|
|
org-export-with-todo-keywords nil
|
|
|
|
|
org-export-exclude-tags '("NO_EXPORT"))
|
|
|
|
|
:config (with-demoted-errors "Cannot load package: %s"
|
|
|
|
|
(require 'ox-md)
|
|
|
|
|
(require 'ox-pandoc)))
|
|
|
|
|
|
|
|
|
|
(use-package ox-html
|
|
|
|
|
:init (setq org-html-postamble nil))
|
|
|
|
|
|
2020-12-20 17:21:23 +01:00
|
|
|
|
(use-package ox-pandoc
|
|
|
|
|
:init (setq org-pandoc-options-for-docx '((standalone . t))))
|
|
|
|
|
|
2020-09-12 10:01:32 +02:00
|
|
|
|
(use-package org-tree-slide
|
|
|
|
|
:commands (org-tree-slide-mode)
|
|
|
|
|
;; Configuration from https://protesilaos.com/dotemacs/
|
|
|
|
|
:init (setq org-tree-slide-breadcrumbs " → "
|
|
|
|
|
org-tree-slide-header t
|
|
|
|
|
org-tree-slide-slide-in-effect nil
|
|
|
|
|
org-tree-slide-heading-emphasis nil
|
|
|
|
|
org-tree-slide-cursor-init t
|
|
|
|
|
org-tree-slide-modeline-display nil
|
|
|
|
|
org-tree-slide-skip-done nil
|
|
|
|
|
org-tree-slide-skip-comments t
|
|
|
|
|
org-tree-slide-fold-subtrees-skipped t
|
|
|
|
|
org-tree-slide-skip-outline-level 8
|
|
|
|
|
org-tree-slide-never-touch-face t
|
|
|
|
|
org-tree-slide-activate-message (propertize "Presentation mode ON" 'face 'success)
|
|
|
|
|
org-tree-slide-deactivate-message (propertize "Presentation mode OFF" 'face 'error))
|
|
|
|
|
:bind (:map org-tree-slide-mode-map
|
|
|
|
|
("<C-down>" . org-tree-slide-display-header-toggle)
|
|
|
|
|
("<C-right>" . org-tree-slide-move-next-tree)
|
|
|
|
|
("<C-left>" . org-tree-slide-move-previous-tree)))
|
|
|
|
|
|
2020-09-12 10:02:40 +02:00
|
|
|
|
(use-package org-roam
|
2022-08-15 18:52:25 +02:00
|
|
|
|
:init (progn
|
|
|
|
|
(add-to-list 'display-buffer-alist
|
|
|
|
|
'("\\*org-roam\\*"
|
|
|
|
|
(display-buffer-in-side-window)
|
|
|
|
|
(side . right)
|
|
|
|
|
(slot . 0)
|
|
|
|
|
(window-width . 0.33)
|
|
|
|
|
(window-parameters . ((no-other-window . t)
|
|
|
|
|
(no-delete-other-windows . t))))))
|
2021-09-04 14:53:58 +02:00
|
|
|
|
:commands (org-roam-node-insert
|
|
|
|
|
org-roam-node-find
|
|
|
|
|
org-roam-capture)
|
2020-11-14 15:17:28 +01:00
|
|
|
|
:custom ((org-roam-directory "~/Documents/zettelkasten/")
|
2021-01-02 15:27:12 +01:00
|
|
|
|
(org-roam-db-location "~/Documents/zettelkasten/org-roam.db")
|
|
|
|
|
(org-roam-completion-everywhere t))
|
2020-09-12 10:02:40 +02:00
|
|
|
|
:bind (:map org-roam-mode-map
|
2021-09-04 14:53:58 +02:00
|
|
|
|
(("C-c n l" . org-roam-buffer-toggle)
|
|
|
|
|
("C-c n g" . org-roam-graph))))
|
2020-09-12 10:02:40 +02:00
|
|
|
|
|
2020-09-12 10:58:30 +02:00
|
|
|
|
|
|
|
|
|
;; * General Programming
|
|
|
|
|
|
2020-09-12 11:01:42 +02:00
|
|
|
|
(use-package ediff
|
|
|
|
|
:init (setq ediff-diff-options "-w"
|
|
|
|
|
ediff-window-setup-function 'ediff-setup-windows-plain
|
|
|
|
|
ediff-split-window-function 'split-window-horizontally
|
|
|
|
|
ediff-show-clashes-only t)
|
|
|
|
|
:config (progn
|
|
|
|
|
(add-hook 'ediff-keymap-setup-hook
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(bind-key "j" #'ediff-next-difference ediff-mode-map)
|
|
|
|
|
(bind-key "k" #'ediff-previous-difference ediff-mode-map)))
|
2020-09-12 11:01:42 +02:00
|
|
|
|
|
|
|
|
|
(add-hook 'ediff-after-quit-hook-internal 'winner-undo)))
|
|
|
|
|
|
2020-09-12 10:58:30 +02:00
|
|
|
|
(use-package git-commit
|
|
|
|
|
:commands (global-git-commit-mode)
|
2021-06-19 14:31:05 +02:00
|
|
|
|
:ensure t
|
2020-09-12 10:58:30 +02:00
|
|
|
|
:init (setq git-commit-style-convention-checks '(non-empty-second-line
|
|
|
|
|
overlong-summary-line)
|
|
|
|
|
git-commit-known-pseudo-headers '("Signed-off-by"
|
|
|
|
|
"Acked-by"
|
|
|
|
|
"Modified-by"
|
|
|
|
|
"Cc"
|
|
|
|
|
"Suggested-by"
|
|
|
|
|
"Reported-by"
|
|
|
|
|
"Tested-by"
|
|
|
|
|
"Reviewed-by")))
|
|
|
|
|
|
|
|
|
|
(use-package magit
|
2021-06-19 14:31:05 +02:00
|
|
|
|
:ensure t
|
2020-09-12 10:58:30 +02:00
|
|
|
|
:commands (magit-status)
|
|
|
|
|
:init (setq magit-diff-refine-hunk nil
|
2020-11-14 21:06:22 +01:00
|
|
|
|
magit-commit-show-diff nil)
|
2020-09-12 10:58:30 +02:00
|
|
|
|
:config (progn
|
2021-01-01 17:31:36 +01:00
|
|
|
|
(when (fboundp 'global-magit-file-mode)
|
2021-01-17 09:15:01 +01:00
|
|
|
|
(global-magit-file-mode -1))
|
2020-09-12 10:58:30 +02:00
|
|
|
|
(global-git-commit-mode +1)
|
|
|
|
|
|
2021-01-17 09:15:01 +01:00
|
|
|
|
(db/sync-magit-repos-from-projectile)))
|
2020-09-12 10:58:30 +02:00
|
|
|
|
|
|
|
|
|
(use-package magit-repos
|
|
|
|
|
:commands (magit-list-repositories))
|
|
|
|
|
|
|
|
|
|
(use-package projectile
|
2021-01-16 14:35:40 +01:00
|
|
|
|
:ensure t
|
2020-09-12 10:58:30 +02:00
|
|
|
|
:commands (projectile-mode)
|
|
|
|
|
:defines (projectile-known-projects)
|
|
|
|
|
:bind (:map projectile-mode-map ("C-c p" . projectile-command-map))
|
|
|
|
|
:init (setq projectile-switch-project-action 'projectile-dired
|
|
|
|
|
projectile-completion-system 'helm
|
|
|
|
|
projectile-ignored-project-function #'file-remote-p
|
|
|
|
|
projectile-create-missing-test-files t
|
|
|
|
|
projectile-known-projects-file (expand-file-name "private/projectile-bookmarks.eld"
|
|
|
|
|
emacs-d))
|
|
|
|
|
:diminish projectile-mode)
|
|
|
|
|
|
|
|
|
|
(use-package counsel-projectile
|
|
|
|
|
:commands counsel-projectile)
|
|
|
|
|
|
2020-09-12 11:49:37 +02:00
|
|
|
|
(use-package highlight-indentation
|
|
|
|
|
:commands highlight-indentation-mode)
|
|
|
|
|
|
|
|
|
|
(use-package iedit
|
|
|
|
|
:ensure t
|
|
|
|
|
:commands (iedit-mode))
|
|
|
|
|
|
|
|
|
|
(use-package page-break-lines
|
|
|
|
|
:pin "melpa-stable"
|
|
|
|
|
:commands (page-break-lines-mode)
|
|
|
|
|
:diminish page-break-lines-mode)
|
|
|
|
|
|
|
|
|
|
(use-package flycheck
|
2020-11-21 11:01:11 +01:00
|
|
|
|
:ensure t
|
2020-11-14 18:08:45 +01:00
|
|
|
|
:commands (global-flycheck-mode flycheck-mode)
|
|
|
|
|
:init (setq flycheck-emacs-lisp-load-path 'inherit))
|
2020-09-12 11:49:37 +02:00
|
|
|
|
|
2021-04-22 12:01:44 +02:00
|
|
|
|
(use-package lsp-mode
|
2021-03-13 09:48:24 +01:00
|
|
|
|
:ensure t
|
2021-04-22 15:29:32 +02:00
|
|
|
|
:init (setq lsp-keymap-prefix "C-c C-l")
|
|
|
|
|
:commands (lsp lsp-deferred))
|
2021-03-13 09:48:24 +01:00
|
|
|
|
|
2021-04-22 15:51:45 +02:00
|
|
|
|
(use-package lsp-ui
|
|
|
|
|
:ensure t
|
|
|
|
|
:commands (lsp-ui-mode))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;; * Mail
|
|
|
|
|
|
2019-02-02 15:05:29 +01:00
|
|
|
|
(use-package db-mail
|
2019-02-10 15:53:18 +01:00
|
|
|
|
:commands (db/smtpmail-send-it
|
|
|
|
|
db/public-key
|
2019-02-02 15:05:29 +01:00
|
|
|
|
db/encryption-possible-p
|
|
|
|
|
db/message-recipients
|
|
|
|
|
db/signencrypt-message-when-possible
|
|
|
|
|
db/gnus-save-newsrc-with-whitespace-1
|
|
|
|
|
db/gnus-summary-open-Link
|
2019-02-02 15:14:22 +01:00
|
|
|
|
db/gnus-html-mime-part-to-org
|
2019-02-10 19:58:06 +01:00
|
|
|
|
db/gnus-demon-scan-news-on-level-2))
|
2019-02-02 15:05:29 +01:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package bbdb
|
2021-06-19 14:31:05 +02:00
|
|
|
|
:ensure t
|
2019-03-02 11:23:47 +01:00
|
|
|
|
:commands (bbdb-search-name
|
|
|
|
|
bbdb-initialize
|
|
|
|
|
bbdb-mua-auto-update-init
|
|
|
|
|
bbdb-save)
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq bbdb-completion-display-record nil
|
|
|
|
|
bbdb-complete-mail-allow-cycling t
|
|
|
|
|
bbdb-mua-auto-update-p 'query
|
2019-03-02 11:33:21 +01:00
|
|
|
|
bbdb-default-country "Germany")
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:config (progn
|
|
|
|
|
(add-hook 'message-setup-hook 'bbdb-mail-aliases)
|
2017-09-10 09:40:53 +02:00
|
|
|
|
(add-hook 'mail-setup-hook 'bbdb-mail-aliases)
|
2022-06-05 14:50:22 +02:00
|
|
|
|
(run-with-timer 0 3600 #'bbdb-save)
|
|
|
|
|
|
|
|
|
|
(with-eval-after-load 'ol-bbdb
|
|
|
|
|
(add-to-list 'org-bbdb-anniversary-format-alist
|
|
|
|
|
(cons "day-of-death"
|
|
|
|
|
#'(lambda (name years suffix)
|
|
|
|
|
(format "Day of Death: [[bbdb:%s][%s (%s%s)]]"
|
|
|
|
|
name name years suffix)))))))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2019-02-02 18:22:07 +01:00
|
|
|
|
;; General Gnus configuration
|
|
|
|
|
|
|
|
|
|
(setq gnus-init-file (expand-file-name "gnus.el" emacs-d)
|
2021-08-22 09:35:17 +02:00
|
|
|
|
gnus-home-directory (expand-file-name "~/.config/gnus-news")
|
|
|
|
|
gnus-directory gnus-home-directory
|
2019-02-02 18:22:07 +01:00
|
|
|
|
gnus-kill-files-directory gnus-directory
|
2021-06-12 10:13:16 +02:00
|
|
|
|
gnus-startup-file (expand-file-name "private/gnus-newsrc" emacs-d)
|
2019-02-02 18:22:07 +01:00
|
|
|
|
gnus-cache-directory (expand-file-name "cache/" gnus-directory)
|
2022-08-04 20:25:51 +02:00
|
|
|
|
gnus-verbose 6
|
2022-08-05 19:29:37 +02:00
|
|
|
|
gnus-dbus-close-on-sleep t
|
2019-02-02 18:22:07 +01:00
|
|
|
|
|
|
|
|
|
message-directory (expand-file-name "mail/" gnus-directory)
|
|
|
|
|
nnmail-message-id-cache-file (expand-file-name ".nnmail-cache" gnus-directory)
|
|
|
|
|
nnml-directory message-directory
|
|
|
|
|
mail-sources '((file))
|
|
|
|
|
mail-source-delete-incoming t
|
|
|
|
|
nntp-nov-is-evil t
|
|
|
|
|
nntp-connection-timeout nil
|
|
|
|
|
gnus-asynchronous t
|
|
|
|
|
gnus-save-killed-list nil
|
|
|
|
|
gnus-save-newsrc-file nil
|
|
|
|
|
gnus-read-newsrc-file nil
|
|
|
|
|
gnus-check-new-newsgroups nil
|
|
|
|
|
gnus-use-cache 'passive
|
|
|
|
|
gnus-read-active-file 'some
|
|
|
|
|
gnus-build-sparse-threads 'some
|
|
|
|
|
gnus-subscribe-newsgroup-method 'gnus-subscribe-killed
|
|
|
|
|
gnus-group-list-inactive-groups t
|
|
|
|
|
gnus-suppress-duplicates nil
|
|
|
|
|
gnus-large-newsgroup 200
|
|
|
|
|
nnmail-expiry-wait 7
|
|
|
|
|
nnmail-cache-accepted-message-ids t
|
|
|
|
|
gnus-summary-next-group-on-exit nil
|
|
|
|
|
gnus-use-full-window nil
|
|
|
|
|
gnus-always-force-window-configuration t
|
|
|
|
|
gnus-fetch-old-headers nil
|
|
|
|
|
gnus-select-method '(nnnil "")
|
2020-12-20 09:00:38 +01:00
|
|
|
|
gnus-refer-article-method 'current
|
2019-02-02 18:22:07 +01:00
|
|
|
|
|
|
|
|
|
gnus-visible-headers (regexp-opt '("From:"
|
|
|
|
|
"Newsgroups:"
|
|
|
|
|
"Subject:"
|
|
|
|
|
"Date:"
|
|
|
|
|
"Followup-To:"
|
|
|
|
|
"Reply-To:"
|
|
|
|
|
"Organization:"
|
|
|
|
|
"Summary:"
|
|
|
|
|
"Keywords:"
|
|
|
|
|
"Mail-Copies-To:"
|
|
|
|
|
"To:"
|
|
|
|
|
"Cc:"
|
|
|
|
|
"BCC:"
|
|
|
|
|
"X-Newsreader:"
|
|
|
|
|
"X-Mailer:"
|
|
|
|
|
"X-Sent:"
|
|
|
|
|
"Posted-To:"
|
|
|
|
|
"Mail-Copies-To:"
|
|
|
|
|
"Apparently-To:"
|
|
|
|
|
"Gnus-Warning:"
|
|
|
|
|
"Resent-From:"
|
|
|
|
|
"gpg-key-ID:"
|
|
|
|
|
"fingerprint:"
|
|
|
|
|
"X-Jabber-ID:"
|
|
|
|
|
"User-Agent:"))
|
|
|
|
|
|
|
|
|
|
message-citation-line-function
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(when message-reply-headers
|
|
|
|
|
(insert "ghItlhpu' "
|
|
|
|
|
(mail-header-from message-reply-headers)
|
|
|
|
|
":")
|
|
|
|
|
(newline))))
|
2019-02-02 18:22:07 +01:00
|
|
|
|
|
|
|
|
|
;; Gnus Appearence
|
|
|
|
|
|
|
|
|
|
(setq gnus-group-line-format "%S%p%P%5y(%2i):%B%(%s:%G%)\n"
|
|
|
|
|
gnus-auto-select-first nil
|
|
|
|
|
gnus-auto-select-next nil
|
|
|
|
|
gnus-summary-line-format "%U%O%R%6k %(%&user-date; %-13,13f %B%s%)\n"
|
|
|
|
|
gnus-thread-sort-functions '(gnus-thread-sort-by-most-recent-date)
|
|
|
|
|
gnus-subthread-sort-functions '(gnus-thread-sort-by-date)
|
|
|
|
|
gnus-thread-hide-subtree t
|
|
|
|
|
gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M"))
|
|
|
|
|
gnus-sum-thread-tree-indent " "
|
|
|
|
|
gnus-sum-thread-tree-root "● "
|
|
|
|
|
gnus-sum-thread-tree-false-root "◎ "
|
|
|
|
|
gnus-sum-thread-tree-single-indent "◯ "
|
|
|
|
|
gnus-sum-thread-tree-single-leaf "╰► "
|
|
|
|
|
gnus-sum-thread-tree-leaf-with-other "├► "
|
|
|
|
|
gnus-sum-thread-tree-vertical "│"
|
|
|
|
|
gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references
|
|
|
|
|
|
|
|
|
|
;; New mark symbols (seen here:
|
|
|
|
|
;; `https://github.com/cofi/dotfiles/blob/master/gnus.el')
|
|
|
|
|
gnus-ancient-mark ?✓
|
|
|
|
|
;; gnus-cached-mark ?☍
|
|
|
|
|
gnus-canceled-mark ?↗
|
|
|
|
|
gnus-del-mark ?✗
|
|
|
|
|
;; gnus-dormant-mark ?⚐
|
|
|
|
|
gnus-expirable-mark ?♻
|
|
|
|
|
gnus-forwarded-mark ?↪
|
|
|
|
|
;; gnus-killed-mark ?☠
|
|
|
|
|
;; gnus-process-mark ?⚙
|
|
|
|
|
gnus-read-mark ?✓
|
|
|
|
|
gnus-recent-mark ?✩
|
|
|
|
|
gnus-replied-mark ?↺
|
|
|
|
|
gnus-unread-mark ?✉
|
|
|
|
|
;; gnus-unseen-mark ?★
|
|
|
|
|
;; gnus-ticked-mark ?⚑
|
|
|
|
|
|
|
|
|
|
gnus-treat-hide-boring-headers 'head
|
|
|
|
|
gnus-treat-strip-multiple-blank-lines nil
|
|
|
|
|
gnus-treat-display-smileys t
|
|
|
|
|
gnus-treat-emphasize 'head
|
|
|
|
|
gnus-treat-unsplit-urls t)
|
|
|
|
|
|
2020-12-06 09:15:37 +01:00
|
|
|
|
(use-package gnus-art
|
|
|
|
|
:init (setq gnus-ignored-mime-types '("text/x-vcard")
|
|
|
|
|
gnus-inhibit-mime-unbuttonizing nil
|
|
|
|
|
gnus-buttonized-mime-types '("multipart/signed" "multipart/encrypted")
|
|
|
|
|
gnus-inhibit-images t
|
|
|
|
|
gnus-blocked-images ".*"))
|
|
|
|
|
|
2019-02-02 18:22:07 +01:00
|
|
|
|
;; Adaptive Scoring
|
|
|
|
|
|
2020-12-03 18:03:48 +01:00
|
|
|
|
(setq gnus-use-scoring t
|
|
|
|
|
gnus-use-adaptive-scoring '(word line)
|
|
|
|
|
gnus-summary-mark-below nil
|
2019-02-02 18:22:07 +01:00
|
|
|
|
gnus-adaptive-word-length-limit 5
|
|
|
|
|
gnus-adaptive-word-no-group-words t
|
|
|
|
|
gnus-default-adaptive-score-alist
|
|
|
|
|
'((gnus-unread-mark)
|
|
|
|
|
(gnus-ticked-mark (from 4))
|
|
|
|
|
(gnus-dormant-mark (from 5))
|
|
|
|
|
(gnus-del-mark (from -4) (subject -1))
|
|
|
|
|
(gnus-read-mark (from 4) (subject 2))
|
|
|
|
|
(gnus-expirable-mark (from -1) (subject -1))
|
|
|
|
|
(gnus-killed-mark (from -1) (subject -3))
|
|
|
|
|
(gnus-kill-file-mark)
|
|
|
|
|
(gnus-ancient-mark)
|
|
|
|
|
(gnus-low-score-mark)
|
|
|
|
|
(gnus-catchup-mark (from -1) (subject -1)))
|
2020-12-03 18:03:48 +01:00
|
|
|
|
gnus-summary-mark-below nil)
|
2019-02-02 18:22:07 +01:00
|
|
|
|
|
|
|
|
|
;; Gnus Registry
|
|
|
|
|
|
2020-12-20 09:00:38 +01:00
|
|
|
|
(use-package gnus-registry
|
|
|
|
|
:commands (gnus-registry-split-fancy-with-parent
|
|
|
|
|
gnus-registry-initialize)
|
|
|
|
|
:init (setq gnus-registry-split-strategy 'majority
|
|
|
|
|
gnus-registry-ignored-groups '(("^nntp" t)
|
|
|
|
|
("^nnfolder" t)
|
|
|
|
|
("^nnir" t)
|
|
|
|
|
("^nnmaildir" t)
|
|
|
|
|
("INBOX$" t))
|
2021-12-15 09:45:27 +01:00
|
|
|
|
gnus-registry-max-entries 5000
|
2020-12-20 09:00:38 +01:00
|
|
|
|
gnus-registry-track-extra '(sender subject recipient)
|
|
|
|
|
gnus-registry-cache-file (expand-file-name "gnus.registry.eioioi"
|
|
|
|
|
emacs-d)))
|
2019-02-02 18:22:07 +01:00
|
|
|
|
|
2020-12-06 09:15:37 +01:00
|
|
|
|
;; MIME decoding
|
|
|
|
|
|
|
|
|
|
(use-package mm-decode
|
|
|
|
|
:init (setq mm-text-html-renderer 'shr
|
|
|
|
|
mm-discouraged-alternatives '("text/richtext")
|
|
|
|
|
mm-decrypt-option 'known
|
|
|
|
|
mm-verify-option 'known)
|
|
|
|
|
:config (progn
|
|
|
|
|
(setq mm-automatic-display (-difference mm-automatic-display
|
|
|
|
|
'("text/enriched"
|
|
|
|
|
"text/richtext")))
|
|
|
|
|
|
|
|
|
|
;; Automatically show PGP data inline
|
|
|
|
|
(add-to-list 'mm-inlined-types "application/pgp$")
|
|
|
|
|
(add-to-list 'mm-inline-media-tests
|
|
|
|
|
'("application/pgp$" mm-inline-text identity))
|
2020-12-12 18:05:57 +01:00
|
|
|
|
(add-to-list 'mm-automatic-display "application/pgp$")
|
|
|
|
|
|
|
|
|
|
;; When copying MIME buffers, we are looking for the start of the
|
|
|
|
|
;; header by searching ^\n; however, if we received mail from
|
|
|
|
|
;; Outlook, there's an ^\r\n seperating header and body, which is
|
|
|
|
|
;; not found by `mm-copy-to-buffer', leaving the target buffer empty
|
2021-01-17 12:45:48 +01:00
|
|
|
|
;; and the mail as well. Redefining `mm-copy-to-buffer' to also
|
|
|
|
|
;; search for ^\r\n might help.
|
|
|
|
|
|
|
|
|
|
(defun mm-copy-to-buffer ()
|
|
|
|
|
"Copy the contents of the current buffer to a fresh buffer."
|
|
|
|
|
(let ((obuf (current-buffer))
|
|
|
|
|
(mb enable-multibyte-characters)
|
|
|
|
|
beg)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
;; The following regex has been extended by \r? .
|
|
|
|
|
(search-forward-regexp "^\r?\n" nil 'move) ;; There might be no body.
|
|
|
|
|
(setq beg (point))
|
|
|
|
|
(with-current-buffer
|
|
|
|
|
(generate-new-buffer " *mm*")
|
|
|
|
|
;; Preserve the data's unibyteness (for url-insert-file-contents).
|
|
|
|
|
(set-buffer-multibyte mb)
|
|
|
|
|
(insert-buffer-substring obuf beg)
|
|
|
|
|
(current-buffer))))))
|
2020-12-06 09:15:37 +01:00
|
|
|
|
|
2021-01-06 17:06:29 +01:00
|
|
|
|
(setq message-forward-as-mime nil)
|
2020-12-06 09:15:37 +01:00
|
|
|
|
|
|
|
|
|
;; MIME creation; signing, and encryption
|
|
|
|
|
|
|
|
|
|
(use-package mml
|
|
|
|
|
:config (progn
|
|
|
|
|
;; Move to end of message buffer before attaching a file
|
|
|
|
|
;; http://mbork.pl/2015-11-28_Fixing_mml-attach-file_using_advice
|
|
|
|
|
|
|
|
|
|
(defun db/mml-attach-file--go-to-eob (orig-fun &rest args)
|
|
|
|
|
"Go to the end of buffer before attaching files."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(save-restriction
|
|
|
|
|
(widen)
|
|
|
|
|
(goto-char (point-max))
|
|
|
|
|
(apply orig-fun args))))
|
2019-02-02 18:22:07 +01:00
|
|
|
|
|
2020-12-06 09:15:37 +01:00
|
|
|
|
(advice-add 'mml-attach-file
|
|
|
|
|
:around #'db/mml-attach-file--go-to-eob)))
|
2019-02-02 18:22:07 +01:00
|
|
|
|
|
2020-12-06 09:15:37 +01:00
|
|
|
|
(use-package mm-encode
|
|
|
|
|
:init (setq mm-encrypt-option nil
|
|
|
|
|
mm-sign-option nil))
|
2019-02-02 18:22:07 +01:00
|
|
|
|
|
2020-12-12 18:15:47 +01:00
|
|
|
|
(setq mml-secure-openpgp-encrypt-to-self t
|
|
|
|
|
mml-secure-smime-encrypt-to-self t
|
|
|
|
|
mml2015-display-key-image nil
|
2019-02-02 18:22:07 +01:00
|
|
|
|
gnus-message-replysign t
|
|
|
|
|
gnus-message-replyencrypt t
|
|
|
|
|
gnus-message-replysignencrypted t
|
2020-11-07 12:10:20 +01:00
|
|
|
|
mml-secure-cache-passphrase nil
|
|
|
|
|
mml-secure-openpgp-sign-with-sender t
|
|
|
|
|
mml-secure-smime-sign-with-sender t)
|
2019-02-02 18:22:07 +01:00
|
|
|
|
|
2020-12-12 18:05:57 +01:00
|
|
|
|
(use-package mml-smime
|
|
|
|
|
:init (setq mml-smime-use 'epg)
|
|
|
|
|
:config (progn
|
|
|
|
|
;; Outlook seems to expect \r\n in PKCS#7 encrypted containers, but
|
|
|
|
|
;; Gnus is only sending \n; so let's artificially replace \n by \r\n
|
2021-04-05 15:11:44 +02:00
|
|
|
|
;; after, well, signing? But only if we are encrypting with S/MIME,
|
|
|
|
|
;; as otherwise the search for \n\n in `message-encode-message-body'
|
|
|
|
|
;; will break. However, I think this is not the right way to do it
|
|
|
|
|
;; … isn't there some way to specify the encoding of the the
|
|
|
|
|
;; relevant MML buffers to be some nasty cp1252 or something?
|
|
|
|
|
|
|
|
|
|
;; A previous version of this worked, but the following has not been
|
|
|
|
|
;; tested with Outlook proper.
|
|
|
|
|
|
|
|
|
|
(defun db/smime-add-crlf-when-pkcs7 (cont)
|
|
|
|
|
"If CONT signifies encryption with smime, replace all \n with \r\n."
|
|
|
|
|
(when (and (eq (car cont) 'part)
|
|
|
|
|
(string= "smime" (or (cdr (assq 'encrypt cont)) "")))
|
|
|
|
|
(db/convert-lf-to-crlf-in-buffer)))
|
2020-12-12 18:05:57 +01:00
|
|
|
|
|
|
|
|
|
(advice-add 'mml-smime-epg-sign
|
2021-04-05 15:11:44 +02:00
|
|
|
|
:after #'db/smime-add-crlf-when-pkcs7)))
|
2020-12-12 18:05:57 +01:00
|
|
|
|
|
2019-02-02 18:22:07 +01:00
|
|
|
|
;; Archiving
|
|
|
|
|
|
|
|
|
|
;; We store messages in the current group, so there is
|
|
|
|
|
;; no need to use Gnus’ archiving method
|
|
|
|
|
|
|
|
|
|
(setq gnus-message-archive-method nil
|
|
|
|
|
gnus-update-message-archive-method t
|
|
|
|
|
gnus-message-archive-group nil
|
|
|
|
|
gnus-gcc-mark-as-read t)
|
|
|
|
|
|
|
|
|
|
;; Searching
|
|
|
|
|
|
2022-08-05 19:29:25 +02:00
|
|
|
|
(use-package gnus-search
|
|
|
|
|
:init (setq gnus-search-default-engines '((nnimap . gnus-search-imap))
|
|
|
|
|
gnus-search-use-parsed-queries t))
|
2019-02-02 18:22:07 +01:00
|
|
|
|
|
|
|
|
|
;; Agents
|
|
|
|
|
|
2021-06-13 09:43:28 +02:00
|
|
|
|
(use-package gnus-agent
|
|
|
|
|
:init (setq gnus-agent-mark-unread-after-downloaded nil
|
|
|
|
|
gnus-agent-synchronize-flags t
|
|
|
|
|
gnus-agent-go-online t))
|
2019-02-02 18:22:07 +01:00
|
|
|
|
|
|
|
|
|
;; Package configuration
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package gnus
|
|
|
|
|
:commands (gnus)
|
|
|
|
|
:config (progn
|
2019-02-02 18:02:37 +01:00
|
|
|
|
(require 'db-mail)
|
|
|
|
|
|
2019-03-02 11:21:10 +01:00
|
|
|
|
(with-demoted-errors "Setting up BBDB failed: %s"
|
|
|
|
|
(bbdb-initialize 'gnus 'message)
|
|
|
|
|
(bbdb-mua-auto-update-init 'message))
|
2019-02-02 15:05:29 +01:00
|
|
|
|
|
2019-02-03 09:35:07 +01:00
|
|
|
|
;; Ensure that whenever we compose new mail, it will use the correct
|
|
|
|
|
;; posting style. This is ensured by setting ARG of
|
2019-02-02 15:05:29 +01:00
|
|
|
|
;; `gnus-group-mail’ to 1 to let it query the user for a group.
|
|
|
|
|
(defadvice gnus-group-mail (before inhibit-no-argument activate)
|
|
|
|
|
(unless (ad-get-arg 0)
|
|
|
|
|
(ad-set-arg 0 1)))
|
|
|
|
|
|
|
|
|
|
(remove-hook 'gnus-mark-article-hook
|
|
|
|
|
'gnus-summary-mark-read-and-unread-as-read)
|
|
|
|
|
(add-hook 'gnus-mark-article-hook 'gnus-summary-mark-unread-as-read)
|
|
|
|
|
|
|
|
|
|
;; Quit Gnus gracefully when exiting Emacs
|
|
|
|
|
(add-hook 'kill-emacs-hook #'(lambda ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(when (get-buffer "*Group*")
|
|
|
|
|
(gnus-group-exit))))
|
|
|
|
|
|
|
|
|
|
;; Don’t quit summary buffer when pressing `q’
|
|
|
|
|
(bind-key "q" #'gnus-summary-expand-window gnus-article-mode-map)
|
|
|
|
|
|
|
|
|
|
;; Show topics in group buffer
|
|
|
|
|
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
|
|
|
|
|
|
|
|
|
|
;; We need to do some magic as otherwise the agent does not delete
|
|
|
|
|
;; articles from its .overview when we move them around. Thus we
|
|
|
|
|
;; mark articles as expireable when they have been moved to another
|
|
|
|
|
;; group.
|
|
|
|
|
(defadvice gnus-summary-move-article (around
|
|
|
|
|
no-cancel-mark
|
|
|
|
|
(&optional n to-newsgroup
|
|
|
|
|
select-method action)
|
|
|
|
|
activate)
|
|
|
|
|
(let ((articles (gnus-summary-work-articles n))
|
|
|
|
|
(return ad-do-it))
|
|
|
|
|
(when (or (null action)
|
|
|
|
|
(eq action 'move))
|
|
|
|
|
(dolist (article articles)
|
|
|
|
|
(gnus-summary-mark-article article gnus-expirable-mark)))
|
|
|
|
|
return))
|
|
|
|
|
|
|
|
|
|
;; Increase score of group after reading it
|
|
|
|
|
(add-hook 'gnus-summary-exit-hook
|
|
|
|
|
'gnus-summary-bubble-group)
|
|
|
|
|
|
2020-11-06 21:25:18 +01:00
|
|
|
|
;; Use Gnus’ registry; doing this too early conflicts with `gnus'
|
|
|
|
|
;; calling `gnus-shutdown', which in turn calls
|
|
|
|
|
;; `gnus-registry-clear', leaving us with an empty registry upon
|
2022-03-18 17:05:54 +01:00
|
|
|
|
;; startup. So let's call this initialization right before startup,
|
2020-11-06 21:25:18 +01:00
|
|
|
|
;; that should be fine.
|
2022-03-18 17:05:54 +01:00
|
|
|
|
(add-hook 'gnus-before-startup-hook
|
2020-11-06 21:25:18 +01:00
|
|
|
|
#'gnus-registry-initialize)
|
2019-02-02 15:05:29 +01:00
|
|
|
|
|
|
|
|
|
;; Automatic encryption if all necessary keys are present
|
|
|
|
|
(add-hook 'gnus-message-setup-hook
|
|
|
|
|
#'db/signencrypt-message-when-possible)
|
|
|
|
|
|
|
|
|
|
;; Do some pretty printing before saving the newsrc file
|
|
|
|
|
(add-hook 'gnus-save-quick-newsrc-hook
|
|
|
|
|
#'db/gnus-save-newsrc-with-whitespace-1)
|
|
|
|
|
|
2019-02-02 15:34:20 +01:00
|
|
|
|
;; Automatically scan for new news
|
|
|
|
|
(gnus-demon-add-handler 'db/gnus-demon-scan-news-on-level-2 5 5)
|
|
|
|
|
|
2022-02-06 20:56:46 +01:00
|
|
|
|
;; Automatically expire groups on idle
|
|
|
|
|
(gnus-demon-add-handler 'gnus-group-expire-all-groups 10 5)
|
2019-03-31 11:16:50 +02:00
|
|
|
|
|
2019-02-02 15:05:29 +01:00
|
|
|
|
;; Visit group under point and immediately close it; this updates
|
|
|
|
|
;; gnus’ registry as a side-effect
|
|
|
|
|
(bind-key "v u"
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(save-mark-and-excursion
|
|
|
|
|
(when (gnus-topic-select-group)
|
|
|
|
|
(gnus-summary-exit))))
|
2019-02-02 15:05:29 +01:00
|
|
|
|
gnus-group-mode-map)
|
|
|
|
|
|
|
|
|
|
;; Toggle visibility of News group
|
|
|
|
|
(bind-key "v c"
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(save-mark-and-excursion
|
|
|
|
|
(gnus-topic-jump-to-topic "News")
|
|
|
|
|
(gnus-topic-read-group)))
|
2019-02-02 15:05:29 +01:00
|
|
|
|
gnus-group-mode-map)
|
|
|
|
|
|
|
|
|
|
(bind-key "C-<return>" #'db/gnus-summary-open-Link gnus-summary-mode-map)
|
2019-02-02 15:14:22 +01:00
|
|
|
|
(bind-key "C-<return>" #'db/gnus-summary-open-Link gnus-article-mode-map)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2019-01-27 13:32:00 +01:00
|
|
|
|
|
2020-12-06 09:15:37 +01:00
|
|
|
|
;; Sending mail
|
2019-02-02 18:00:47 +01:00
|
|
|
|
|
2020-12-06 09:15:37 +01:00
|
|
|
|
(setq message-send-mail-function #'db/smtpmail-send-it
|
2020-01-19 19:41:27 +01:00
|
|
|
|
send-mail-function #'db/smtpmail-send-it
|
|
|
|
|
mail-user-agent 'gnus-user-agent)
|
2019-02-02 15:05:29 +01:00
|
|
|
|
|
2019-02-02 15:14:22 +01:00
|
|
|
|
(use-package smtpmail
|
2019-02-02 15:39:16 +01:00
|
|
|
|
:init (setq smtpmail-stream-type 'starttls
|
2019-02-02 15:14:22 +01:00
|
|
|
|
smtpmail-smtp-service 587
|
2019-02-10 19:55:25 +01:00
|
|
|
|
smtpmail-debug-info t))
|
2019-02-02 15:14:22 +01:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;; * Crypto
|
|
|
|
|
|
|
|
|
|
(use-package nsm
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq network-security-level 'high
|
2018-11-10 08:29:14 +01:00
|
|
|
|
nsm-save-host-names t
|
|
|
|
|
nsm-settings-file (expand-file-name
|
|
|
|
|
"~/.emacs.d/private/network-security.data"))
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:config (advice-add 'nsm-write-settings
|
|
|
|
|
:before #'db/sort-nsm-permanent-settings))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package gnutls
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq gnutls-log-level 0 ; too noisy otherwise
|
|
|
|
|
gnutls-min-prime-bits 1024
|
|
|
|
|
gnutls-verify-error t))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package epg
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq epg-debug t
|
|
|
|
|
epg-gpg-program "gpg"))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2022-08-19 20:34:10 +02:00
|
|
|
|
(use-package org-password-manager
|
|
|
|
|
:commands (org-password-manager-get-password-by-id)
|
|
|
|
|
:config (progn
|
|
|
|
|
|
|
|
|
|
(defun org-password-manager-get-password-by-id (id)
|
|
|
|
|
"Retrieve password from Org item identified by ID.
|
|
|
|
|
|
|
|
|
|
The password is assumed to be stored at the PASSWORD property."
|
|
|
|
|
|
|
|
|
|
(let ((pom (org-id-find id 'marker)))
|
|
|
|
|
(unless (markerp pom)
|
|
|
|
|
(user-error "Cannot find item with id %s" id))
|
|
|
|
|
|
|
|
|
|
(let ((heading (org-entry-get pom "ITEM"))
|
|
|
|
|
(pw (org-entry-get pom "PASSWORD")))
|
|
|
|
|
(when (null pw)
|
|
|
|
|
(user-error "PASSWORD property not set for “%s”" heading))
|
|
|
|
|
|
|
|
|
|
(funcall interprogram-cut-function pw)
|
|
|
|
|
(run-at-time org-password-manager-default-password-wait-time
|
|
|
|
|
nil
|
|
|
|
|
(lambda () (funcall interprogram-cut-function "")))
|
|
|
|
|
(message "Password for “%s” securly copied to system clipboard; will be overwritten in %s."
|
|
|
|
|
heading
|
|
|
|
|
org-password-manager-default-password-wait-time))))))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;; * Appearance
|
|
|
|
|
|
2020-09-12 11:31:29 +02:00
|
|
|
|
(setq-default cursor-type 'bar
|
|
|
|
|
cursor-in-non-selected-windows nil
|
|
|
|
|
font-lock-maximum-decoration '((t . t)))
|
|
|
|
|
|
2019-04-14 14:06:25 +02:00
|
|
|
|
(setq mode-line-format '((ace-window-display-mode
|
|
|
|
|
(:eval
|
|
|
|
|
(window-parameter
|
|
|
|
|
(selected-window)
|
|
|
|
|
'ace-window-path)))
|
|
|
|
|
"%e"
|
|
|
|
|
mode-line-front-space
|
|
|
|
|
mode-line-position
|
|
|
|
|
mode-line-mule-info
|
|
|
|
|
mode-line-client
|
|
|
|
|
mode-line-modified
|
|
|
|
|
mode-line-remote
|
|
|
|
|
mode-line-buffer-identification
|
|
|
|
|
mode-line-modes
|
|
|
|
|
(vc-mode vc-mode)
|
|
|
|
|
mode-line-misc-info
|
|
|
|
|
mode-line-end-spaces))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package solarized-theme
|
2020-11-21 11:05:49 +01:00
|
|
|
|
:ensure t
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:init (setq solarized-use-less-bold t
|
|
|
|
|
solarized-emphasize-indicators t
|
|
|
|
|
solarized-use-variable-pitch nil))
|
|
|
|
|
|
2021-09-18 11:12:22 +02:00
|
|
|
|
(use-package solarized-dark-theme
|
|
|
|
|
:defer t
|
|
|
|
|
:config (progn
|
|
|
|
|
(setq custom--inhibit-theme-enable nil)
|
|
|
|
|
|
|
|
|
|
(custom-theme-set-faces
|
|
|
|
|
'solarized-dark
|
|
|
|
|
`(tab-bar ((t (:height 1.2
|
|
|
|
|
:foregreound ,(cdr (assoc 'base03 solarized-dark-color-palette-alist))
|
2021-09-18 11:47:10 +02:00
|
|
|
|
:background ,(cdr (assoc 'base02 solarized-dark-color-palette-alist))))))
|
2021-09-18 11:12:22 +02:00
|
|
|
|
`(tab-bar-tab ((t (:background ,(cdr (assoc 'base02 solarized-dark-color-palette-alist))
|
|
|
|
|
:foreground ,(cdr (assoc 'magenta solarized-dark-color-palette-alist))
|
|
|
|
|
:inverse-video nil
|
|
|
|
|
:box (:line-width 1 :style released-button)))))
|
|
|
|
|
`(tab-bar-tab-inactive ((t (:inherit tab-bar-tab
|
|
|
|
|
:background ,(cdr (assoc 'base0 solarized-dark-color-palette-alist))
|
|
|
|
|
:foreground ,(cdr (assoc 'base03 solarized-dark-color-palette-alist))
|
|
|
|
|
:inverse-video t
|
|
|
|
|
:box nil)))))))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package smart-mode-line
|
2020-11-21 11:05:49 +01:00
|
|
|
|
:ensure t
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq sml/mode-width 'full
|
2019-04-07 14:32:53 +02:00
|
|
|
|
sml/name-width 30)
|
2018-01-27 17:31:50 +01:00
|
|
|
|
:commands (sml/setup))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2019-04-14 13:44:39 +02:00
|
|
|
|
(use-package minions
|
2020-11-21 11:05:49 +01:00
|
|
|
|
:ensure t
|
2019-04-17 19:16:52 +02:00
|
|
|
|
:commands (minions-mode)
|
|
|
|
|
:init (setq minions-mode-line-lighter "…"))
|
2019-04-14 13:44:39 +02:00
|
|
|
|
|
|
|
|
|
(use-package moody
|
2020-11-21 11:05:49 +01:00
|
|
|
|
:ensure t
|
2019-04-14 13:44:39 +02:00
|
|
|
|
:commands (moody-replace-mode-line-buffer-identification
|
|
|
|
|
moody-replace-vc-mode))
|
|
|
|
|
|
2022-08-04 18:48:55 +02:00
|
|
|
|
(use-package smiley
|
|
|
|
|
:init (setq smiley-style 'emoji))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;; * Dired
|
|
|
|
|
|
|
|
|
|
(use-package dired
|
2018-09-07 17:58:19 +02:00
|
|
|
|
:bind (:map dired-mode-map
|
2022-08-04 18:58:42 +02:00
|
|
|
|
("e" . db/dired-ediff-files)
|
2018-09-07 17:58:19 +02:00
|
|
|
|
("z" . dired-get-size)
|
|
|
|
|
([remap beginning-of-buffer] . dired-back-to-top)
|
|
|
|
|
([remap end-of-buffer] . dired-jump-to-bottom)
|
2019-05-03 18:18:25 +02:00
|
|
|
|
("<f1>" . nil)
|
2020-09-12 09:19:09 +02:00
|
|
|
|
("<tab>" . dired-subtree-toggle)
|
|
|
|
|
("<C-tab>" . dired-subtree-cycle))
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (progn
|
|
|
|
|
(setq dired-dwim-target t
|
2022-02-23 18:09:56 +01:00
|
|
|
|
dired-listing-switches "-ahlvF"
|
|
|
|
|
dired-ls-F-marks-symlinks t
|
2018-11-02 18:17:51 +01:00
|
|
|
|
dired-hide-details-hide-information-lines t
|
|
|
|
|
dired-hide-details-hide-symlink-targets t
|
|
|
|
|
dired-recursive-copies 'top
|
|
|
|
|
dired-recursive-deletes 'top
|
2020-09-12 09:08:15 +02:00
|
|
|
|
dired-create-destination-dirs 'ask
|
|
|
|
|
dired-vc-rename-file t
|
2022-07-10 20:00:41 +02:00
|
|
|
|
dired-kill-when-opening-new-dired-buffer nil
|
2022-08-04 19:09:05 +02:00
|
|
|
|
dired-maybe-use-globstar t
|
2018-11-02 18:17:51 +01:00
|
|
|
|
|
|
|
|
|
;; Don’t use obsolete diredx local variables
|
|
|
|
|
dired-enable-local-variables nil
|
|
|
|
|
dired-local-variables-file nil
|
|
|
|
|
|
|
|
|
|
dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.$\\|^\\..*$"
|
2018-12-16 09:28:01 +01:00
|
|
|
|
diredp-hide-details-initially-flag t
|
|
|
|
|
|
|
|
|
|
wdired-create-parent-directories t
|
2019-06-11 21:25:29 +02:00
|
|
|
|
wdired-allow-to-change-permissions t
|
|
|
|
|
|
|
|
|
|
dired-isearch-filenames 'dwim
|
|
|
|
|
dired-auto-revert-buffer t)
|
2018-11-02 18:17:51 +01:00
|
|
|
|
|
2019-12-06 13:11:46 +01:00
|
|
|
|
(setq dired-guess-shell-alist-user
|
|
|
|
|
'(("\\.pdf\\'" "evince")
|
|
|
|
|
("\\.ps\\'" "evince")
|
|
|
|
|
("\\.\\(?:djvu\\|eps\\)\\'" "evince")
|
|
|
|
|
("\\.\\(?:jpg\\|jpeg\\|png\\|gif\\|xpm\\)\\'" "eog")
|
|
|
|
|
("\\.\\(?:xcf\\)\\'" "gimp")
|
|
|
|
|
("\\.\\(?:mp4\\|mkv\\|avi\\|flv\\|ogv\\|webm\\)\\(?:\\.part\\)?\\'"
|
|
|
|
|
"vlc")
|
|
|
|
|
("\\.\\(?:mp3\\|flac\\|ogg\\)\\'" "mplayer")
|
|
|
|
|
("\\.docx?\\'" "loffice")))
|
2018-11-02 18:17:51 +01:00
|
|
|
|
|
|
|
|
|
(when on-windows
|
|
|
|
|
(setq directory-free-space-program nil)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:config (progn
|
|
|
|
|
(put 'dired-find-alternate-file 'disabled nil)
|
2018-09-06 16:09:04 +02:00
|
|
|
|
|
2018-09-06 20:17:40 +02:00
|
|
|
|
(require 'dired-x)
|
2019-12-13 14:59:06 +01:00
|
|
|
|
|
2020-12-20 18:03:14 +01:00
|
|
|
|
(with-demoted-errors "Non-Fatal Errors (dired-open): %s"
|
|
|
|
|
(require 'dired-open))
|
|
|
|
|
|
2020-09-07 11:15:12 +02:00
|
|
|
|
(if (eq system-type 'windows-nt)
|
|
|
|
|
(with-demoted-errors "Non-Fatal Error (w32-browser): %s"
|
|
|
|
|
(require 'w32-browser)
|
|
|
|
|
(bind-key "M-RET" #'dired-w32-browser dired-mode-map)
|
|
|
|
|
(bind-key "<C-return>" #'dired-w32explore dired-mode-map))
|
2020-12-20 18:03:14 +01:00
|
|
|
|
(bind-key "M-RET" #'dired-open-xdg dired-mode-map))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2020-08-27 11:46:06 +02:00
|
|
|
|
(with-demoted-errors "Non-Fatal Errors (dired-recent): %s"
|
|
|
|
|
(dired-recent-mode +1))
|
|
|
|
|
|
2017-07-23 11:01:54 +02:00
|
|
|
|
;; Gnus support in dired
|
2018-01-27 17:48:27 +01:00
|
|
|
|
(add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2020-09-12 09:08:15 +02:00
|
|
|
|
;; Highlight current line more prominently
|
|
|
|
|
(add-hook 'dired-mode-hook 'hl-line-mode)
|
|
|
|
|
|
2017-07-23 09:45:02 +02:00
|
|
|
|
;; omitting files
|
2018-01-27 17:48:27 +01:00
|
|
|
|
(add-hook 'dired-mode-hook 'dired-omit-mode)
|
2020-09-12 09:08:15 +02:00
|
|
|
|
(add-hook 'dired-mode-hook 'dired-hide-details-mode)
|
2017-08-06 22:03:37 +02:00
|
|
|
|
(dolist (extension '(".out" ".synctex.gz" ".thm"))
|
|
|
|
|
(add-to-list 'dired-latex-unclean-extensions extension))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2018-01-27 17:58:04 +01:00
|
|
|
|
(defun dired-back-to-top ()
|
|
|
|
|
"Jump to first non-trivial line in dired."
|
|
|
|
|
(interactive)
|
|
|
|
|
(goto-char (point-min))
|
2018-07-31 20:00:55 +02:00
|
|
|
|
(dired-next-line 1))
|
|
|
|
|
|
2018-01-27 17:58:04 +01:00
|
|
|
|
(defun dired-jump-to-bottom ()
|
|
|
|
|
"Jump to last non-trivial line in dired."
|
|
|
|
|
(interactive)
|
|
|
|
|
(goto-char (point-max))
|
|
|
|
|
(dired-next-line -1))
|
|
|
|
|
|
|
|
|
|
(defun dired-get-size () ; from emacswiki, via oremacs
|
|
|
|
|
"Print size of all files marked in the current dired buffer."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let ((files (dired-get-marked-files)))
|
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(apply 'call-process "/usr/bin/du" nil t nil "-sch" files)
|
|
|
|
|
(message
|
|
|
|
|
"size of all marked files: %s"
|
|
|
|
|
(progn
|
|
|
|
|
(re-search-backward "\\(^[0-9.,]+[a-za-z]+\\).*total$")
|
2020-09-12 09:20:02 +02:00
|
|
|
|
(match-string 1))))))))
|
|
|
|
|
|
|
|
|
|
(use-package dired-x
|
2022-04-29 09:36:24 +02:00
|
|
|
|
:commands (dired-jump dired-jump-other-window) ; In Emacs 28.1, this has been
|
2022-08-05 09:15:33 +02:00
|
|
|
|
; moved to dired.el, but we'll
|
|
|
|
|
; keep it here to support Emacs
|
|
|
|
|
; 27.2 as well.
|
2020-09-12 09:20:02 +02:00
|
|
|
|
:init (setq dired-clean-confirm-killing-deleted-buffers t
|
|
|
|
|
dired-x-hands-off-my-keys t
|
|
|
|
|
dired-bind-man nil
|
|
|
|
|
dired-bind-info nil
|
|
|
|
|
dired-clean-up-buffers-too t))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2020-09-12 09:19:09 +02:00
|
|
|
|
(use-package dired-subtree
|
|
|
|
|
:commands (dired-subtree-toggle))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package find-dired
|
|
|
|
|
:commands (find-dired)
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq find-ls-option '("-print0 | xargs -0 ls -ld" . "-ld")))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2018-08-09 21:34:03 +02:00
|
|
|
|
(use-package dired-open
|
2019-12-13 14:59:41 +01:00
|
|
|
|
:ensure t
|
2020-12-20 17:57:58 +01:00
|
|
|
|
:init (progn
|
|
|
|
|
(unless (eq system-type 'gnu/linux)
|
|
|
|
|
(setq dired-open-use-nohup nil))
|
|
|
|
|
(setq dired-open-extensions-elisp '(("html" . eww-open-file))))
|
|
|
|
|
:config (progn
|
|
|
|
|
(add-to-list 'dired-open-functions
|
|
|
|
|
#'dired-open-guess-shell-alist)
|
|
|
|
|
(add-to-list 'dired-open-functions
|
|
|
|
|
#'dired-open-call-function-by-extension)))
|
2018-08-09 21:34:03 +02:00
|
|
|
|
|
2020-08-27 11:46:06 +02:00
|
|
|
|
(use-package dired-recent
|
|
|
|
|
:ensure t
|
|
|
|
|
:init (setq dired-recent-max-directories nil)
|
|
|
|
|
:commands (dired-recent-mode
|
|
|
|
|
dired-recent-open))
|
|
|
|
|
|
2018-09-06 19:55:50 +02:00
|
|
|
|
(use-package gnus-dired
|
|
|
|
|
:commands (turn-on-gnus-dired-mode))
|
|
|
|
|
|
2020-09-12 09:24:01 +02:00
|
|
|
|
(use-package trashed
|
|
|
|
|
;; A simple dired-like interface to the system trash bin
|
|
|
|
|
;; Configuration taken from https://protesilaos.com/dotemacs
|
|
|
|
|
:init (setq trashed-action-confirmer 'y-or-n-p
|
|
|
|
|
trashed-use-header-line t
|
|
|
|
|
trashed-sort-key '("Date deleted" . t)
|
|
|
|
|
trashed-date-format "%Y-%m-%d %H:%M:%S"))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;; * Completion
|
|
|
|
|
|
|
|
|
|
(use-package hippie-exp
|
|
|
|
|
:commands (hippie-expand))
|
|
|
|
|
|
2018-01-28 11:06:37 +01:00
|
|
|
|
(use-package helm
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:diminish helm-mode
|
2020-08-13 16:16:51 +02:00
|
|
|
|
:init (setq helm-command-prefix-key "C-c h"
|
|
|
|
|
helm-input-idle-delay 0.0
|
2018-11-02 18:17:51 +01:00
|
|
|
|
helm-buffers-fuzzy-matching t
|
|
|
|
|
helm-mode-fuzzy-match t
|
|
|
|
|
helm-autoresize-min-height 20
|
|
|
|
|
helm-ff-auto-update-initial-value t
|
|
|
|
|
helm-ff-file-name-history-use-recentf t
|
|
|
|
|
helm-ff-search-library-in-sexp t
|
|
|
|
|
helm-ff-skip-boring-files nil
|
|
|
|
|
helm-split-window-inside-p t
|
|
|
|
|
helm-move-to-line-cycle-in-source nil
|
|
|
|
|
helm-scroll-amount nil
|
|
|
|
|
helm-locate-command nil
|
|
|
|
|
helm-candidate-number-limit 100
|
|
|
|
|
helm-follow-mode-persistent t
|
|
|
|
|
helm-buffer-details-flag t
|
2020-12-07 18:42:01 +01:00
|
|
|
|
helm-buffer-skip-remote-checking t
|
2022-01-30 21:06:43 +01:00
|
|
|
|
helm-mode-no-completion-in-region-in-modes '(eshell-mode)
|
|
|
|
|
helm-kill-ring-threshold 0 ; include all yanks in the kill ring
|
|
|
|
|
)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:config (progn
|
2020-01-03 14:01:18 +01:00
|
|
|
|
(require 'helm-config)
|
|
|
|
|
(require 'helm-mode)
|
|
|
|
|
(require 'helm-buffers)
|
|
|
|
|
(require 'helm-ring)
|
2018-01-28 11:06:37 +01:00
|
|
|
|
|
2020-11-21 11:29:07 +01:00
|
|
|
|
(if (require 'helm-global-bindings nil :no-error)
|
|
|
|
|
(progn
|
|
|
|
|
(bind-key "#" #'helm-emms helm-command-map)
|
|
|
|
|
(bind-key "P" #'helm-pages helm-command-map))
|
|
|
|
|
(warn (concat
|
|
|
|
|
"Cannot load `helm-global-bindings', please check your helm installation for completeness. "
|
|
|
|
|
"(Have you installed it from melpa?)")))
|
2020-08-27 11:49:42 +02:00
|
|
|
|
|
2018-08-04 12:33:15 +02:00
|
|
|
|
(bind-key "<tab>" #'helm-execute-persistent-action helm-map)
|
|
|
|
|
(bind-key "C-i" #'helm-execute-persistent-action helm-map)
|
2018-11-03 15:52:09 +01:00
|
|
|
|
(bind-key "C-z" #'helm-select-action helm-map)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2020-08-13 16:14:54 +02:00
|
|
|
|
(use-package helm-ring
|
|
|
|
|
:commands (helm-show-kill-ring))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package ivy
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:commands (ivy-mode
|
2017-08-12 00:18:42 +02:00
|
|
|
|
ivy-resume)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:diminish ivy-mode
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq ivy-use-virtual-buffers t
|
|
|
|
|
ivy-magic-tilde nil
|
|
|
|
|
ivy-count-format "(%d/%d) "
|
|
|
|
|
ivy-initial-inputs-alist '((counsel-describe-function . "^")
|
|
|
|
|
(counsel-describe-variable . "^")
|
|
|
|
|
(man . "^")
|
2018-11-04 19:15:57 +01:00
|
|
|
|
(woman . "^"))
|
2020-11-14 11:50:31 +01:00
|
|
|
|
ivy-use-selectable-prompt t
|
2021-01-02 16:16:46 +01:00
|
|
|
|
ivy-do-completion-in-region t
|
2021-01-02 16:19:15 +01:00
|
|
|
|
ivy-re-builders-alist '((t . ivy--regex-ignore-order)))
|
2021-01-02 16:33:23 +01:00
|
|
|
|
:config (progn
|
|
|
|
|
;; Since we are using `ivy--regex-ignore-order' for completion
|
|
|
|
|
;; anyway, providing the an individual restriction in the ivy buffer
|
|
|
|
|
;; is not necessary anymore. Since I often mistype S-SPC for SPC,
|
|
|
|
|
;; loosing the current candidate and annoying myself, removing this
|
|
|
|
|
;; shortcut is both helpful and not removing necessary
|
|
|
|
|
;; functionality.
|
|
|
|
|
(define-key ivy-minibuffer-map (kbd "S-SPC") nil)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2021-01-02 16:16:46 +01:00
|
|
|
|
(use-package ivy-hydra)
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package counsel
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:commands (counsel-org-goto-all
|
|
|
|
|
counsel-M-x
|
|
|
|
|
counsel-find-file
|
|
|
|
|
counsel-info-lookup-symbol
|
|
|
|
|
counsel-unicode-char
|
2020-01-03 10:24:15 +01:00
|
|
|
|
counsel-descbinds
|
2017-07-16 18:07:00 +02:00
|
|
|
|
counsel-describe-variable
|
2017-08-12 00:18:42 +02:00
|
|
|
|
counsel-describe-function
|
2019-12-20 11:26:19 +01:00
|
|
|
|
counsel-recentf
|
|
|
|
|
counsel-shell-history))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package swiper
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2018-01-27 17:31:50 +01:00
|
|
|
|
:commands (swiper
|
|
|
|
|
swiper-from-isearch))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package recentf
|
|
|
|
|
:commands (recentf-mode recentf-save-list)
|
2017-09-10 09:40:53 +02:00
|
|
|
|
:init (setq recentf-max-saved-items 1000)
|
|
|
|
|
:config (run-with-timer 0 3600 #'recentf-save-list))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package company
|
2018-08-04 12:32:29 +02:00
|
|
|
|
:commands (company-mode global-company-mode)
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq company-show-numbers t))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; * Navigation
|
|
|
|
|
|
2020-09-12 10:54:34 +02:00
|
|
|
|
(defun db/helm-shortcuts (arg)
|
|
|
|
|
"Open helm completion on common locations.
|
|
|
|
|
With given ARG, display files in `db/important-document-path’."
|
|
|
|
|
(interactive "p")
|
|
|
|
|
(require 'helm-bookmark)
|
|
|
|
|
(require 'helm-for-files) ; for helm-source-recentf
|
|
|
|
|
(helm :sources (list
|
|
|
|
|
(helm-make-source "Frequently Used" 'helm-source-sync
|
|
|
|
|
:candidates (mapcar #'(lambda (entry)
|
|
|
|
|
(cons (car entry)
|
|
|
|
|
(caddr entry)))
|
|
|
|
|
db/frequently-used-features)
|
|
|
|
|
:action '(("Open" . call-interactively))
|
|
|
|
|
:filtered-candidate-transformer #'helm-adaptive-sort)
|
|
|
|
|
|
|
|
|
|
;; taken from `helm-buffers-list'
|
|
|
|
|
(helm-make-source "Buffers" 'helm-source-buffers)
|
|
|
|
|
|
|
|
|
|
helm-source-recentf
|
|
|
|
|
|
|
|
|
|
;; if prefix arg is given, extract files from
|
|
|
|
|
;; `db/important-documents-path’ and list them as well
|
|
|
|
|
(when (and (= arg 4)
|
|
|
|
|
(file-directory-p db/important-documents-path))
|
|
|
|
|
(let ((search-path (expand-file-name db/important-documents-path)))
|
|
|
|
|
(helm-make-source "Important files" 'helm-source-sync
|
|
|
|
|
:candidates (mapcar #'(lambda (file)
|
|
|
|
|
;; display only relative path,
|
|
|
|
|
;; but keep absolute path for
|
|
|
|
|
;; actions
|
|
|
|
|
(cons (string-remove-prefix search-path file)
|
|
|
|
|
file))
|
|
|
|
|
(directory-files-recursively search-path ""))
|
|
|
|
|
:action '(("Open externally" . db/system-open)
|
|
|
|
|
("Find file" . find-file)))))
|
|
|
|
|
|
|
|
|
|
helm-source-bookmarks
|
|
|
|
|
|
|
|
|
|
helm-source-buffer-not-found
|
|
|
|
|
helm-source-bookmark-set)))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package ace-window
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:commands (ace-window ace-window-display-mode)
|
2018-11-03 18:55:20 +01:00
|
|
|
|
:init (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
|
2020-12-06 08:55:29 +01:00
|
|
|
|
aw-background t
|
2018-11-03 18:55:20 +01:00
|
|
|
|
aw-leading-char-style 'char
|
|
|
|
|
aw-scope 'frame))
|
2017-11-11 17:43:27 +01:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package avy
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:commands (avy-goto-char-timer
|
|
|
|
|
avy-goto-word-or-subword-1
|
|
|
|
|
avy-goto-line))
|
|
|
|
|
|
2020-09-12 11:14:37 +02:00
|
|
|
|
(use-package bm
|
2022-04-29 09:36:24 +02:00
|
|
|
|
;; Taken from https://protesilaos.com/dotemacs/ and adapted slightly
|
2020-09-12 11:14:37 +02:00
|
|
|
|
:ensure t
|
|
|
|
|
:commands (bm-toggle bm-next bm-previous bm-toggle-buffer-persistence)
|
|
|
|
|
:init (setq bm-restore-repository-on-load t
|
|
|
|
|
bm-annotate-on-create nil
|
|
|
|
|
bm-buffer-persistence t
|
|
|
|
|
bm-cycle-all-buffers t
|
|
|
|
|
bm-goto-position nil
|
|
|
|
|
bm-highlight-style 'bm-highlight-line-and-fringe
|
|
|
|
|
bm-marker 'bm-marker-right
|
|
|
|
|
bm-in-lifo-order nil
|
|
|
|
|
bm-recenter t
|
|
|
|
|
bm-repository-file "~/.emacs.d/bm-bookmarks"
|
|
|
|
|
bm-repository-size 100
|
|
|
|
|
bm-show-annotations t
|
|
|
|
|
bm-wrap-immediately t
|
2020-09-12 11:30:40 +02:00
|
|
|
|
bm-wrap-search t))
|
2020-09-12 11:14:37 +02:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package dumb-jump
|
2020-11-14 18:51:49 +01:00
|
|
|
|
:commands (dumb-jump-xref-activate)
|
|
|
|
|
:init (progn
|
|
|
|
|
(setq dumb-jump-selector 'helm)
|
|
|
|
|
(add-hook 'xref-backend-functions #'dumb-jump-xref-activate)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2018-08-04 12:32:43 +02:00
|
|
|
|
(use-package helm-pages
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2018-11-03 09:34:55 +01:00
|
|
|
|
:commands (helm-pages))
|
2018-08-04 12:32:43 +02:00
|
|
|
|
|
2020-09-12 11:01:42 +02:00
|
|
|
|
(use-package imenu
|
|
|
|
|
:init (setq imenu-use-markers t
|
|
|
|
|
imenu-auto-rescan t
|
|
|
|
|
imenu-auto-rescan-maxout 600000
|
|
|
|
|
imenu-max-item-length 100
|
|
|
|
|
imenu-use-popup-menu nil
|
|
|
|
|
imenu-eager-completion-buffer t))
|
|
|
|
|
|
2020-09-12 08:51:35 +02:00
|
|
|
|
(use-package goto-last-change
|
|
|
|
|
:commands goto-last-change)
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2017-08-06 12:45:37 +02:00
|
|
|
|
;; * Media
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2018-11-03 18:19:49 +01:00
|
|
|
|
(use-package emms
|
2019-12-21 18:39:07 +01:00
|
|
|
|
:pin "melpa-stable"
|
2018-11-03 18:19:49 +01:00
|
|
|
|
:commands (emms
|
|
|
|
|
emms-pause
|
2018-11-03 16:24:53 +01:00
|
|
|
|
emms-stop
|
|
|
|
|
emms-next
|
|
|
|
|
emms-previous)
|
2018-11-03 12:22:48 +01:00
|
|
|
|
:bind (:map emms-playlist-mode-map
|
|
|
|
|
("S s" . emms-shuffle))
|
|
|
|
|
:init (setq emms-source-file-default-directory "~/Documents/media/audio/"
|
|
|
|
|
emms-player-list '(emms-player-mplayer emms-player-mplayer-playlist)
|
|
|
|
|
emms-show-format "NP: %s"
|
2018-11-03 18:19:49 +01:00
|
|
|
|
emms-stream-default-action "play"
|
|
|
|
|
emms-track-description-function 'db/emms-track-description
|
2019-02-24 15:03:24 +01:00
|
|
|
|
emms-playlist-default-major-mode 'emms-playlist-mode
|
2019-02-24 18:24:59 +01:00
|
|
|
|
emms-cache-file (expand-file-name "private/emms/cache" emacs-d)
|
|
|
|
|
emms-history-file (expand-file-name "private/emms/history" emacs-d)
|
|
|
|
|
emms-score-file (expand-file-name "private/emms/scores" emacs-d)
|
|
|
|
|
emms-stream-bookmarks-file (expand-file-name "private/emms/streams" emacs-d))
|
2018-11-03 12:22:48 +01:00
|
|
|
|
:config (progn
|
|
|
|
|
|
2018-11-03 18:19:49 +01:00
|
|
|
|
;; Initialization copied and adapted from `emms-setup’
|
|
|
|
|
|
|
|
|
|
(require 'emms-source-file)
|
|
|
|
|
(require 'emms-source-playlist)
|
|
|
|
|
(require 'emms-player-simple)
|
|
|
|
|
(require 'emms-player-mplayer)
|
|
|
|
|
(require 'emms-playlist-mode)
|
|
|
|
|
(require 'emms-info)
|
|
|
|
|
(require 'emms-info-mp3info)
|
|
|
|
|
(require 'emms-info-ogginfo)
|
|
|
|
|
(require 'emms-info-opusinfo)
|
|
|
|
|
(require 'emms-cache)
|
|
|
|
|
(require 'emms-mode-line)
|
|
|
|
|
(require 'emms-mark)
|
|
|
|
|
(require 'emms-tag-editor)
|
|
|
|
|
(require 'emms-show-all)
|
|
|
|
|
(require 'emms-streams)
|
|
|
|
|
(require 'emms-playing-time)
|
|
|
|
|
(require 'emms-player-mpd)
|
|
|
|
|
(require 'emms-playlist-sort)
|
|
|
|
|
(require 'emms-browser)
|
|
|
|
|
(require 'emms-mode-line-icon)
|
|
|
|
|
(require 'emms-cue)
|
|
|
|
|
(require 'emms-bookmarks)
|
|
|
|
|
(require 'emms-last-played)
|
|
|
|
|
(require 'emms-metaplaylist-mode)
|
|
|
|
|
(require 'emms-stream-info)
|
|
|
|
|
(require 'emms-score)
|
|
|
|
|
(require 'emms-history)
|
|
|
|
|
(require 'emms-i18n)
|
|
|
|
|
(require 'emms-volume)
|
|
|
|
|
(require 'emms-playlist-limit)
|
|
|
|
|
|
|
|
|
|
(add-to-list 'emms-track-initialize-functions
|
|
|
|
|
'emms-info-initialize-track)
|
|
|
|
|
|
|
|
|
|
(if (require 'emms-info-mediainfo nil 'no-error)
|
|
|
|
|
(setq emms-info-functions '(emms-info-mediainfo))
|
|
|
|
|
(when (executable-find emms-info-mp3info-program-name)
|
|
|
|
|
(add-to-list 'emms-info-functions 'emms-info-mp3info))
|
|
|
|
|
(when (executable-find emms-info-ogginfo-program-name)
|
|
|
|
|
(add-to-list 'emms-info-functions 'emms-info-ogginfo))
|
|
|
|
|
(when (executable-find emms-info-opusinfo-program-name)
|
|
|
|
|
(add-to-list 'emms-info-functions 'emms-info-opusinfo))
|
|
|
|
|
(add-to-list 'emms-info-functions 'emms-info-cueinfo))
|
|
|
|
|
|
|
|
|
|
(when (fboundp 'emms-cache) ; work around compiler warning
|
|
|
|
|
(emms-cache 1))
|
|
|
|
|
(emms-mode-line -1)
|
|
|
|
|
(emms-playing-time 1)
|
|
|
|
|
(emms-score 1)
|
|
|
|
|
|
|
|
|
|
(add-hook 'emms-player-started-hook 'emms-last-played-update-current)
|
|
|
|
|
(add-hook 'emms-player-started-hook 'emms-show)
|
2018-11-03 16:56:42 +01:00
|
|
|
|
|
2018-11-03 12:22:48 +01:00
|
|
|
|
(advice-add 'emms-tag-editor-submit
|
2022-05-22 17:37:33 +02:00
|
|
|
|
:after #'(lambda (&rest r)
|
|
|
|
|
(ignore r)
|
|
|
|
|
(delete-window)))
|
2018-11-03 12:22:48 +01:00
|
|
|
|
|
|
|
|
|
(unless (eq system-type 'windows-nt)
|
|
|
|
|
(setq emms-source-file-directory-tree-function
|
|
|
|
|
#'db/emms-source-file-directory-tree-find))
|
|
|
|
|
|
2018-11-03 18:29:06 +01:00
|
|
|
|
;; `emms-playlist-mode’ sets `emms-playlist-insert-track-function’,
|
|
|
|
|
;; no matter what previous values or customization may say otherwise
|
|
|
|
|
;; … so we need to employ a hook to change its value
|
2018-11-03 12:22:48 +01:00
|
|
|
|
(add-hook 'emms-playlist-mode-hook
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(setq emms-playlist-insert-track-function
|
|
|
|
|
#'db/emms-playlist-mode-insert-track)))
|
2018-11-03 18:19:49 +01:00
|
|
|
|
|
|
|
|
|
(run-with-timer 0 3600 #'emms-cache-save)))
|
2018-11-03 12:22:48 +01:00
|
|
|
|
|
2018-11-03 12:28:13 +01:00
|
|
|
|
;; Make sure emms is up and running when we call functions such as
|
|
|
|
|
;; `emms-play-dired’ etc.
|
2018-07-13 19:11:26 +02:00
|
|
|
|
(use-package emms-source-file
|
2018-11-03 18:19:49 +01:00
|
|
|
|
:config (require 'emms))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2018-07-13 19:11:26 +02:00
|
|
|
|
(use-package db-emms
|
2019-03-02 13:37:05 +01:00
|
|
|
|
:commands (db/emms-source-file-directory-tree-find
|
2018-11-03 12:22:48 +01:00
|
|
|
|
db/emms-track-description
|
2020-06-27 10:16:53 +02:00
|
|
|
|
db/emms-playlist-mode-insert-track))
|
2018-07-13 19:11:26 +02:00
|
|
|
|
|
2020-11-14 17:09:00 +01:00
|
|
|
|
(use-package helm-emms
|
|
|
|
|
:commands (helm-emms)
|
2020-11-17 09:14:34 +01:00
|
|
|
|
:init (setq helm-emms-use-track-description-function t
|
|
|
|
|
helm-emms-default-sources '(helm-source-emms-streams
|
|
|
|
|
helm-source-emms-dired
|
|
|
|
|
helm-source-emms-files))
|
2020-11-14 17:09:00 +01:00
|
|
|
|
:config (progn
|
|
|
|
|
(require 'emms)
|
|
|
|
|
(require 'helm-adaptive)))
|
|
|
|
|
|
2019-03-02 13:37:05 +01:00
|
|
|
|
(use-package db-music
|
2019-06-10 14:11:52 +02:00
|
|
|
|
:init (setq db/auto-playlist-file-function
|
|
|
|
|
#'(lambda ()
|
|
|
|
|
(db/playlist-files-from-git-annex-find
|
|
|
|
|
"--metadata db-playlist=include")))
|
|
|
|
|
:commands (db/play-auto-playlist
|
|
|
|
|
db/playlist-files-from-git-annex-find
|
2020-06-27 10:16:53 +02:00
|
|
|
|
db/play-auto-playlist-from-git-annex-find
|
2020-08-12 21:57:48 +02:00
|
|
|
|
music-control/body
|
2020-10-02 19:52:57 +02:00
|
|
|
|
db/update-playlist-files))
|
2019-03-02 13:37:05 +01:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;; * Shells and such
|
|
|
|
|
|
|
|
|
|
(use-package comint
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq comint-scroll-to-bottom-on-input t
|
|
|
|
|
comint-scroll-to-bottom-on-output nil
|
|
|
|
|
comint-scroll-show-maximum-output t
|
|
|
|
|
comint-completion-addsuffix t
|
|
|
|
|
comint-buffer-maximum-size 100000
|
2020-08-26 17:27:51 +02:00
|
|
|
|
comint-input-ring-size 5000)
|
|
|
|
|
:config (progn
|
|
|
|
|
;; Never let bash know that we are inside Emacs;
|
|
|
|
|
;; cf. https://coredumped.dev/2020/01/04/native-shell-completion-in-emacs/
|
|
|
|
|
(advice-add 'comint-term-environment
|
|
|
|
|
:filter-return #'(lambda (env) (cons "INSIDE_EMACS" env)))))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package term
|
|
|
|
|
:commands (term-send-string)
|
2020-07-25 11:20:55 +02:00
|
|
|
|
:init (setq explicit-shell-file-name "/bin/bash")
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:config (progn
|
|
|
|
|
(add-hook 'term-exec-hook ; oremacs.com
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(let* ((buff (current-buffer))
|
|
|
|
|
(proc (get-buffer-process buff)))
|
|
|
|
|
(set-process-sentinel
|
|
|
|
|
proc
|
|
|
|
|
`(lambda (process event)
|
|
|
|
|
(if (string= event "finished\n")
|
|
|
|
|
(kill-buffer ,buff)))))))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;; does not work; C-c is shadowed by some minor modes like semantic,
|
|
|
|
|
;; projectile, and winner
|
2018-08-04 12:33:15 +02:00
|
|
|
|
(bind-key "C-c" #'term-send-raw term-raw-map)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;; unbind some keys to allow the global keymap to handle them
|
|
|
|
|
(unbind-key "M-:" term-raw-map)
|
|
|
|
|
(unbind-key "C-h" term-raw-map)
|
|
|
|
|
(unbind-key "M-x" term-raw-map)
|
|
|
|
|
(unbind-key "M-o" term-raw-map)
|
|
|
|
|
|
|
|
|
|
;; we need to set keys starting with C-x after `ansi-term' has been
|
|
|
|
|
;; called, as it resets the escape character to C-x.
|
|
|
|
|
(defadvice ansi-term (after ansi-term-set-keys activate)
|
|
|
|
|
(unbind-key "C-x C-j" term-raw-map)
|
2018-01-27 17:49:55 +01:00
|
|
|
|
(unbind-key "C-x g" term-raw-map))
|
|
|
|
|
|
2022-05-22 17:37:33 +02:00
|
|
|
|
(add-hook 'term-mode-hook #'(lambda () (yas-minor-mode -1)))))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package ansi-color
|
2018-01-27 17:31:50 +01:00
|
|
|
|
:commands (ansi-color-for-comint-mode-on
|
2018-01-27 17:50:27 +01:00
|
|
|
|
ansi-color-apply-on-region)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:config (progn
|
2018-01-27 17:48:27 +01:00
|
|
|
|
(add-hook 'compilation-filter-hook 'endless/colorize-compilation)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package shell
|
2018-01-14 10:09:44 +01:00
|
|
|
|
:commands (shell)
|
2019-12-20 11:26:19 +01:00
|
|
|
|
:bind (:map shell-mode-map
|
|
|
|
|
("C-r" . counsel-shell-history))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:config (progn
|
|
|
|
|
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
|
2018-01-14 10:09:44 +01:00
|
|
|
|
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)
|
2020-08-26 19:45:34 +02:00
|
|
|
|
(add-hook 'shell-mode-hook 'with-editor-export-editor)
|
|
|
|
|
|
|
|
|
|
;; We may want to use readline support in bash, don't inhibit this
|
|
|
|
|
;; with explicit command line arguments;
|
|
|
|
|
;; cf. https://coredumped.dev/2020/01/04/native-shell-completion-in-emacs/
|
2021-04-16 15:18:03 +02:00
|
|
|
|
|
2020-08-26 19:45:34 +02:00
|
|
|
|
(setq explicit-bash-args
|
2021-04-16 15:18:03 +02:00
|
|
|
|
(delete "--noediting" explicit-bash-args))
|
|
|
|
|
|
|
|
|
|
;; When doing completion, ivy seems to add an extra space, much like
|
|
|
|
|
;; in the case for eshell. However, here the space seems to come
|
|
|
|
|
;; out of nowhere. Since the builtin completion using
|
|
|
|
|
;; `completion--in-region' is good enough for the shell mode, let's
|
|
|
|
|
;; stick to that.
|
|
|
|
|
|
|
|
|
|
(add-hook 'shell-mode-hook
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(setq-local completion-in-region-function
|
|
|
|
|
#'completion--in-region)))))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2018-11-03 12:01:34 +01:00
|
|
|
|
(use-package db-eshell
|
2020-06-26 23:08:00 +02:00
|
|
|
|
:commands (db/run-or-hide-eshell
|
|
|
|
|
eshell-clear-buffer
|
2018-11-03 12:01:34 +01:00
|
|
|
|
eshell/default-prompt-function
|
|
|
|
|
eshell/gst
|
|
|
|
|
eshell-insert-history
|
|
|
|
|
pcomplete/git))
|
|
|
|
|
|
2017-09-10 09:41:16 +02:00
|
|
|
|
(use-package eshell
|
|
|
|
|
:commands (eshell)
|
2018-11-03 12:01:34 +01:00
|
|
|
|
:init (setq eshell-cmpl-cycle-completions nil
|
|
|
|
|
eshell-scroll-to-bottom-on-input t
|
|
|
|
|
eshell-prefer-lisp-functions nil
|
2022-06-04 15:24:13 +02:00
|
|
|
|
eshell-error-if-no-glob nil
|
2018-11-03 12:01:34 +01:00
|
|
|
|
eshell-hist-ignoredups t
|
|
|
|
|
eshell-save-history-on-exit t
|
2020-11-07 09:01:17 +01:00
|
|
|
|
eshell-history-size 5000
|
2018-11-03 12:01:34 +01:00
|
|
|
|
eshell-destroy-buffer-when-process-dies t
|
|
|
|
|
eshell-prompt-function #'eshell/default-prompt-function
|
|
|
|
|
eshell-prompt-regexp "└─[$#] "
|
2020-09-12 10:40:42 +02:00
|
|
|
|
eshell-highlight-prompt nil
|
2020-11-14 15:17:56 +01:00
|
|
|
|
eshell-cd-on-directory t
|
|
|
|
|
eshell-expand-input-functions '(eshell-expand-history-references))
|
2018-11-03 12:01:34 +01:00
|
|
|
|
:config (progn (require 'em-prompt)
|
|
|
|
|
(require 'em-term)
|
|
|
|
|
(require 'em-cmpl)
|
2022-04-29 07:42:39 +02:00
|
|
|
|
(require 'em-hist)
|
2018-11-03 12:01:34 +01:00
|
|
|
|
|
|
|
|
|
(setenv "PAGER" "cat")
|
|
|
|
|
|
|
|
|
|
(add-to-list 'eshell-command-completions-alist
|
|
|
|
|
'("gunzip" "gz\\'"))
|
|
|
|
|
|
|
|
|
|
(add-to-list 'eshell-command-completions-alist
|
|
|
|
|
'("tar" "\\(\\.tar|\\.tgz\\|\\.tar\\.gz\\)\\'"))
|
|
|
|
|
|
|
|
|
|
(add-hook 'eshell-mode-hook
|
|
|
|
|
'with-editor-export-editor)
|
|
|
|
|
|
2022-04-29 07:42:39 +02:00
|
|
|
|
(if (<= emacs-major-version 27)
|
|
|
|
|
(add-hook 'eshell-mode-hook
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(bind-key "C-a" #'eshell-bol eshell-mode-map)
|
|
|
|
|
(bind-key "M-r" #'eshell-insert-history eshell-mode-map)
|
|
|
|
|
(bind-key "M-P" #'eshell-previous-prompt eshell-mode-map)
|
|
|
|
|
(bind-key "M-N" #'eshell-next-prompt eshell-mode-map)))
|
2022-04-29 07:42:39 +02:00
|
|
|
|
;; In Emacs 28.1, eshell's mode maps have been refactored to
|
|
|
|
|
;; follow standard extensibility. There's thus no need
|
|
|
|
|
;; anymore to use the special hook construction.
|
|
|
|
|
(progn
|
|
|
|
|
(bind-key "C-a" #'eshell-bol eshell-mode-map)
|
|
|
|
|
(bind-key "M-r" #'eshell-insert-history eshell-hist-mode-map)
|
|
|
|
|
(bind-key "M-P" #'eshell-previous-prompt eshell-mode-map)
|
|
|
|
|
(bind-key "M-N" #'eshell-next-prompt eshell-mode-map)))
|
2018-11-03 12:01:34 +01:00
|
|
|
|
|
|
|
|
|
;; Ignoring case when completing file names seems to have a
|
|
|
|
|
;; bug: when a ~ is encountered, it is implicitly expaned by
|
|
|
|
|
;; `pcomplete-insert-entry’, overwriting the prompt as a side
|
|
|
|
|
;; effect. Keeping the case as it is does not seem to have
|
|
|
|
|
;; this issue. This problem occurs by default only on Windows
|
|
|
|
|
;; systems (in all flavors), because this is the only time
|
|
|
|
|
;; `pcomplete-ignore-case’ is non-nil by default.
|
|
|
|
|
(when on-windows
|
|
|
|
|
(add-to-list 'eshell-mode-hook
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(setq pcomplete-ignore-case nil))))
|
2018-11-03 12:01:34 +01:00
|
|
|
|
|
2020-11-19 19:43:28 +01:00
|
|
|
|
;; Sometimes, when completing path names and immediately
|
|
|
|
|
;; hitting RET, `completion-in-region-mode' still seems to be
|
|
|
|
|
;; active; this often happens when calling cd. Then,
|
|
|
|
|
;; `post-command-hook' still contains
|
|
|
|
|
;; `completion-in-region--postch', which calls some `pcomplete'
|
|
|
|
|
;; function to determine whether completion mode should exit.
|
|
|
|
|
;; However, after RET (i.e., `eshell-send-input'), we only have
|
|
|
|
|
;; an empty prompt, and `pcomplete' just computes all possible
|
|
|
|
|
;; functions for completion (doesn't show it, though). This
|
|
|
|
|
;; introduces a noticeable amount of delay, which is annoying.
|
|
|
|
|
;; Expliticly disabling `completion-in-region-mode' before
|
|
|
|
|
;; sending input seems to alleviate the problem.
|
|
|
|
|
(advice-add 'eshell-send-input
|
|
|
|
|
:before #'(lambda (&rest _)
|
|
|
|
|
"Disable completion-in-region-mode before sending input."
|
|
|
|
|
(when completion-in-region-mode
|
|
|
|
|
(completion-in-region-mode -1))))
|
2018-11-03 12:01:34 +01:00
|
|
|
|
|
2021-04-16 14:23:32 +02:00
|
|
|
|
;; After completing partial inputs, pcomplete wants to add an
|
|
|
|
|
;; extra character stored in `pcomplete-termination-string',
|
|
|
|
|
;; which is a space by default. When completing paths, this
|
|
|
|
|
;; leads to spaces being inserted after every directory within
|
|
|
|
|
;; the path, which is annoying. We thus set the value of this
|
|
|
|
|
;; variable locally to an empty string, thus silencing this
|
|
|
|
|
;; bug. A better way to handle this would be to correctly
|
|
|
|
|
;; determine whether the completion is not done yet, by passing
|
|
|
|
|
;; `exact' instead of `finished' to the handlers stored in
|
|
|
|
|
;; `completion-extra-properties'.
|
|
|
|
|
|
|
|
|
|
(defun db/set-empty-pcomplete-termination-string ()
|
|
|
|
|
"Locally set `pcomplete-termination-string' to the empty string."
|
|
|
|
|
(setq-local pcomplete-termination-string ""))
|
|
|
|
|
|
|
|
|
|
(add-hook 'eshell-mode-hook
|
|
|
|
|
#'db/set-empty-pcomplete-termination-string)
|
|
|
|
|
|
2018-11-03 12:01:34 +01:00
|
|
|
|
(require 'db-eshell)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2018-01-14 10:09:44 +01:00
|
|
|
|
(use-package with-editor
|
|
|
|
|
:commands (with-editor-export-editor))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;; * Lisp
|
|
|
|
|
|
|
|
|
|
;; General Stuff first
|
|
|
|
|
|
2020-09-12 11:31:05 +02:00
|
|
|
|
(use-package lisp-mode
|
2022-08-05 09:14:50 +02:00
|
|
|
|
:init (setq lisp-indent-function #'common-lisp-indent-function))
|
2020-09-12 11:31:05 +02:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package lispy
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2018-01-13 14:19:12 +01:00
|
|
|
|
:commands (lispy-mode)
|
|
|
|
|
:diminish lispy-mode)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package eldoc
|
2019-02-09 14:05:29 +01:00
|
|
|
|
:commands (global-eldoc-mode
|
|
|
|
|
turn-on-eldoc-mode)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:diminish eldoc-mode)
|
|
|
|
|
|
|
|
|
|
;; Lisp Dialects
|
|
|
|
|
|
|
|
|
|
(use-package elisp-mode
|
2020-11-14 18:41:29 +01:00
|
|
|
|
:config (progn
|
|
|
|
|
(add-hook 'emacs-lisp-mode-hook 'turn-on-lispy-when-available)
|
2020-11-28 08:50:47 +01:00
|
|
|
|
(add-hook 'emacs-lisp-mode-hook 'turn-on-flycheck-when-file)))
|
2018-01-27 17:30:43 +01:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package geiser
|
|
|
|
|
:commands (geiser-mode))
|
|
|
|
|
|
|
|
|
|
(use-package cider
|
|
|
|
|
:commands (cider-jack-in)
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq nrepl-hide-special-buffers t
|
|
|
|
|
cider-auto-select-error-buffer t
|
|
|
|
|
cider-stacktrace-default-filters '(tooling dup)
|
|
|
|
|
cider-stacktrace-fill-column 80
|
|
|
|
|
cider-save-file-on-load nil
|
|
|
|
|
cider-repl-result-prefix ";; => "
|
|
|
|
|
cider-repl-use-clojure-font-lock t
|
|
|
|
|
cider-repl-wrap-history t
|
|
|
|
|
cider-repl-history-size 1000
|
|
|
|
|
;;cider-lein-parameters "trampoline repl :headless"
|
|
|
|
|
cider-lein-parameters "repl :headless"
|
|
|
|
|
cider-repl-history-file (expand-file-name ".cider-history" emacs-d)
|
2020-11-14 21:06:22 +01:00
|
|
|
|
cider-repl-display-help-banner nil)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:config (progn
|
2018-01-27 17:48:27 +01:00
|
|
|
|
(add-hook 'cider-repl-mode-hook 'subword-mode)
|
2019-03-02 11:14:37 +01:00
|
|
|
|
(add-hook 'cider-repl-mode-hook 'turn-on-lispy-when-available)
|
2018-01-27 17:48:27 +01:00
|
|
|
|
(add-hook 'cider-repl-mode-hook 'cider-repl-toggle-pretty-printing)
|
2019-02-09 14:05:29 +01:00
|
|
|
|
(add-hook 'cider-repl-mode-hook 'company-mode)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package clojure-mode
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:config (progn
|
|
|
|
|
(define-clojure-indent
|
2022-08-05 09:15:33 +02:00
|
|
|
|
(forall 'defun)
|
|
|
|
|
(exists 'defun)
|
2018-11-02 18:17:51 +01:00
|
|
|
|
(dopar 'defun))
|
2019-03-02 11:14:37 +01:00
|
|
|
|
(add-hook 'clojure-mode-hook 'turn-on-lispy-when-available)
|
2018-11-02 18:17:51 +01:00
|
|
|
|
(add-hook 'clojure-mode-hook 'clj-refactor-mode)
|
|
|
|
|
(add-hook 'clojure-mode-hook 'company-mode)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package clj-refactor
|
|
|
|
|
:commands (clj-refactor-mode)
|
|
|
|
|
:config (progn
|
|
|
|
|
(cljr-add-keybindings-with-prefix "C-c C-m")
|
|
|
|
|
(setq cljr-eagerly-build-asts-on-startup nil
|
|
|
|
|
cljr-warn-on-eval nil)))
|
|
|
|
|
|
|
|
|
|
(use-package slime
|
|
|
|
|
:commands (slime slime-mode slime-connect)
|
|
|
|
|
:init (progn
|
2018-11-02 18:17:51 +01:00
|
|
|
|
(setq inferior-lisp-program "sbcl --noinform --no-linedit"
|
|
|
|
|
slime-compile-file-options '(:fasl-directory "/tmp/slime-fasls/")
|
|
|
|
|
slime-net-coding-system 'utf-8-unix
|
|
|
|
|
slime-completion-at-point-functions 'slime-fuzzy-complete-symbol
|
|
|
|
|
slime-lisp-implementations '((sbcl ("sbcl") :coding-system utf-8-unix)
|
|
|
|
|
(cmucl ("cmucl") :coding-system utf-8-unix)
|
|
|
|
|
(ccl ("ccl") :coding-system utf-8-unix))
|
|
|
|
|
slime-repl-history-remove-duplicates t
|
|
|
|
|
slime-repl-history-trim-whitespaces t)
|
2022-05-22 17:37:33 +02:00
|
|
|
|
(add-hook 'lisp-mode-hook #'(lambda () (slime-mode +1)) t))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:config (progn
|
|
|
|
|
(make-directory "/tmp/slime-fasls/" t)
|
|
|
|
|
(slime-setup '(slime-repl slime-fancy slime-autodoc))
|
2018-11-02 18:17:51 +01:00
|
|
|
|
(add-hook 'slime-mode-hook 'slime-redirect-inferior-output)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package hy-mode
|
2018-01-27 17:30:43 +01:00
|
|
|
|
:commands (hy-mode)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:config (progn
|
2019-03-02 11:14:37 +01:00
|
|
|
|
(add-hook 'hy-mode-hook 'turn-on-lispy-when-available)
|
2018-01-27 17:48:27 +01:00
|
|
|
|
(add-hook 'hy-mode-hook 'inferior-lisp)))
|
2018-01-27 17:30:43 +01:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;; * TeX
|
|
|
|
|
|
|
|
|
|
(use-package reftex
|
|
|
|
|
:commands (turn-on-reftex)
|
2018-11-03 12:43:58 +01:00
|
|
|
|
:init (setq reftex-plug-into-AUCTeX t)
|
|
|
|
|
:config (with-eval-after-load 'helm-mode
|
|
|
|
|
(add-to-list 'helm-completing-read-handlers-alist
|
|
|
|
|
'(reftex-citation . nil))))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2018-09-06 20:18:01 +02:00
|
|
|
|
(use-package tex
|
2018-11-03 12:43:58 +01:00
|
|
|
|
:init (setq TeX-auto-save t
|
|
|
|
|
TeX-save-query nil
|
|
|
|
|
TeX-parse-self t
|
|
|
|
|
TeX-master t
|
|
|
|
|
TeX-electric-sub-and-superscript t
|
|
|
|
|
TeX-electric-math '("$" . "$")
|
|
|
|
|
TeX-electric-escape nil
|
|
|
|
|
LaTeX-electric-left-right-brace t
|
|
|
|
|
LaTeX-fill-break-at-separators nil
|
|
|
|
|
TeX-fold-math-spec-list '(("≤" ("le"))
|
|
|
|
|
("≥" ("ge"))
|
|
|
|
|
("∉" ("notin")))
|
|
|
|
|
|
|
|
|
|
TeX-source-correlate-start-server nil
|
|
|
|
|
|
|
|
|
|
LaTeX-eqnarray-label "eqn:"
|
|
|
|
|
LaTeX-equation-label "eqn:"
|
|
|
|
|
LaTeX-figure-label "fig:"
|
|
|
|
|
LaTeX-table-label "tab:"
|
|
|
|
|
TeX-newline-function 'reindent-then-newline-and-indent
|
|
|
|
|
LaTeX-section-hook '(LaTeX-section-heading
|
|
|
|
|
LaTeX-section-title
|
|
|
|
|
LaTeX-section-section
|
|
|
|
|
LaTeX-section-label))
|
|
|
|
|
:config (progn
|
|
|
|
|
|
|
|
|
|
(require 'latex)
|
|
|
|
|
(require 'tex-buf)
|
|
|
|
|
(require 'reftex)
|
|
|
|
|
|
|
|
|
|
(TeX-engine-set 'default)
|
|
|
|
|
|
|
|
|
|
(put 'TeX-narrow-to-group 'disabled nil)
|
|
|
|
|
(put 'LaTeX-narrow-to-environment 'disabled nil)
|
|
|
|
|
|
|
|
|
|
(add-hook 'LaTeX-mode-hook #'turn-on-flyspell)
|
|
|
|
|
(add-hook 'LaTeX-mode-hook #'turn-on-visual-line-mode)
|
|
|
|
|
(add-hook 'LaTeX-mode-hook #'LaTeX-math-mode)
|
|
|
|
|
(add-hook 'LaTeX-mode-hook #'outline-minor-mode)
|
|
|
|
|
(add-hook 'LaTeX-mode-hook #'page-break-lines-mode)
|
|
|
|
|
(add-hook 'LaTeX-mode-hook #'turn-on-reftex)
|
|
|
|
|
(add-hook 'latex-mode-hook #'turn-on-reftex)
|
|
|
|
|
|
2022-05-22 17:37:33 +02:00
|
|
|
|
(add-hook 'LaTeX-mode-hook #'(lambda ()
|
|
|
|
|
(TeX-PDF-mode 1)
|
|
|
|
|
(TeX-source-correlate-mode 1)
|
|
|
|
|
(TeX-fold-mode 1)))
|
2018-11-03 12:43:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(add-to-list 'TeX-view-program-selection
|
|
|
|
|
'(output-pdf "Evince"))
|
|
|
|
|
|
|
|
|
|
;; style used for my personal definitions; not clear whether this
|
|
|
|
|
;; works as intended
|
|
|
|
|
(TeX-add-style-hook
|
|
|
|
|
"mydefs"
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(TeX-run-style-hooks "etex"
|
|
|
|
|
"etoolbox"
|
|
|
|
|
"ifthen"
|
|
|
|
|
"amsmath"
|
|
|
|
|
"amssymb"
|
|
|
|
|
"latexsym"
|
|
|
|
|
"mathabx"
|
|
|
|
|
"stmaryrd"
|
|
|
|
|
"verbatim"
|
|
|
|
|
"graphicx"
|
|
|
|
|
"enumerate"
|
|
|
|
|
"array"
|
|
|
|
|
"booktabs"
|
|
|
|
|
"ulem"
|
|
|
|
|
"nicefrac"
|
|
|
|
|
"listings"
|
|
|
|
|
"microtype"
|
|
|
|
|
"tabularx"
|
|
|
|
|
"tikz"
|
|
|
|
|
"csquotes"
|
|
|
|
|
"ntheorem"
|
|
|
|
|
"xspace")
|
|
|
|
|
(LaTeX-add-environments
|
|
|
|
|
'("Exercise" LaTeX-env-label)
|
|
|
|
|
'("Theorem" LaTeX-env-label)
|
|
|
|
|
'("Proposition" LaTeX-env-label)
|
|
|
|
|
'("Lemma" LaTeX-env-label)
|
|
|
|
|
'("Corollary" LaTeX-env-label)
|
|
|
|
|
'("Remark" LaTeX-env-label)
|
|
|
|
|
'("Example" LaTeX-env-label)
|
|
|
|
|
'("Definition" LaTeX-env-label)
|
|
|
|
|
'("Proof" LaTeX-env-label))
|
|
|
|
|
|
|
|
|
|
;; https://tex.stackexchange.com/questions/217799/auctex-11-88-bug-on-latex-env-label-cannot-automatically-insert-label
|
|
|
|
|
(setf (cadr reftex-insert-label-flags)
|
|
|
|
|
(concat (cadr reftex-insert-label-flags) "TLPDRCE"))
|
|
|
|
|
|
|
|
|
|
(dolist (label-spec
|
2022-08-05 09:15:33 +02:00
|
|
|
|
'(("Theorem" ?T "thm:" "~\\ref{%s}" t ("Theorem" "Thm.") nil)
|
|
|
|
|
("Lemma" ?L "lem:" "~\\ref{%s}" t ("Lemma" "Lem.") nil)
|
|
|
|
|
("Proposition" ?P "prop:" "~\\ref{%s}" t ("Proposition" "Prop.") nil)
|
|
|
|
|
("Satz" ?T "thm:" "~\\ref{%s}" t ("Satz") nil)
|
|
|
|
|
("Definition" ?D "def:" "~\\ref{%s}" t ("Definition" "Def.") nil)
|
|
|
|
|
("Remark" ?R "rem:" "~\\ref{%s}" t ("Remark" "Rem.") nil)
|
|
|
|
|
("Corollary" ?C "cor:" "~\\ref{%s}" t ("Corollary" "Cor.") nil)
|
|
|
|
|
("Example" ?E "expl:" "~\\ref{%s}" t ("Example") nil)))
|
2022-05-22 17:37:33 +02:00
|
|
|
|
(add-to-list 'reftex-label-alist label-spec)
|
|
|
|
|
(add-to-list 'LaTeX-label-alist (cons (nth 0 label-spec)
|
|
|
|
|
(nth 2 label-spec))))))
|
2018-11-03 12:43:58 +01:00
|
|
|
|
|
|
|
|
|
;; Add completion for cleverref’s reference macros; not clear
|
|
|
|
|
;; whether this works as intended
|
|
|
|
|
(TeX-add-style-hook
|
|
|
|
|
"cleveref"
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(add-to-list 'reftex-ref-style-alist
|
|
|
|
|
'("Cleveref" "cleveref"
|
|
|
|
|
(("\\cref" ?c) ("\\Cref" ?C)
|
|
|
|
|
("\\cpageref" ?d) ("\\Cpageref" ?D))))
|
|
|
|
|
(reftex-ref-style-activate "Cleveref")
|
|
|
|
|
(TeX-add-symbols
|
|
|
|
|
'("cref" TeX-arg-ref)
|
|
|
|
|
'("Cref" TeX-arg-ref)
|
|
|
|
|
'("cpageref" TeX-arg-ref)
|
|
|
|
|
'("Cpageref" TeX-arg-ref))))
|
2018-11-03 12:43:58 +01:00
|
|
|
|
|
|
|
|
|
;; Language definitions
|
|
|
|
|
(add-hook 'TeX-language-de-hook
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda () (ispell-change-dictionary "de_DE")))
|
2018-11-03 12:43:58 +01:00
|
|
|
|
(add-hook 'TeX-language-en-hook
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda () (ispell-change-dictionary "en_US")))
|
2018-11-03 12:43:58 +01:00
|
|
|
|
(add-hook 'TeX-mode-hook
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda () (setq ispell-parser 'tex)))))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2019-12-17 13:10:04 +01:00
|
|
|
|
|
|
|
|
|
;; * Various Mode Configurations
|
|
|
|
|
|
|
|
|
|
;; These are packages that are not essential, but still nice to have. They
|
|
|
|
|
;; provide optional functionality and may redefine builtin commands.
|
|
|
|
|
|
2017-07-31 13:21:08 +02:00
|
|
|
|
(use-package cperl-mode
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2017-07-31 13:21:08 +02:00
|
|
|
|
:commands (cperl-mode)
|
2017-07-31 14:27:49 +02:00
|
|
|
|
:init (progn
|
2017-08-01 12:17:16 +02:00
|
|
|
|
;; replace perl-mode with cperl-mode
|
2017-07-31 14:27:49 +02:00
|
|
|
|
(mapc
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda (pair)
|
|
|
|
|
(if (eq (cdr pair) 'perl-mode)
|
|
|
|
|
(setcdr pair 'cperl-mode)))
|
2018-11-02 18:17:51 +01:00
|
|
|
|
(append auto-mode-alist interpreter-mode-alist))
|
2020-02-20 21:21:47 +01:00
|
|
|
|
|
|
|
|
|
(setq cperl-hairy nil
|
|
|
|
|
cperl-invalid-face 'default
|
|
|
|
|
cperl-electric-keywords nil
|
2020-02-20 21:26:59 +01:00
|
|
|
|
cperl-lazy-help-time 2
|
2021-09-25 20:48:05 +02:00
|
|
|
|
cperl-highlight-variables-indiscriminately t
|
|
|
|
|
cperl-indent-parens-as-block t))
|
2017-07-31 13:21:08 +02:00
|
|
|
|
:config (progn
|
|
|
|
|
(add-hook 'cperl-mode-hook 'flycheck-mode)
|
2020-02-20 21:21:47 +01:00
|
|
|
|
(add-hook 'cperl-mode-hook 'prettify-symbols-mode)
|
|
|
|
|
|
|
|
|
|
;; enable display of help messages after a short period of time, as
|
|
|
|
|
;; controlled by the value of `cperl-lazy-help-time'
|
|
|
|
|
(add-hook 'cperl-mode-hook 'cperl-lazy-install)))
|
2017-07-31 13:21:08 +02:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package define-word
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:commands (define-word-at-point define-word))
|
|
|
|
|
|
|
|
|
|
(use-package dictcc
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2017-11-17 08:02:49 +01:00
|
|
|
|
:commands (dictcc)
|
|
|
|
|
:config (require 'gnutls))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package edit-list
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:commands edit-list)
|
|
|
|
|
|
2020-09-12 11:49:37 +02:00
|
|
|
|
(use-package expand-region
|
|
|
|
|
:ensure t
|
|
|
|
|
:commands (er/expand-region))
|
2017-09-08 17:44:35 +02:00
|
|
|
|
|
2019-09-15 11:22:21 +02:00
|
|
|
|
(use-package eproject
|
2019-12-17 13:10:23 +01:00
|
|
|
|
;; This configuration is only present to inhibit eproject overriding
|
|
|
|
|
;; keybindings in `message-mode'
|
2019-09-15 11:22:21 +02:00
|
|
|
|
:config (progn
|
|
|
|
|
(message "Loaded eproject … done")
|
|
|
|
|
(with-eval-after-load 'message
|
|
|
|
|
(add-hook 'message-setup-hook
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(eproject-mode -1))))))
|
2019-09-15 11:22:21 +02:00
|
|
|
|
|
2019-02-24 18:24:59 +01:00
|
|
|
|
(use-package eww
|
2019-11-11 18:24:19 +01:00
|
|
|
|
:init (setq eww-bookmarks-directory
|
|
|
|
|
(expand-file-name "private/" emacs-d)))
|
2019-02-24 18:24:59 +01:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package haskell-mode
|
|
|
|
|
:config (progn
|
|
|
|
|
(add-hook 'haskell-mode-hook 'haskell-doc-mode)
|
|
|
|
|
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
|
|
|
|
|
(add-hook 'haskell-mode-hook
|
2022-05-22 17:37:33 +02:00
|
|
|
|
#'(lambda ()
|
|
|
|
|
(company-mode 1)
|
|
|
|
|
(set (make-local-variable 'company-backends)
|
|
|
|
|
(append '((company-capf company-dabbrev-code))
|
|
|
|
|
company-backends))))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(add-hook 'haskell-mode-hook 'flycheck-mode)
|
|
|
|
|
|
2018-09-07 17:46:22 +02:00
|
|
|
|
(with-demoted-errors "Non-Fatal Error: %s"
|
|
|
|
|
(require 'haskell-indentation)
|
|
|
|
|
(add-hook 'haskell-mode-hook
|
|
|
|
|
'haskell-indentation-mode))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(add-hook 'haskell-mode-hook
|
|
|
|
|
'interactive-haskell-mode)))
|
|
|
|
|
|
2019-11-11 18:24:30 +01:00
|
|
|
|
(use-package markdown-mode
|
|
|
|
|
:ensure t
|
|
|
|
|
:commands (markdown-mode)
|
2020-12-20 17:29:14 +01:00
|
|
|
|
:init (progn
|
|
|
|
|
(setq markdown-use-pandoc-style-yaml-metadata t
|
|
|
|
|
markdown-command "pandoc --standalone")
|
|
|
|
|
(fset 'markdown-output-standalone-p #'(lambda () t))))
|
2019-11-11 18:24:30 +01:00
|
|
|
|
|
2021-06-21 17:40:13 +02:00
|
|
|
|
(use-package plantuml-mode
|
2022-05-15 13:53:42 +02:00
|
|
|
|
:load-path "site-lisp"
|
|
|
|
|
:mode ("\\.plantuml\\'" . plantuml-mode)
|
2021-06-21 17:40:13 +02:00
|
|
|
|
:commands (plantuml-mode)
|
2021-08-07 16:43:45 +02:00
|
|
|
|
:init (setq plantuml-output-type "svg"
|
2021-06-21 17:40:13 +02:00
|
|
|
|
plantuml-default-exec-mode 'jar
|
2021-06-25 20:38:27 +02:00
|
|
|
|
plantuml-jar-path "/usr/share/plantuml/plantuml.jar"
|
2021-07-13 19:40:34 +02:00
|
|
|
|
plantuml-indent-level 2)
|
|
|
|
|
:config (progn
|
|
|
|
|
(add-hook 'plantuml-mode-hook
|
|
|
|
|
#'(lambda ()
|
|
|
|
|
(subword-mode -1)))))
|
2021-06-21 17:40:13 +02:00
|
|
|
|
|
2021-03-13 09:48:24 +01:00
|
|
|
|
(use-package python
|
|
|
|
|
:config (progn
|
2021-07-22 20:26:49 +02:00
|
|
|
|
(unless (require 'lsp-pyright nil :no-error)
|
|
|
|
|
(message "`lsp-pyright' not available, using defaults from `lsp'"))
|
|
|
|
|
|
2021-03-13 09:48:24 +01:00
|
|
|
|
(add-hook 'python-mode-hook #'highlight-indentation-mode)
|
|
|
|
|
(add-hook 'python-mode-hook #'company-mode)
|
2022-07-03 16:59:16 +02:00
|
|
|
|
(add-hook 'python-mode-hook #'lsp-deferred)))
|
2021-03-13 09:48:24 +01:00
|
|
|
|
|
2021-04-22 15:29:56 +02:00
|
|
|
|
;; https://ddavis.io/posts/emacs-python-lsp/
|
|
|
|
|
(use-package pyvenv
|
|
|
|
|
:ensure t
|
2021-04-24 09:59:50 +02:00
|
|
|
|
:commands (pyvenv-workon
|
|
|
|
|
pyvenv-activate
|
|
|
|
|
pyvenv-create)
|
2021-04-24 09:49:55 +02:00
|
|
|
|
:init (unless (getenv "WORKON_HOME")
|
|
|
|
|
(setenv "WORKON_HOME" (expand-file-name "~/.pyenv/versions")))
|
2021-04-24 09:42:33 +02:00
|
|
|
|
:config (progn
|
|
|
|
|
;; Restart python inferior processes when switching virtual
|
|
|
|
|
;; environments; this does not work when only calling
|
|
|
|
|
;; `pyvenv-deactivate', though.
|
|
|
|
|
(add-hook 'pyvenv-post-activate-hooks #'pyvenv-restart-python)))
|
2021-04-22 15:29:56 +02:00
|
|
|
|
|
2020-09-12 10:48:08 +02:00
|
|
|
|
(use-package shr
|
|
|
|
|
:init (setq shr-use-fonts nil
|
|
|
|
|
shr-use-colors nil
|
|
|
|
|
shr-max-image-proportion 0.7
|
|
|
|
|
shr-image-animate nil
|
|
|
|
|
shr-width (current-fill-column)))
|
|
|
|
|
|
2019-02-02 11:57:12 +01:00
|
|
|
|
;; Interactive interface to sdcv, the StarDict concole version. To use sdcv,
|
|
|
|
|
;; put the dictionary data under ~/.stardict/dic.
|
|
|
|
|
(use-package sdcv
|
|
|
|
|
:commands (sdcv-search-pointer
|
|
|
|
|
sdcv-search-input))
|
|
|
|
|
|
2020-08-27 19:39:18 +02:00
|
|
|
|
(use-package sh-script
|
2020-11-14 21:06:22 +01:00
|
|
|
|
:init (setq sh-basic-offset 2))
|
2018-11-02 18:17:51 +01:00
|
|
|
|
|
2018-01-21 19:00:31 +01:00
|
|
|
|
(use-package timeline-tools
|
|
|
|
|
:load-path "site-lisp"
|
|
|
|
|
:commands (timeline-tools-format-timeline
|
|
|
|
|
timeline-tools-format-timeline-of-day
|
2019-02-16 11:21:55 +01:00
|
|
|
|
timeline-tools-copy-clocklines
|
|
|
|
|
timeline-tools-clockline-no-org-agenda-conflicts))
|
2018-01-21 19:00:31 +01:00
|
|
|
|
|
2017-10-05 18:24:14 +02:00
|
|
|
|
(use-package typing
|
|
|
|
|
:commands (typing-of-emacs)
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq toe-highscore-file nil))
|
2017-10-05 18:24:14 +02:00
|
|
|
|
|
2019-11-11 18:29:17 +01:00
|
|
|
|
(use-package vlf
|
|
|
|
|
:ensure t
|
|
|
|
|
:commands (vlf))
|
2018-02-22 16:43:06 +01:00
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package which-key
|
2019-11-11 18:21:52 +01:00
|
|
|
|
:ensure t
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:commands (which-key-mode)
|
|
|
|
|
:diminish which-key-mode
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq which-key-side-window-max-width 0.33
|
|
|
|
|
which-key-side-window-max-height 0.25)
|
|
|
|
|
:config (which-key-setup-side-window-bottom))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2019-12-20 17:05:20 +01:00
|
|
|
|
|
|
|
|
|
;; * Load customizations
|
|
|
|
|
|
|
|
|
|
(when (file-exists-p custom-file)
|
|
|
|
|
(load-file custom-file))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
;;; init.el ends here
|