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:
|
|
|
|
|
;; * first comes some preliminary setup, mostly setting up `package’;
|
|
|
|
|
;; * the main activation of the configuration is done in the function
|
|
|
|
|
;; `db/run-init’, which is installed in `after-init-hook’; it is thus run
|
|
|
|
|
;; after init.el has been read
|
|
|
|
|
;; * then comes setting up all the packages that can be used by this
|
|
|
|
|
;; 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.
|
2017-11-12 12:35:36 +01:00
|
|
|
|
;; * this file also introduces a new customization group `personal-settings’
|
|
|
|
|
;; 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:
|
|
|
|
|
|
|
|
|
|
|
2017-11-11 11:44:30 +01:00
|
|
|
|
;; * Constants
|
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.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; * Packages
|
|
|
|
|
|
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
|
|
|
|
|
;; 27.1 and later, it's done in 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-11 16:47:28 +02:00
|
|
|
|
(setq use-package-enable-imenu-support t)
|
|
|
|
|
|
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-09-10 09:30:22 +02:00
|
|
|
|
(setq use-package-verbose t
|
|
|
|
|
use-package-minimum-reported-time 0.01)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2017-08-06 11:44:03 +02:00
|
|
|
|
(add-to-list 'load-path (expand-file-name "site-lisp" emacs-d))
|
|
|
|
|
|
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-03-02 09:26:05 +01:00
|
|
|
|
eyebrowse-mode
|
2019-12-20 17:34:05 +01:00
|
|
|
|
projectile-mode
|
2019-12-20 17:39:13 +01:00
|
|
|
|
yas-global-mode
|
|
|
|
|
semantic-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
|
|
|
|
|
2017-11-18 17:05:25 +01:00
|
|
|
|
(unless on-windows
|
2019-03-02 09:28:42 +01:00
|
|
|
|
(with-demoted-errors "Cannot load `pdf-tools’: %s"
|
2018-01-13 14:45:32 +01:00
|
|
|
|
(pdf-tools-install)))
|
2017-11-18 17:05:25 +01:00
|
|
|
|
|
2019-04-14 14:06:10 +02:00
|
|
|
|
(with-demoted-errors "Cannot activate moody: %s"
|
|
|
|
|
(moody-replace-mode-line-buffer-identification)
|
|
|
|
|
(moody-replace-vc-mode))
|
|
|
|
|
|
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)
|
|
|
|
|
(if (executable-find "sqlite3")
|
|
|
|
|
(org-roam-mode +1)
|
|
|
|
|
(warn "Cannot activate org-roam: sqlite3 not found.")))
|
|
|
|
|
|
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 'conditionally-enable-lispy)
|
|
|
|
|
(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)
|
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)
|
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)
|
2020-09-12 08:52:02 +02:00
|
|
|
|
(bind-key "<f10>" #'magit-status)
|
|
|
|
|
(bind-key "<f11>" #'org-capture)
|
|
|
|
|
(bind-key "<f12>" #'db/helm-shortcuts)
|
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)
|
2018-10-20 17:52:24 +02:00
|
|
|
|
(bind-key "<f5>" #'rgrep)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "<f6>" #'hydra-zoom/body)
|
|
|
|
|
(bind-key "<f7>" #'dictcc)
|
|
|
|
|
(bind-key "<f8>" #'counsel-locate)
|
2018-07-08 19:06:46 +02:00
|
|
|
|
(bind-key "<f9>" #'helm-org-agenda-files-headings)
|
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 P" #'ivy-pages)
|
|
|
|
|
(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)
|
2020-09-12 08:52:02 +02:00
|
|
|
|
(bind-key "C-c n I" #'org-roam-insert-immediate)
|
|
|
|
|
(bind-key "C-c n i" #'org-roam-insert)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(bind-key "C-c o" #'hydra-org-clock/body)
|
|
|
|
|
(bind-key "C-c s" #'synonyms)
|
|
|
|
|
(bind-key "C-h C-f" #'find-function)
|
|
|
|
|
(bind-key "C-h C-k" #'find-function-on-key)
|
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)
|
|
|
|
|
(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)
|
|
|
|
|
(bind-key "C-x t" #'hydra-toggle/body)
|
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)
|
|
|
|
|
(bind-key "M-g j b" #'dumb-jump-back)
|
|
|
|
|
(bind-key "M-g j g" #'dumb-jump-go)
|
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)
|
2019-04-14 08:39:33 +02:00
|
|
|
|
(bind-key "C-S-s" #'counsel-grep-or-swiper)
|
|
|
|
|
(bind-key [remap bookmark-bmenu-list] #'counsel-bookmark))
|
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
|
|
|
|
|
2018-10-20 17:52:24 +02:00
|
|
|
|
(when (executable-find "ag")
|
|
|
|
|
(bind-key "<f5>" #'counsel-ag))
|
|
|
|
|
|
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)
|
|
|
|
|
(ecase (server-running-p)
|
|
|
|
|
((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
|
|
|
|
|
: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
|
|
|
|
|
2019-12-18 21:04:47 +01:00
|
|
|
|
;; 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-14 16:12:04 +01:00
|
|
|
|
(setq custom-file
|
2018-07-20 16:24:18 +02:00
|
|
|
|
(expand-file-name "private/custom.el" emacs-d))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package cl-lib)
|
2017-09-13 18:32:43 +02:00
|
|
|
|
(use-package subr-x)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package warnings
|
|
|
|
|
:config (cl-pushnew '(undo discard-info) warning-suppress-types
|
|
|
|
|
:test #'equal))
|
|
|
|
|
|
|
|
|
|
(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-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'
|
|
|
|
|
auth-sources '("~/.authinfo.gpg"))
|
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
|
|
|
|
|
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
|
|
|
|
|
track-eol 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))
|
|
|
|
|
|
2019-08-31 10:57:33 +02:00
|
|
|
|
(setq-default cursor-type 'bar
|
|
|
|
|
cursor-in-non-selected-windows nil)
|
2017-07-27 13:08:05 +02:00
|
|
|
|
|
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
|
|
|
|
|
'("^\*Async Shell Command*" . (display-buffer-no-window)))
|
|
|
|
|
|
|
|
|
|
(put 'set-goal-column 'disabled nil)
|
|
|
|
|
(put 'upcase-region 'disabled nil)
|
|
|
|
|
(put 'downcase-region 'disabled nil)
|
|
|
|
|
(put 'narrow-to-region 'disabled nil)
|
|
|
|
|
|
2019-12-20 17:54:29 +01:00
|
|
|
|
(setq calendar-date-style 'iso
|
|
|
|
|
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)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(setq-default font-lock-maximum-decoration '((t . t)))
|
|
|
|
|
(setq-default savehist-file (expand-file-name "savehist" emacs-d))
|
|
|
|
|
|
2019-12-20 17:54:29 +01:00
|
|
|
|
(setq tramp-save-ad-hoc-proxies t)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2018-01-27 17:31:50 +01:00
|
|
|
|
(use-package re-builder
|
|
|
|
|
:commands (re-builder)
|
2018-11-03 18:55:20 +01:00
|
|
|
|
:init (setq reb-re-syntax 'string))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2017-12-15 21:45:12 +01:00
|
|
|
|
(setq lisp-indent-function #'lisp-indent-function)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2017-10-02 18:05:34 +02:00
|
|
|
|
(setq custom-theme-directory (expand-file-name "themes/" emacs-d))
|
|
|
|
|
|
2018-08-05 10:17:30 +02:00
|
|
|
|
;; https://florian.adamsky.it/2016/03/31/emacs-calc-for-programmers-and-cs.html
|
|
|
|
|
(setq math-additional-units
|
|
|
|
|
'((bit nil "Bit")
|
|
|
|
|
(byte "8 * bit" "Byte")
|
|
|
|
|
(bps "bit / s" "Bit per second"))
|
|
|
|
|
math-units-table nil)
|
|
|
|
|
|
2018-11-02 18:17:51 +01:00
|
|
|
|
(setq default-input-method "TeX")
|
|
|
|
|
|
|
|
|
|
(setq browse-url-browser-function 'browse-url-generic
|
|
|
|
|
browse-url-generic-program "firefox")
|
|
|
|
|
|
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)))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
;; * Basic Builtin Packages
|
|
|
|
|
|
|
|
|
|
(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
|
2019-12-20 20:31:15 +01:00
|
|
|
|
:defer t
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (progn
|
|
|
|
|
(setq save-abbrevs 'silently))
|
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 ediff
|
2017-09-24 12:34:59 +02:00
|
|
|
|
:defer t
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq ediff-diff-options "-w"
|
|
|
|
|
ediff-window-setup-function 'ediff-setup-windows-plain
|
|
|
|
|
ediff-split-window-function 'split-window-horizontally)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:config (progn
|
|
|
|
|
(add-hook 'ediff-keymap-setup-hook
|
|
|
|
|
'(lambda ()
|
2018-08-04 12:33:15 +02:00
|
|
|
|
(bind-key "j" #'ediff-next-difference ediff-mode-map)
|
|
|
|
|
(bind-key "k" #'ediff-previous-difference ediff-mode-map)))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(add-hook 'ediff-after-quit-hook-internal 'winner-undo)))
|
|
|
|
|
|
2020-09-11 17:10:02 +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))
|
|
|
|
|
|
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
|
2017-09-24 12:34:59 +02:00
|
|
|
|
:defer t
|
2017-07-16 18:07:00 +02:00
|
|
|
|
: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
|
|
|
|
|
:defer t
|
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
|
|
|
|
|
:defer t
|
|
|
|
|
: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"
|
|
|
|
|
emacs-d)))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2017-10-21 09:08:15 +02:00
|
|
|
|
;; * Some essential packages
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
2019-12-21 18:52:50 +01:00
|
|
|
|
(use-package dash
|
|
|
|
|
:pin "melpa-stable")
|
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
|
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
|
|
|
|
|
keyboard-quit-context+))
|
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
|
|
|
|
|
hydra-feature-shortcuts/body))
|
2019-03-02 11:06:55 +01:00
|
|
|
|
|
2019-11-02 10:21:06 +01:00
|
|
|
|
(use-package git-commit
|
|
|
|
|
:commands (global-git-commit-mode))
|
|
|
|
|
|
2017-07-16 18:07:00 +02:00
|
|
|
|
(use-package magit
|
|
|
|
|
:commands (magit-status)
|
2019-05-03 19:06:00 +02:00
|
|
|
|
:init (setq magit-diff-refine-hunk nil
|
2018-11-02 18:17:51 +01:00
|
|
|
|
magit-commit-show-diff nil
|
2020-08-13 16:22:21 +02:00
|
|
|
|
magit-popup-use-prefix-argument 'default)
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:config (progn
|
2018-09-09 12:14:56 +02:00
|
|
|
|
(global-magit-file-mode -1)
|
2019-11-02 10:21:06 +01:00
|
|
|
|
(global-git-commit-mode +1)
|
2018-09-09 12:14:56 +02:00
|
|
|
|
|
2018-09-07 17:46:22 +02:00
|
|
|
|
(with-demoted-errors "Non-Fatal Error: %s"
|
2020-01-03 14:01:18 +01:00
|
|
|
|
(require 'projectile)
|
2018-09-07 17:46:22 +02:00
|
|
|
|
(setq magit-repository-directories
|
|
|
|
|
(mapcar
|
|
|
|
|
(lambda (dir)
|
|
|
|
|
(cons (substring dir 0 -1) 0))
|
|
|
|
|
(cl-remove-if-not
|
|
|
|
|
(lambda (project)
|
|
|
|
|
(unless (file-remote-p project)
|
|
|
|
|
(file-exists-p (concat project "/.git"))))
|
|
|
|
|
projectile-known-projects))))))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
|
|
|
|
|
(use-package projectile
|
2017-08-04 17:50:46 +02:00
|
|
|
|
:commands (projectile-mode)
|
2017-08-12 00:18:42 +02:00
|
|
|
|
:defines (projectile-known-projects)
|
2018-09-07 19:06:20 +02:00
|
|
|
|
:bind (:map projectile-mode-map ("C-c p" . projectile-command-map))
|
2018-11-02 18:17:51 +01:00
|
|
|
|
:init (setq projectile-switch-project-action 'projectile-dired
|
2020-08-15 11:35:04 +02:00
|
|
|
|
projectile-completion-system 'helm
|
2018-11-02 18:17:51 +01:00
|
|
|
|
projectile-ignored-project-function #'file-remote-p
|
2019-02-24 18:24:59 +01:00
|
|
|
|
projectile-create-missing-test-files t
|
|
|
|
|
projectile-known-projects-file (expand-file-name "private/projectile-bookmarks.eld"
|
|
|
|
|
emacs-d))
|
2017-07-16 18:07:00 +02:00
|
|
|
|
:diminish projectile-mode)
|
|
|
|
|
|
2017-08-04 16:00:04 +02:00
|
|
|
|
(use-package counsel-projectile
|
|
|
|
|
:commands counsel-projectile)
|
|
|
|
|
|
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
|
|
|
|
|
2019-08-31 12:02:02 +02:00
|
|
|
|
|
|
|
|
|
;; * Start Menu via Helm
|
|
|
|
|
|
|
|
|
|
(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)
|
2020-09-02 11:28:42 +02:00
|
|
|
|
(require 'helm-for-files) ; for helm-source-recentf
|
2019-08-31 12:02:02 +02:00
|
|
|
|
(helm :sources (list
|
|
|
|
|
(helm-make-source "Frequently Used" 'helm-source-sync
|
2019-12-20 15:14:29 +01:00
|
|
|
|
:candidates (mapcar #'(lambda (entry)
|
|
|
|
|
(cons (car entry)
|
|
|
|
|
(caddr entry)))
|
|
|
|
|
db/frequently-used-features)
|
|
|
|
|
:action '(("Open" . call-interactively))
|
2019-08-31 12:02:02 +02:00
|
|
|
|
:filtered-candidate-transformer #'helm-adaptive-sort)
|
|
|
|
|
|
2020-05-15 10:44:08 +02:00
|
|
|
|
;; taken from `helm-buffers-list'
|
|
|
|
|
(helm-make-source "Buffers" 'helm-source-buffers)
|
|
|
|
|
|
2020-08-31 08:23:26 +02:00
|
|
|
|
helm-source-recentf
|
|
|
|
|
|
2020-05-15 10:44:08 +02:00
|
|
|
|
;; if prefix arg is given, extract files from
|
2019-08-31 12:02:02 +02:00
|
|
|
|
;; `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)
|
2019-09-02 12:00:26 +02:00
|
|
|
|
;; display only relative path,
|
|
|
|
|
;; but keep absolute path for
|
|
|
|
|
;; actions
|
|
|
|
|
(cons (string-remove-prefix search-path file)
|
|
|
|
|
file))
|
2019-08-31 12:02:02 +02:00
|
|
|
|
(directory-files-recursively search-path ""))
|
|
|
|
|
:action '(("Open externally" . db/system-open)
|
2019-10-15 16:50:38 +02:00
|
|
|
|
("Find file" . find-file)))))
|
|
|
|
|
|
|
|
|
|
helm-source-bookmarks
|
2020-05-15 10:44:08 +02:00
|
|
|
|
|
|
|
|
|
helm-source-buffer-not-found
|
2019-10-15 16:50:38 +02:00
|
|
|
|
helm-source-bookmark-set)))
|
2019-08-31 12:02:02 +02:00
|
|
|
|
|
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
|
|