My Emacs configuration.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
.emacs.d/init.el

2859 lines
107 KiB

;;; Init.el --- Daniel's Emacs Configuration -*- lexical-binding: t -*-
5 years ago
;;; Commentary:
;; 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
;; can choose in `db/run-init’ which configuration to activate without
;; changing much of the rest of the file.
;; * this file also introduces a new customization group `personal-settings’
;; containing variables (mostly file paths) that must be set to enable some
;; of the provided functionality.
5 years ago
;;; Code:
;; * Constants
5 years ago
(defconst emacs-d (file-name-directory
(file-chase-links load-file-name))
"The giant turtle on which the world rests.")
(defconst on-windows (memq system-type '(windows-nt cygwin))
"Non-nil if and only if this instance of Emacs runs on Windows.")
;; * Packages
(when (< emacs-major-version 27)
;; 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
;; https://www.gnu.org/software/emacs/news/NEWS.27.1
(load-file (expand-file-name "early-init.el" emacs-d))
(package-initialize))
5 years ago
(eval-when-compile
(setq use-package-enable-imenu-support t)
(dolist (package '(bind-key use-package))
(unless (package-installed-p package)
(package-install package))
(require package)))
5 years ago
(add-to-list 'package-pinned-packages '(use-package . "melpa-stable"))
(add-to-list 'package-pinned-packages '(bind-key . "melpa-stable"))
(put 'use-package 'lisp-indent-function 1)
(setq use-package-verbose t
use-package-minimum-reported-time 0.01)
5 years ago
(add-to-list 'load-path (expand-file-name "site-lisp" emacs-d))
5 years ago
;; * Mode activation
(defun db/run-init ()
"Run main initialization after everything is set up."
(message "Running main initialization ...")
;; Activate modes (builtin)
5 years ago
(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
blink-cursor-mode
tooltip-mode))
5 years ago
(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)
(electric-pair-mode +1)
5 years ago
(recentf-mode t)
(winner-mode 1)
(global-auto-revert-mode -1)
(which-function-mode +1)
(global-eldoc-mode +1)
5 years ago
;; Activate modes (packages)
(dolist (mode '(global-undo-tree-mode
ace-window-display-mode
key-chord-mode
ivy-mode
minions-mode
which-key-mode
eyebrowse-mode
projectile-mode
yas-global-mode
semantic-mode))
(with-demoted-errors "Cannot activate mode: %s"
5 years ago
(funcall mode +1)))
5 years ago
(unless on-windows
(with-demoted-errors "Cannot load `pdf-tools’: %s"
(pdf-tools-install)))
(with-demoted-errors "Cannot activate moody: %s"
(moody-replace-mode-line-buffer-identification)
(moody-replace-vc-mode))
(with-demoted-errors "Cannot activate `vlf': %s"
(require 'vlf-setup))
;; Explicitly require helm, because autoloading is difficult with helm's
;; separate `helm-command-prefix-key' mechanism.
(require 'helm)
(when (package-installed-p 'org-roam)
(if (executable-find "sqlite3")
(org-roam-mode +1)
(warn "Cannot activate org-roam: sqlite3 not found.")))
;; Global Hooks
5 years ago
(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)
(add-hook 'lisp-mode-hook 'turn-on-lispy-when-available)
5 years ago
(when (<= 24 emacs-major-version)
(add-hook 'prog-mode-hook 'electric-indent-local-mode))
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(add-hook 'text-mode-hook 'abbrev-mode)
5 years ago
;; 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))
;; Top-Level Keybindings
5 years ago
(bind-key "<XF86Back>" #'winner-undo)
(bind-key "<XF86Forward>" #'winner-redo)
(bind-key "<f10>" #'magit-status)
(bind-key "<f11>" #'org-capture)
(bind-key "<f12>" #'db/helm-shortcuts)
(bind-key "<f1>" #'db/run-or-hide-eshell)
(bind-key "<f2>" #'hydra-feature-shortcuts/body)
(bind-key "<f5>" #'rgrep)
5 years ago
(bind-key "<f6>" #'hydra-zoom/body)
(bind-key "<f7>" #'dictcc)
(bind-key "<f8>" #'counsel-locate)
(bind-key "<f9>" #'helm-org-agenda-files-headings)
(bind-key "C-," #'mc/skip-to-previous-like-this)
(bind-key "C-." #'mc/skip-to-next-like-this)
(bind-key "C-;" #'iedit-mode)
5 years ago
(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)
(bind-key "C-c i" #'ispell-change-dictionary)
5 years ago
(bind-key "C-c j" #'avy-goto-char-timer)
(bind-key "C-c l" #'org-store-link)
(bind-key "C-c m" #'music-control/body)
(bind-key "C-c n I" #'org-roam-insert-immediate)
(bind-key "C-c n i" #'org-roam-insert)
5 years ago
(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)
(bind-key "C-x C-b" #'ibuffer)
5 years ago
(bind-key "C-x C-d" #'dired)
(bind-key "C-x C-r" #'revert-buffer)
(bind-key "C-x SPC" #'hydra-rectangle/body)
(bind-key "C-x g" #'db/helm-shortcuts)
(bind-key "C-x r E" #'db/bookmark-add-external)
(bind-key "C-x r M" #'db/bookmark-add-url)
5 years ago
(bind-key "C-x r v" #'list-registers)
(bind-key "C-x t" #'hydra-toggle/body)
(bind-key "C-z" #'goto-last-change)
5 years ago
(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)
(bind-key "M-i" #'swiper-from-isearch isearch-mode-map)
5 years ago
(bind-key "M-j" #'(lambda () (interactive) (join-line -1)))
(bind-key "M-z" #'zap-up-to-char)
(bind-key [remap fill-paragraph] #'endless/fill-or-unfill)
(bind-key [remap keyboard-quit] #'keyboard-quit-context+)
(unbind-key "<insert>" global-map)
(unbind-key "<kp-insert>" global-map)
(unbind-key "C-x C-c" global-map)
(unbind-key "M-o" global-map)
;; Overwrite certain keybindings only if packages are avilable
(when (package-installed-p 'counsel)
(bind-key "M-x" #'counsel-M-x) ; gets nicer sorting with smex installed
(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)
(bind-key "C-h b" #'counsel-descbinds)
(bind-key "C-S-s" #'counsel-grep-or-swiper)
(bind-key [remap bookmark-bmenu-list] #'counsel-bookmark))
(when (package-installed-p 'helm)
(bind-key "M-y" #'helm-show-kill-ring))
(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))
5 years ago
(when (executable-find "ag")
(bind-key "<f5>" #'counsel-ag))
(when (package-installed-p 'avy)
(bind-key "M-g M-g" #'avy-goto-line)
(bind-key "M-g g" #'avy-goto-line))
5 years ago
;; Environment Variables
(unless on-windows
(with-demoted-errors "Cannot import environment variables: %s"
(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"))))
5 years ago
;; Start Server when not running already
;; 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?).
(if (and (boundp 'server-process) server-process)
(message "Server already running, not restarting.")
(require 'server)
(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."))))))
;; Load custom code
(dolist (file db/after-init-load-files)
(message "Loading %s" file)
(with-demoted-errors "Error loading file: %s"
(load-file file)))
;; Finish
(message "Running main initialization ... done")
5 years ago
t)
(add-hook 'after-init-hook #'db/run-init)
;; * Personal customization
5 years ago
(use-package db-customize
:defines (db/jabber-id
db/important-documents-path
db/path-to-onenote
db/path-to-outlook
db/cert-file-directory
org-working-task-id
org-break-task-id
org-home-task-id
db/org-clock-current-task-file
db/org-default-org-file
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))
;; * General configuration
;; 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)))
(setq custom-file
(expand-file-name "private/custom.el" emacs-d))
5 years ago
(use-package cl-lib)
(use-package subr-x)
5 years ago
(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
frame-inhibit-implied-resize t
5 years ago
initial-scratch-message nil
initial-major-mode 'fundamental-mode
5 years ago
ring-bell-function #'ignore
garbage-collection-messages nil
load-prefer-newer nil ; t breaks `org-reload'
auth-sources '("~/.authinfo.gpg"))
5 years ago
(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
large-file-warning-threshold 10000000
5 years ago
echo-keystrokes 0.1
delete-by-moving-to-trash t
delete-trailing-lines nil
x-underline-at-descent-line t
search-whitespace-regexp "[ \t\r\n]+"
visual-line-fringe-indicators '(left-curly-arrow right-curly-arrow)
history-delete-duplicates t
track-eol t)
(when (memq system-type '(gnu gnu/linux gnu/kfreebsd))
(setq x-wait-for-event-timeout nil))
5 years ago
(when on-windows
;; treat memory for display time ... but hey, this is Windows, memory doesn’t
;; matter!
(setq inhibit-compacting-font-caches t))
(setq-default cursor-type 'bar
cursor-in-non-selected-windows nil)
5 years ago
5 years ago
;; 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)
(setq undo-limit 80000000)
5 years ago
(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)
(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)
5 years ago
(setq-default font-lock-maximum-decoration '((t . t)))
(setq-default savehist-file (expand-file-name "savehist" emacs-d))
(setq tramp-save-ad-hoc-proxies t)
5 years ago
(use-package re-builder
:commands (re-builder)
:init (setq reb-re-syntax 'string))
5 years ago
(setq lisp-indent-function #'lisp-indent-function)
5 years ago
(setq custom-theme-directory (expand-file-name "themes/" emacs-d))
;; 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)
(setq default-input-method "TeX")
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "firefox")
;; * Fixes
(with-eval-after-load 'enriched
(defun enriched-decode-display-prop (start end &optional params)
(ignore params)
(list start end)))
5 years ago
;; * Basic Builtin Packages
(use-package misc
:commands (zap-up-to-char zap-to-char))
(use-package grep
:commands (rgrep zrgrep)
:bind (:map grep-mode-map
("C-x C-q" . wgrep-change-to-wgrep-mode)
("C-c C-c" . wgrep-finish-edit)))
5 years ago
(use-package winner
:commands (winner-mode winner-undo winner-redo))
(use-package abbrev
:defer t
:init (progn
(setq save-abbrevs 'silently))
5 years ago
:diminish abbrev-mode)
(use-package appt
:commands (appt-activate)
:init (setq appt-display-mode-line nil))
5 years ago
(use-package ediff
:defer t
:init (setq ediff-diff-options "-w"
ediff-window-setup-function 'ediff-setup-windows-plain
ediff-split-window-function 'split-window-horizontally)
5 years ago
:config (progn
(add-hook 'ediff-keymap-setup-hook
'(lambda ()
(bind-key "j" #'ediff-next-difference ediff-mode-map)
(bind-key "k" #'ediff-previous-difference ediff-mode-map)))
5 years ago
(add-hook 'ediff-after-quit-hook-internal 'winner-undo)))
(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))
5 years ago
(use-package ispell
:commands (ispell-change-directory))
5 years ago
(use-package mailcap
:defer t
5 years ago
:config (progn
5 years ago
;; Remove doc-view so pdf will open with default viewer
5 years ago
(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
:config (add-hook 'input-method-activate-hook
#'db/add-symbols-to-TeX-input-method))
(use-package isearch
:defer t
:init (setq isearch-allow-scroll t))
(use-package server
:commands (server-running-p server-start)
:init (setq server-log t))
(use-package bookmark
:init (setq bookmark-default-file (expand-file-name "private/bookmarks"
emacs-d)))
5 years ago
;; * Some essential packages
5 years ago
(use-package dash
:pin "melpa-stable")
(use-package hydra
:pin "melpa-stable")
;; `lv' is a dependency of `hydra'
(add-to-list 'package-pinned-packages '(lv . "melpa-stable"))
5 years ago
(use-package db-utils
:commands (endless/fill-or-unfill
db/delete-trailing-whitespace-maybe
db/run-or-hide-shell
db/gnus
db/org-agenda
db/scratch
db/find-user-init-file
5 years ago
db/run-or-hide-ansi-term
db/hex-to-ascii
db/text-to-hex
conditionally-enable-lispy
turn-on-lispy-when-available
db/sort-nsm-permanent-settings
endless/colorize-compilation
db/turn-off-local-electric-pair-mode
db/add-symbols-to-TeX-input-method
db/two-monitors-xrandr
db/one-monitor-xrandr
db/pretty-print-xml
db/bookmark-add-external
db/bookmark-add-url
db/lookup-smime-key
db/dired-from-shell-command
db/system-open
db/switch-to-dark-theme
db/switch-to-light-theme
keyboard-quit-context+))
(use-package db-hydras
:commands (hydra-toggle/body
hydra-zoom/body
hydra-rectangle/body
hydra-feature-shortcuts/body))
(use-package git-commit
:commands (global-git-commit-mode))
5 years ago
(use-package magit
:commands (magit-status)
:init (setq magit-diff-refine-hunk nil
magit-commit-show-diff nil
magit-popup-use-prefix-argument 'default)
5 years ago
:config (progn
(global-magit-file-mode -1)
(global-git-commit-mode +1)
(with-demoted-errors "Non-Fatal Error: %s"
(require 'projectile)
(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))))))
5 years ago
(use-package projectile
: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))
5 years ago
:diminish projectile-mode)
(use-package counsel-projectile
:commands counsel-projectile)
(use-package exec-path-from-shell
:pin "melpa-stable"
:commands (exec-path-from-shell-copy-envs))
5 years ago
;; * 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)
(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)))
;; * Org
(use-package db-org
:commands (db/check-special-org-files-in-agenda
db/verify-refile-target
org-reset-checkbox-state-maybe
db/find-parent-task
db/ensure-running-clock
db/save-current-org-task-to-file
db/org-update-frame-title-with-current-clock