ThoomEmacs update
- Indent with spaces - Single space after period for sentences - Remove thoom/repeat-map macro - Add SPC f r binding for consult-recent-file - Add g d and g u bindings for meow - add q binding for meow to cancel selection - add dumb-jump - add ttm-org-clear-all function
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
(bootstrap-version 6))
|
||||
(unless (file-exists-p bootstrap-file)
|
||||
(with-current-buffer
|
||||
(url-retrieve-synchronously
|
||||
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
||||
'silent 'inhibit-cookies)
|
||||
(url-retrieve-synchronously
|
||||
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
||||
'silent 'inhibit-cookies)
|
||||
(goto-char (point-max))
|
||||
(eval-print-last-sexp)))
|
||||
(load bootstrap-file nil 'nomessage))
|
||||
@@ -24,14 +24,14 @@
|
||||
:if (and ON-MAC (memq window-system '(mac ns)))
|
||||
:config
|
||||
(dolist (var '("NIX_SSL_CERT_FILE"
|
||||
"NIX_PATH"
|
||||
"NIX_PROFILES"))
|
||||
"NIX_PATH"
|
||||
"NIX_PROFILES"))
|
||||
(add-to-list 'exec-path-from-shell-variables var))
|
||||
(exec-path-from-shell-initialize))
|
||||
|
||||
(defun thoom/org-babel-tangle-config ()
|
||||
(when (string-equal (file-truename (buffer-file-name))
|
||||
(expand-file-name "~/.dotfiles/thoom-emacs/ThoomEmacs.org"))
|
||||
(expand-file-name "~/.dotfiles/thoom-emacs/ThoomEmacs.org"))
|
||||
;; Dynamic scoping to the rescue
|
||||
(let ((org-confirm-babel-evaluate nil))
|
||||
(org-babel-tangle))))
|
||||
@@ -43,7 +43,7 @@
|
||||
:config
|
||||
;; Global settings (defaults)
|
||||
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
|
||||
doom-themes-enable-italic t) ; if nil, italics is universally disabled
|
||||
doom-themes-enable-italic t) ; if nil, italics is universally disabled
|
||||
(load-theme 'doom-one t)
|
||||
|
||||
;; Enable flashing mode-line on errors
|
||||
@@ -85,6 +85,7 @@
|
||||
;; tabs are for monsters
|
||||
(setq-default indent-tabs-mode nil)
|
||||
(setq-default tab-width 4)
|
||||
(setq-default sentence-end-double-space nil)
|
||||
|
||||
(use-package hl-todo
|
||||
:straight t
|
||||
@@ -93,22 +94,6 @@
|
||||
|
||||
(repeat-mode 1)
|
||||
|
||||
(defmacro thoom/repeat-map (keymap-sym &rest bindings)
|
||||
"A helper macro for defining repeat maps. keymap-sym is a symbol to name the keymap with.
|
||||
bindings are a sequence of cons cells containing a string to be passed to kbd and a function
|
||||
for that key to be mapped to."
|
||||
(declare (indent 1))
|
||||
`(progn
|
||||
(defvar ,keymap-sym
|
||||
(let ((map (make-sparse-keymap)))
|
||||
,@(mapcar (lambda (binding) `(define-key map (kbd ,(car binding)) ',(cdr binding))) bindings)
|
||||
map))
|
||||
(map-keymap
|
||||
(lambda (_key cmd)
|
||||
(when (symbolp cmd)
|
||||
(put cmd 'repeat-map ',keymap-sym)))
|
||||
,keymap-sym)))
|
||||
|
||||
(tab-bar-mode)
|
||||
|
||||
;; TODO - keybindings
|
||||
@@ -157,6 +142,7 @@
|
||||
|
||||
;; File management
|
||||
("C-c f f" . find-file)
|
||||
("C-c f r" . consult-recent-file)
|
||||
("C-c f j" . dired-jump)
|
||||
|
||||
;; TODO - C-c g p for open project in magit
|
||||
@@ -194,24 +180,24 @@
|
||||
;; TODO - debug this. should make org headings into meow things
|
||||
(meow-thing-register 'heading 'heading 'heading)
|
||||
(setq meow-use-clipboard t
|
||||
meow-char-thing-table '((?\( . round)
|
||||
(?\) . round)
|
||||
(?\[ . square)
|
||||
(?\] . square)
|
||||
(?\{ . curly)
|
||||
(?\} . curly)
|
||||
(?\" . string)
|
||||
(?\' . string)
|
||||
(?h . heading)
|
||||
(?e . symbol)
|
||||
(?w . window)
|
||||
(?b . buffer)
|
||||
(?p . paragraph)
|
||||
(?l . line)
|
||||
(?d . defun)
|
||||
(?. . sentence))
|
||||
meow-cheatsheet-layout meow-cheatsheet-layout-qwerty
|
||||
meow-keypad-self-insert-undefined nil)
|
||||
meow-char-thing-table '((?\( . round)
|
||||
(?\) . round)
|
||||
(?\[ . square)
|
||||
(?\] . square)
|
||||
(?\{ . curly)
|
||||
(?\} . curly)
|
||||
(?\" . string)
|
||||
(?\' . string)
|
||||
(?h . heading)
|
||||
(?e . symbol)
|
||||
(?w . window)
|
||||
(?b . buffer)
|
||||
(?p . paragraph)
|
||||
(?l . line)
|
||||
(?d . defun)
|
||||
(?. . sentence))
|
||||
meow-cheatsheet-layout meow-cheatsheet-layout-qwerty
|
||||
meow-keypad-self-insert-undefined nil)
|
||||
|
||||
(add-to-list 'meow-mode-state-list '(eshell-mode . insert) t)
|
||||
(add-hook 'git-commit-mode-hook 'meow-insert)
|
||||
@@ -265,6 +251,7 @@
|
||||
'("." . meow-bounds-of-thing)
|
||||
'("[" . meow-beginning-of-thing)
|
||||
'("]" . meow-end-of-thing)
|
||||
;; Potential addition <, >
|
||||
|
||||
'("a" . meow-append)
|
||||
'("A" . meow-open-below)
|
||||
@@ -278,7 +265,9 @@
|
||||
'("E" . meow-next-symbol)
|
||||
'("f" . meow-find)
|
||||
`("F" . ,(thoom/meow-negate 'meow-find))
|
||||
'("g" . meow-cancel-selection)
|
||||
'("g g" . meow-cancel-selection)
|
||||
'("g d" . xref-find-definitions)
|
||||
'("g u" . xref-find-references)
|
||||
'("G" . meow-grab)
|
||||
'("h" . meow-left)
|
||||
'("H" . meow-left-expand)
|
||||
@@ -298,7 +287,7 @@
|
||||
'("O" . meow-to-block)
|
||||
'("p" . meow-yank)
|
||||
'("P" . consult-yank-pop)
|
||||
;; Potential addition - q
|
||||
'("q" . meow-cancel-selection)
|
||||
;; Potential addition - Q
|
||||
'("r" . meow-replace)
|
||||
'("R" . meow-swap-grab)
|
||||
@@ -356,46 +345,63 @@
|
||||
:init
|
||||
(setq tab-always-indent 'complete))
|
||||
|
||||
(use-package dumb-jump
|
||||
:straight t
|
||||
:config
|
||||
(add-hook 'xref-backend-functions #'dumb-jump-xref-activate)
|
||||
(setq xref-show-definitions-function #'xref-show-definitions-completing-read))
|
||||
|
||||
(use-package org
|
||||
:hook (org-mode . visual-line-mode)
|
||||
:bind (:map
|
||||
org-mode-map
|
||||
("C-x C-o c" . thoom-org-clear-all)
|
||||
:repeat-map
|
||||
thoom/org-previous-next-visible-heading-repeat-map
|
||||
("n" . org-next-visible-heading)
|
||||
("C-n" . org-next-visible-heading)
|
||||
("p" . org-previous-visible-heading)
|
||||
("C-p" . org-previous-visible-heading))
|
||||
:config
|
||||
;; Add structure templates
|
||||
(add-to-list 'org-modules 'org-tempo t)
|
||||
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
|
||||
|
||||
(setq org-edit-src-content-indentation 0)
|
||||
|
||||
;; Repeat map for previous/next heading
|
||||
(thoom/repeat-map thoom/org-previous-next-visible-heading-repeat-map
|
||||
("n" . org-next-visible-heading)
|
||||
("C-n" . org-next-visible-heading)
|
||||
("p" . org-previous-visible-heading)
|
||||
("C-p" . org-previous-visible-heading)))
|
||||
(setq org-edit-src-content-indentation 0))
|
||||
|
||||
(use-package org-bullets
|
||||
:straight t
|
||||
:hook org-mode)
|
||||
|
||||
(defun thoom-org-clear-all ()
|
||||
(interactive)
|
||||
(goto-char 0)
|
||||
(org-map-entries
|
||||
(lambda ()
|
||||
(org-todo "")))
|
||||
(flush-lines "CLOSED")
|
||||
(message "Entries cleared."))
|
||||
|
||||
(use-package vertico
|
||||
:straight (:files (:defaults "extensions/*"))
|
||||
:init
|
||||
(vertico-mode)
|
||||
|
||||
:bind (:map vertico-map
|
||||
("C-j" . vertico-next)
|
||||
("C-k" . vertico-previous)))
|
||||
("C-j" . vertico-next)
|
||||
("C-k" . vertico-previous)))
|
||||
|
||||
(use-package vertico-directory
|
||||
:after vertico
|
||||
:bind (:map vertico-map
|
||||
("C-h" . vertico-directory-delete-word)
|
||||
("C-l" . vertico-directory-enter)))
|
||||
("C-h" . vertico-directory-delete-word)
|
||||
("C-l" . vertico-directory-enter)))
|
||||
|
||||
(use-package marginalia
|
||||
:straight t
|
||||
;; Either bind `marginalia-cycle' globally or only in the minibuffer
|
||||
:bind (:map minibuffer-local-map
|
||||
("M-A" . marginalia-cycle))
|
||||
("M-A" . marginalia-cycle))
|
||||
|
||||
:init
|
||||
(marginalia-mode))
|
||||
@@ -407,63 +413,63 @@
|
||||
;; (setq orderless-style-dispatchers '(+orderless-dispatch)
|
||||
;; orderless-component-separator #'orderless-escapable-split-on-space)
|
||||
(setq completion-styles '(orderless basic)
|
||||
completion-category-defaults nil
|
||||
completion-category-overrides '((file (styles partial-completion)))))
|
||||
completion-category-defaults nil
|
||||
completion-category-overrides '((file (styles partial-completion)))))
|
||||
|
||||
(use-package consult
|
||||
:straight t
|
||||
;; Replace bindings. Lazily loaded due by `use-package'.
|
||||
:bind (;; C-c bindings (mode-specific-map)
|
||||
("C-c h" . consult-history)
|
||||
("C-c m" . consult-mode-command)
|
||||
("C-c k" . consult-kmacro)
|
||||
;; C-x bindings (ctl-x-map)
|
||||
("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
|
||||
("C-x C-b" . consult-buffer)
|
||||
("C-x b" . consult-buffer) ;; orig. switch-to-buffer
|
||||
("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
|
||||
("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
|
||||
("C-x r b" . consult-bookmark) ;; orig. bookmark-jump
|
||||
("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
|
||||
;; Custom M-# bindings for fast register access
|
||||
("M-#" . consult-register-load)
|
||||
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
|
||||
("C-M-#" . consult-register)
|
||||
;; Other custom bindings
|
||||
("M-y" . consult-yank-pop) ;; orig. yank-pop
|
||||
("<help> a" . consult-apropos) ;; orig. apropos-command
|
||||
;; M-g bindings (goto-map)
|
||||
("M-g e" . consult-compile-error)
|
||||
("M-g f" . consult-flymake) ;; Alternative: consult-flycheck
|
||||
("M-g g" . consult-goto-line) ;; orig. goto-line
|
||||
("M-g M-g" . consult-goto-line) ;; orig. goto-line
|
||||
("M-g o" . consult-outline) ;; Alternative: consult-org-heading
|
||||
("M-g m" . consult-mark)
|
||||
("M-g k" . consult-global-mark)
|
||||
("M-g i" . consult-imenu)
|
||||
("M-g I" . consult-imenu-multi)
|
||||
;; M-s bindings (search-map)
|
||||
("M-s d" . consult-find)
|
||||
("M-s D" . consult-locate)
|
||||
("M-s g" . consult-grep)
|
||||
("M-s G" . consult-git-grep)
|
||||
("M-s r" . consult-ripgrep)
|
||||
("M-s l" . consult-line)
|
||||
("M-s L" . consult-line-multi)
|
||||
("M-s m" . consult-multi-occur)
|
||||
("M-s k" . consult-keep-lines)
|
||||
("M-s u" . consult-focus-lines)
|
||||
;; Isearch integration
|
||||
("M-s e" . consult-isearch-history)
|
||||
:map isearch-mode-map
|
||||
("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
|
||||
("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string
|
||||
("M-s l" . consult-line) ;; needed by consult-line to detect isearch
|
||||
("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch
|
||||
;; Minibuffer history
|
||||
:map minibuffer-local-map
|
||||
("M-s" . consult-history) ;; orig. next-matching-history-element
|
||||
("M-r" . consult-history)) ;; orig. previous-matching-history-element
|
||||
("C-c h" . consult-history)
|
||||
("C-c m" . consult-mode-command)
|
||||
("C-c k" . consult-kmacro)
|
||||
;; C-x bindings (ctl-x-map)
|
||||
("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
|
||||
("C-x C-b" . consult-buffer)
|
||||
("C-x b" . consult-buffer) ;; orig. switch-to-buffer
|
||||
("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
|
||||
("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
|
||||
("C-x r b" . consult-bookmark) ;; orig. bookmark-jump
|
||||
("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
|
||||
;; Custom M-# bindings for fast register access
|
||||
("M-#" . consult-register-load)
|
||||
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
|
||||
("C-M-#" . consult-register)
|
||||
;; Other custom bindings
|
||||
("M-y" . consult-yank-pop) ;; orig. yank-pop
|
||||
("<help> a" . consult-apropos) ;; orig. apropos-command
|
||||
;; M-g bindings (goto-map)
|
||||
("M-g e" . consult-compile-error)
|
||||
("M-g f" . consult-flymake) ;; Alternative: consult-flycheck
|
||||
("M-g g" . consult-goto-line) ;; orig. goto-line
|
||||
("M-g M-g" . consult-goto-line) ;; orig. goto-line
|
||||
("M-g o" . consult-outline) ;; Alternative: consult-org-heading
|
||||
("M-g m" . consult-mark)
|
||||
("M-g k" . consult-global-mark)
|
||||
("M-g i" . consult-imenu)
|
||||
("M-g I" . consult-imenu-multi)
|
||||
;; M-s bindings (search-map)
|
||||
("M-s d" . consult-find)
|
||||
("M-s D" . consult-locate)
|
||||
("M-s g" . consult-grep)
|
||||
("M-s G" . consult-git-grep)
|
||||
("M-s r" . consult-ripgrep)
|
||||
("M-s l" . consult-line)
|
||||
("M-s L" . consult-line-multi)
|
||||
("M-s m" . consult-multi-occur)
|
||||
("M-s k" . consult-keep-lines)
|
||||
("M-s u" . consult-focus-lines)
|
||||
;; Isearch integration
|
||||
("M-s e" . consult-isearch-history)
|
||||
:map isearch-mode-map
|
||||
("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
|
||||
("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string
|
||||
("M-s l" . consult-line) ;; needed by consult-line to detect isearch
|
||||
("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch
|
||||
;; Minibuffer history
|
||||
:map minibuffer-local-map
|
||||
("M-s" . consult-history) ;; orig. next-matching-history-element
|
||||
("M-r" . consult-history)) ;; orig. previous-matching-history-element
|
||||
|
||||
;; Enable automatic preview at point in the *Completions* buffer. This is
|
||||
;; relevant when you use the default completion UI.
|
||||
@@ -476,7 +482,7 @@
|
||||
;; preview for `consult-register', `consult-register-load',
|
||||
;; `consult-register-store' and the Emacs built-ins.
|
||||
(setq register-preview-delay 0.5
|
||||
register-preview-function #'consult-register-format)
|
||||
register-preview-function #'consult-register-format)
|
||||
|
||||
;; Optionally tweak the register preview window.
|
||||
;; This adds thin lines, sorting and hides the mode line of the window.
|
||||
@@ -484,7 +490,7 @@
|
||||
|
||||
;; Use Consult to select xref locations with preview
|
||||
(setq xref-show-xrefs-function #'consult-xref
|
||||
xref-show-definitions-function #'consult-xref)
|
||||
xref-show-definitions-function #'consult-xref)
|
||||
|
||||
;; Configure other variables and modes in the :config section,
|
||||
;; after lazily loading the package.
|
||||
@@ -543,9 +549,9 @@
|
||||
:config
|
||||
;; Hide the mode line of the Embark live/completions buffers
|
||||
(add-to-list 'display-buffer-alist
|
||||
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
|
||||
nil
|
||||
(window-parameters (mode-line-format . none)))))
|
||||
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
|
||||
nil
|
||||
(window-parameters (mode-line-format . none)))))
|
||||
|
||||
;; Consult users will also want the embark-consult package.
|
||||
(use-package embark-consult
|
||||
@@ -561,9 +567,9 @@
|
||||
:straight t
|
||||
:custom (magit-save-repository-buffers 'dontask)
|
||||
:bind (("C-x g" . magit-status)
|
||||
:map magit-mode-map
|
||||
(":" . execute-extended-command)
|
||||
("x" . magit-discard)))
|
||||
:map magit-mode-map
|
||||
(":" . execute-extended-command)
|
||||
("x" . magit-discard)))
|
||||
|
||||
(use-package direnv
|
||||
:straight t
|
||||
|
||||
Reference in New Issue
Block a user