summaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el161
1 files changed, 52 insertions, 109 deletions
diff --git a/init.el b/init.el
index 3a20e51..7b6a7e9 100644
--- a/init.el
+++ b/init.el
@@ -106,14 +106,8 @@
;;; Org
(use-package org
- :load-path "~/src/emacs/org-mode/lisp/"
:mode ("\\.org.txt\\'" . org-mode)
:init
- (require 'org-loaddefs)
- (add-to-list 'load-path "~/src/emacs/org-contrib/lisp/" t)
- (with-eval-after-load 'info
- (info-initialize)
- (add-to-list 'Info-directory-list "~/src/emacs/org-mode/doc/"))
(bind-keys :map km/global-org-map
("b" . org-switchb)
("cg" . org-clock-goto)
@@ -143,7 +137,7 @@
(put 'org-log-done 'safe-local-variable #'booleanp)
(put 'org-archive-location 'safe-local-variable #'stringp)
- (setq org-catch-invisible-edits 'error
+ (setq org-fold-catch-invisible-edits 'error
org-special-ctrl-k t
org-insert-heading-respect-content nil
org-M-RET-may-split-line nil
@@ -182,7 +176,7 @@
(add-hook 'next-error-hook (lambda ()
(when (eq major-mode 'org-mode)
- (org-show-context))))
+ (org-fold-show-context))))
(advice-add
'org-eval-in-calendar :around
@@ -198,7 +192,7 @@
'((name . "org-save-after-capture-refile")))
(bind-keys :map org-mode-map
- ("C-c l" . org-goto)
+ ("C-c l" . consult-org-heading)
("C-c m" . km/org-prefix-map)
;; Don't let `org-cycle-agenda-files' binding override
;; custom `backward-kill-word' binding
@@ -399,14 +393,8 @@
("D" . km/org-agenda-delete-subtree)
("w" . km/org-agenda-refile-dwim)))
-(use-package org-link-edit
- :load-path "~/src/emacs/org-link-edit/"
- :init (require 'org-link-edit-autoloads nil t))
-
(use-package bog
- :load-path "~/src/emacs/bog/"
:init
- (require 'bog-autoloads nil t)
(setq bog-keymap-prefix (kbd "C-c b"))
(global-set-key bog-keymap-prefix bog-command-map)
:config
@@ -589,32 +577,39 @@
(with-eval-after-load 'avy
(add-to-list 'avy-dispatch-alist (cons ?w #'km/avy-action-copy-line))))
-(use-package ivy
- :diminish ivy-mode
- :config
- (setq ivy-count-format "(%d/%d) ")
- (setq ivy-use-virtual-buffers t)
- (setq ivy-virtual-abbreviate 'abbreviate)
- (setq ivy-wrap t)
-
- (define-key ivy-minibuffer-map (kbd "C-'") nil)
- (define-key ivy-minibuffer-map (kbd "C-.") 'ivy-avy)
+(use-package vertico
+ :init
+ (vertico-mode 1))
- (ivy-mode 1))
+(use-package orderless
+ :init
+ (setq completion-styles '(orderless basic))
+ (setq completion-category-overrides
+ '((file (styles basic partial-completion)))))
-(use-package swiper
- :bind (("M-s k" . swiper)))
+(use-package consult
+ :chords (("jt" . consult-buffer))
+ :bind (("C-x b" . consult-buffer)
+ ("C-x 4 b" . consult-buffer-other-window)
+ ("C-c z m" . consult-man)
+ ("M-g g" . consult-goto-line)
+ ("M-s k" . consult-line)
+ ("M-y" . consult-yank-pop)
+ :map minibuffer-local-map
+ ("M-s" . consult-history)
+ ("M-r" . consult-history))
+ :config
+ (setq consult-narrow-key "<")
+ (setq consult-preview-key nil))
-(use-package counsel
- :chords (("jt" . counsel-buffer-or-recentf)
- ("kx" . counsel-M-x))
- :bind (("C-c l" . counsel-imenu)
- ("M-y" . counsel-yank-pop)))
+(use-package consult-imenu
+ :bind (("C-c l" . consult-imenu)))
;;; Buffers and files
(setq require-final-newline t)
+(setq write-region-inhibit-fsync t)
;; Disable `suspend-frame' binding.
(global-set-key (kbd "C-x C-z") nil)
@@ -650,6 +645,8 @@
(setq tramp-default-method "sshx"))
(use-package recentf
+ :init
+ (recentf-mode 1)
:config
(setq recentf-max-saved-items 100
recentf-save-file "~/.emacs.d/cache/recentf")
@@ -663,19 +660,6 @@
"/itsalltext/")
recentf-exclude)))
-(use-package nlines
- :load-path "~/src/emacs/nlines/"
- :init
- (require 'nlines-autoloads nil t)
- (define-key km/file-map "l" #'nlines-run-command))
-
-(use-package cpinfo
- :load-path "~/src/emacs/cpinfo/"
- :init
- (require 'cpinfo-autoloads nil t)
- (with-eval-after-load 'dired
- (define-key km/dired-prefix-map "f" #'cpinfo-copy)))
-
(use-package view
:diminish (view-mode . "Vw")
:chords ("hq" . view-mode)
@@ -759,7 +743,6 @@
:config
(setq projectile-find-dir-includes-top-level t
projectile-use-git-grep t)
- (setq projectile-completion-system 'ivy)
(setq projectile-git-submodule-command nil)
(defun km/projectile-ignore-directory-p (name)
@@ -895,19 +878,11 @@
(setq git-annex-commit nil)
(run-hooks 'modus-themes-after-load-theme-hook))
-(use-package compat
- :load-path "~/src/emacs/compat/")
-
-(use-package with-editor
- :load-path "~/src/emacs/with-editor/lisp/")
-
(use-package transient
- :load-path "~/src/emacs/transient/lisp"
:config
(setq transient-default-level 7))
(use-package magit-popup
- :load-path "~/src/emacs/magit-popup/"
:config
(setq magit-popup-show-help-echo nil
magit-popup-show-common-commands nil
@@ -918,7 +893,6 @@
("SPC SPC <t>" . magit-invoke-popup-option)))
(use-package magit
- :load-path "~/src/emacs/magit/lisp/"
:bind ("C-x g" . km/magit-status)
:chords ("jg" . km/magit-status)
:init
@@ -1085,9 +1059,6 @@
(put 'magit-edit-line-commit 'disabled nil)
(put 'magit-diff-edit-hunk-commit 'disabled nil))
-(use-package orgit
- :load-path "~/src/emacs/orgit/")
-
(use-package km-magit
:init
(bind-keys :map km/git-map
@@ -1198,21 +1169,10 @@
'("s" "series" km/magit-patch-create-series))))
(use-package magit-annex
- :load-path "~/src/emacs/magit-annex/"
- :init (require 'magit-annex-autoloads nil t)
:config
(setq magit-annex-unused-open-function #'org-open-file))
-(use-package magit-tbdiff
- :load-path "~/src/emacs/magit-tbdiff/"
- :init (require 'magit-tbdiff-autoloads nil t))
-
-(use-package magit-imerge
- :load-path "~/src/emacs/magit-imerge/"
- :init (require 'magit-imerge-autoloads nil t))
-
(use-package git-commit
- ;; :load-path "~/src/emacs/magit/lisp/"
:config
(setq git-commit-finish-query-functions nil)
@@ -1229,13 +1189,13 @@
'((name . "go-to-bob"))))
(use-package orgit
- :disabled t
- :load-path "~/src/emacs/orgit/"
- :init (require 'orgit-autoloads nil t))
+ :disabled t)
;;; Command interfaces
+(key-chord-define-global "kx" #'execute-extended-command)
+
(use-package setkey
:bind ("C-c v" . setkey-call))
@@ -1301,7 +1261,6 @@
(global-set-key (kbd "C-c i") #'km/yas-dummy)
:config
(global-set-key (kbd "C-c i") nil)
- (setq yas-fallback-behavior nil)
(defun km/yas-with-comment (str)
(concat comment-start
@@ -1531,8 +1490,6 @@
select-enable-primary t))
(use-package man
- :init
- (define-key km/external-map "m" #'man)
:config
(setq Man-notify-method 'aggressive))
@@ -1742,6 +1699,8 @@
(bind-keys :map km/ledger-prefix-map
("a" . km/ledger-insert-account)
("p" . km/ledger-insert-payee))
+
+ (setq ledger-highlight-xact-under-point nil)
:config
(defun km/ledger-insert-account ()
(interactive)
@@ -1755,18 +1714,23 @@
("C-c m" . km/ledger-prefix-map)))
(use-package rst
- :defer t
:config
(add-hook 'rst-mode-hook #'flyspell-mode))
(use-package denote
:bind (("C-c d d" . denote)
- ("C-c d t" . denote-type))
+ ("C-c d D" . denote-date)
+ ("C-c d t" . denote-type)
+ ("C-c d f" . km/find-file-with-denote-naming)
+ ("C-c d ." . km/denote-find-file-at-point)
+ ("C-c d i" . km/denote-insert-id))
:config
- (setq denote-directory
- (expand-file-name (file-name-as-directory
- (format-time-string "~/notes/%Y"))))
- (setq denote-file-type 'text))
+ (setq denote-directory (expand-file-name "~/notes"))
+ (setq denote-dired-directories (list denote-directory))
+ (setq denote-file-type 'text)
+
+ (with-eval-after-load 'dired
+ (add-hook 'dired-mode-hook #'denote-dired-mode-in-directories)))
;;; Language modes
@@ -1783,7 +1747,7 @@
(use-package haskell-mode
:config
(setq haskell-process-show-debug-tips nil)
- (add-hook 'haskell-mode-hook #'turn-on-haskell-indentation)
+ (add-hook 'haskell-mode-hook #'haskell-indentation-mode)
(add-hook 'haskell-mode-hook #'interactive-haskell-mode)
(add-hook 'haskell-mode-hook #'turn-on-haskell-doc)
(bind-keys :map haskell-mode-map
@@ -1816,15 +1780,12 @@
'("Packages" "^\\s-*(\\(use-package\\)\\s-+\\(\\(\\sw\\|\\s_\\)+\\)" 2))))
(add-hook 'emacs-lisp-mode-hook #'km/imenu-add-use-package))
-(use-package find-function
+(use-package find-func
:bind (("C-h ;" . find-function)
("C-h 4 ;" . find-function-other-window))
:init
(define-key km/file-map "e" #'find-library))
-(use-package paredit
- :diminish (paredit-mode . "Pe"))
-
(use-package lispy
:init
(add-hook 'emacs-lisp-mode-hook #'lispy-mode)
@@ -1873,7 +1834,6 @@
(add-to-list 'interpreter-mode-alist '("python2" . python-mode))
(add-to-list 'interpreter-mode-alist '("python3" . python-mode))
- (pyvenv-tracking-mode 1)
:config
(setq python-fill-docstring-style 'pep-257-nn
python-indent-guess-indent-offset nil)
@@ -1910,15 +1870,7 @@
(require 'km-python))
-(use-package pydoc
- :load-path "~/src/emacs/pydoc/"
- :config
- (setq pydoc-make-method-buttons nil)
- ;; Don't shadow my `ace-link' binding.
- (define-key pydoc-mode-map "o" #'ace-link-help))
-
(use-package km-python
- :bind ("C-h y" . km/pydoc)
:init
(bind-keys :map km/python-prefix-map
("c" . km/python-copy-last-shell-line-as-comment)
@@ -1934,19 +1886,13 @@
(lambda ()
(add-hook
'post-self-insert-hook
- #'km/python-indent-post-self-insert-function 'append 'local)))
-
- (add-hook 'pydoc-after-finish-hook #'km/pydoc-store-name)
- (when (file-exists-p km/pydoc-names-file)
- (km/pydoc-read-names-file km/pydoc-names-file)))
+ #'km/python-indent-post-self-insert-function 'append 'local))))
(use-package snakemake-mode
- :load-path "~/src/emacs/snakemake-mode/"
:init
- (require 'snakemake-autoloads nil t)
- (define-key km/compile-map "s" #'snakemake-popup)
+ (define-key km/compile-map "s" #'snakemake)
(with-eval-after-load 'dired
- (define-key dired-mode-map "b" #'snakemake-popup))
+ (define-key dired-mode-map "b" #'snakemake))
:config
(setq snakemake-root-dir-function #'projectile-project-root)
@@ -2016,7 +1962,6 @@
(use-package notmuch
:init
- (autoload 'notmuch "notmuch" "Notmuch mail" t)
(define-key km/mail-map "n" #'notmuch)
:config
(setq mail-user-agent 'notmuch-user-agent)
@@ -2268,7 +2213,7 @@
(use-package bookmark
:config
(setq bookmark-save-flag nil)
- (setq bookmark-set-fringe-mark nil))
+ (setq bookmark-fringe-mark nil))
(use-package eww
:config
@@ -2311,8 +2256,6 @@
;; Remove all mail map bindings except notmuch-related ones.
(global-set-key (kbd "C-x m n") #'notmuch)
(global-set-key (kbd "C-x m .") #'km/notmuch-show-at-point)
- (with-eval-after-load 'km-python
- (add-hook 'kill-emacs-hook #'km/pydoc-save-names-file))
(savehist-mode 1)
(setq save-abbrevs 'silently
bookmark-save-flag 1)