.emacs.d/init.el

3201 lines
129 KiB
EmacsLisp
Raw Normal View History

;;; 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
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
;; - 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.
;; - 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:
;; * 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.")
(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
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
("melpa-stable" . "https://stable.melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
(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 directly after loading 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))
2017-07-16 18:07:00 +02:00
(eval-when-compile
(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-08-11 17:38:23 +02:00
(dolist (package '(bind-key use-package))
(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
(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 ...")
;; 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
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)
(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)
(global-eldoc-mode +1)
2017-07-16 18:07:00 +02:00
;; Activate modes (packages)
(dolist (mode '(global-undo-tree-mode
ace-window-display-mode
key-chord-mode
ivy-mode
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
global-git-commit-mode))
(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
;; 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))
(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)
(org-roam-db-autosync-mode))
2017-09-15 16:27:56 +02:00
;; Global Hooks
2017-07-16 18:07:00 +02:00
(add-hook 'minibuffer-setup-hook 'cursor-intangible-mode)
(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
2022-09-10 13:56:26 +02:00
(add-hook 'prog-mode-hook 'page-break-lines-mode)
(add-hook 'prog-mode-hook 'hl-line-mode)
2017-07-16 18:07:00 +02:00
(when (<= 24 emacs-major-version)
(add-hook 'prog-mode-hook 'electric-indent-local-mode))
2022-09-10 13:56:26 +02:00
(add-hook 'text-mode-hook 'page-break-lines-mode)
2019-03-02 11:15:28 +01:00
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(add-hook 'text-mode-hook 'abbrev-mode)
(add-hook 'text-mode-hook 'hl-line-mode)
2017-07-16 18:07:00 +02: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)
(bind-key "<Scroll_Lock>" 'scroll-lock-mode)
(bind-key "<f10>" #'magit-status)
(bind-key "<f1>" #'db/run-or-hide-eshell)
(bind-key "<f2>" #'hydra-feature-shortcuts/body)
(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>" #'bm-toggle)
(bind-key "<f9>" #'hydra-org-linking/body)
(bind-key "<C-f8>" #'bm-next)
(bind-key "<C-S-f8>" #'bm-previous)
(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)
(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)
(bind-key "C-c m" #'music-control/body)
(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)
(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)
(bind-key "C-h C-v" #'find-variable)
(bind-key "C-x 4 C-j" #'dired-jump-other-window)
(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-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)
(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)
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)
(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)
(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)
2017-09-15 17:53:59 +02:00
(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))
(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))
2017-07-16 18:07:00 +02: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
(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"))))
2017-08-12 10:53:17 +02:00
;; Start Server when not running already
2017-09-15 13:40:10 +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?).
(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)
(cl-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
;; 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
(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
(use-package db-customize
:demand t
: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))
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
(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
inhibit-default-init t
frame-inhibit-implied-resize t
2017-07-16 18:07:00 +02:00
initial-scratch-message nil
initial-major-mode 'fundamental-mode
2017-07-16 18:07:00 +02:00
ring-bell-function #'ignore
garbage-collection-messages nil
load-prefer-newer nil ; t breaks `org-reload'
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
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
search-whitespace-regexp "[ \t\r\n]+"
visual-line-fringe-indicators '(left-curly-arrow right-curly-arrow)
history-delete-duplicates t
track-eol t
gc-cons-threshold (* 100 1024 1024) ; 100mb
read-process-output-max (* 1024 1024) ; 1mb
next-error-message-highlight t
help-enable-symbol-autoload t
describe-bindings-outline t
redisplay-skip-fontification-on-input t
switch-to-buffer-obey-display-actions t)
(when (memq system-type '(gnu gnu/linux gnu/kfreebsd))
(setq x-wait-for-event-timeout nil))
2017-07-16 18:07:00 +02:00
(when on-windows
;; treat memory for display time ... but hey, this is Windows, memory doesnt
;; 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)
(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))
(setq default-input-method "TeX")
;; * Fixes
(with-eval-after-load 'enriched
(defun enriched-decode-display-prop (start end &optional params)
(ignore params)
(list start end)))
;; 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
;; * Basic Builtin Packages
2017-07-16 18:07:00 +02:00
;; All packages configured here should be part of Emacs core.
2017-07-16 18:07:00 +02:00
(use-package abbrev
: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)
:init (setq appt-display-mode-line nil))
2017-07-16 18:07:00 +02:00
(use-package bookmark
:init (setq bookmark-default-file (expand-file-name "private/bookmarks"
emacs-d)
bookmark-menu-confirm-deletion t))
(use-package browser-url
:init (setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "firefox"))
(use-package calc
;; https://florian.adamsky.it/2016/03/31/emacs-calc-for-programmers-and-cs.html
:defines (math-additional-units
math-units-table)
:init (setq math-additional-units
'((bit nil "Bit")
(byte "8 * bit" "Byte")
(bps "bit / s" "Bit per second"))
math-units-table nil))
(use-package calender
:init (setq calendar-date-style 'iso
calendar-time-zone-style 'numeric
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 dictionary
:init (setq dictionary-server "dict.org"))
(use-package eww
:init (setq eww-bookmarks-directory
(expand-file-name "private/" emacs-d)))
(use-package ffap
;; Inhibit Emacs from pinging hostnames; see
;; https://www.n16f.net/blog/investigating-a-ffap-issue-in-emacs/
:init (setq ffap-machine-p-local 'accept
ffap-machine-p-known 'accept
ffap-machine-p-unknown 'reject))
(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))
:config (progn
;; I am not quite sure why `grep-read-files' is prompting for file
;; names when asking for a file pattern, so let's just hook it up
;; and replace it with something more straightforward.
(advice-add 'grep-read-files :around #'db/grep-read-files)))
(use-package image
:init (setq image-use-external-converter t))
(use-package isearch
:init (setq isearch-allow-scroll t))
(use-package ispell
:commands (ispell-change-directory))
(use-package mailcap
:config (progn
;; Remove doc-view so pdf will open with default viewer
(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 misc
:commands (zap-up-to-char zap-to-char))
(use-package quail
:config (add-hook 'input-method-activate-hook
#'db/add-symbols-to-TeX-input-method))
(use-package re-builder
:commands (re-builder)
:init (setq reb-re-syntax 'string))
(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)))
(use-package server
:commands (server-running-p server-start)
:init (setq server-log t))
(use-package tab-bar
:init (setq tab-bar-show t
tab-bar-format '(tab-bar-format-tabs
tab-bar-separator
;; tab-bar-format-align-right
;; current-time-string
))
:config (progn
(tab-bar-history-mode +1)))
(use-package tramp
:init (setq tramp-default-method (if on-windows "pscp" "scp")
tramp-completion-use-auth-sources nil))
(use-package warnings
:config (cl-pushnew '(undo discard-info) warning-suppress-types
:test #'equal))
(use-package winner
:commands (winner-mode winner-undo winner-redo))
2017-07-16 18:07:00 +02:00
;; * Essential external packages
2017-07-16 18:07:00 +02:00
(use-package dash
:defer nil
:config (progn
(global-dash-fontify-mode)
(dash-register-info-lookup)))
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
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
db/hex-to-ascii
db/text-to-hex
conditionally-enable-lispy
turn-on-lispy-when-available
turn-on-flycheck-when-file
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
2018-11-21 10:38:05 +01:00
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+
db/convert-lf-to-crlf-in-buffer
db/convert-crlf-to-lf-in-buffer
db/sync-magit-repos-from-projectile
db/replace-variables-in-string
db/dired-ediff-files
db/grep-read-files))
(use-package db-hydras
:commands (hydra-toggle/body
hydra-zoom/body
hydra-rectangle/body
db/define-feature-shortcuts-hydra
hydra-feature-shortcuts/body))
(use-package exec-path-from-shell
2019-12-21 18:52:50 +01:00
:pin "melpa-stable"
: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
: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)