chore: stylefix

This commit is contained in:
Laurens Miers 2025-05-27 11:52:05 +02:00
parent 3f93a19d4b
commit a79987f30f

View file

@ -182,8 +182,8 @@ Inspired by [[https://github.com/LionyxML/emacs-solo][emacs-solo]]:
(interactive)
(when isearch-other-end
(let ((selection (buffer-substring-no-properties isearch-other-end (point))))
(kill-new selection)
(isearch-exit))))
(kill-new selection)
(isearch-exit))))
;; Bind `M-w` in isearch to copy the selected word, so M-s M-. M-w
;; does a great job of 'copying the current word under cursor'.
@ -338,58 +338,58 @@ C-c C-c to apply."
(use-package consult
;; Replace bindings. Lazily loaded by `use-package'.
:bind (;; C-c bindings in `mode-specific-map'
;; ("C-c M-x" . consult-mode-command)
;; ("C-c h" . consult-history)
;; ("C-c k" . consult-kmacro)
;; ("C-c m" . consult-man)
;; ("C-c i" . consult-info)
([remap Info-search] . consult-info)
;; C-x bindings in `ctl-x-map'
("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
("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 t b" . consult-buffer-other-tab) ;; orig. switch-to-buffer-other-tab
("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
;; M-g bindings in `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-i" . consult-imenu)
("M-I" . consult-imenu-multi)
;; M-s bindings in `search-map'
("M-s d" . consult-find) ;; Alternative: consult-fd
;; ("M-s c" . 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 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 M-x" . consult-mode-command)
;; ("C-c h" . consult-history)
;; ("C-c k" . consult-kmacro)
;; ("C-c m" . consult-man)
;; ("C-c i" . consult-info)
([remap Info-search] . consult-info)
;; C-x bindings in `ctl-x-map'
("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
("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 t b" . consult-buffer-other-tab) ;; orig. switch-to-buffer-other-tab
("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
;; M-g bindings in `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-i" . consult-imenu)
("M-I" . consult-imenu-multi)
;; M-s bindings in `search-map'
("M-s d" . consult-find) ;; Alternative: consult-fd
;; ("M-s c" . 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 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.
@ -402,7 +402,7 @@ C-c C-c to apply."
;; 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.
@ -410,7 +410,7 @@ C-c C-c to apply."
;; 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.
@ -449,10 +449,10 @@ C-c C-c to apply."
#+BEGIN_SRC emacs-lisp
(setq completion-in-region-function
(lambda (&rest args)
(apply (if vertico-mode
#'consult-completion-in-region
#'completion--in-region)
args)))
(apply (if vertico-mode
#'consult-completion-in-region
#'completion--in-region)
args)))
#+END_SRC
*** Corfu
@ -488,7 +488,7 @@ C-c C-c to apply."
** Orderless
#+begin_src emacs-lisp
#+BEGIN_SRC emacs-lisp
(use-package orderless
:demand t
:custom
@ -508,18 +508,18 @@ C-c C-c to apply."
;; )
;; )
)
#+end_src
#+END_SRC
** Marginalia
#+begin_src emacs-lisp
#+BEGIN_SRC emacs-lisp
;; Enable rich annotations using the Marginalia package
(use-package marginalia
;; Bind `marginalia-cycle' locally in the minibuffer. To make the binding
;; available in the *Completions* buffer, add it to the
;; `completion-list-mode-map'.
:bind (:map minibuffer-local-map
("M-A" . marginalia-cycle))
("M-A" . marginalia-cycle))
;; The :init section is always executed.
:init
@ -527,7 +527,7 @@ C-c C-c to apply."
;; the mode gets enabled right away. Note that this forces loading the
;; package.
(marginalia-mode))
#+end_src
#+END_SRC
* Dired
@ -541,10 +541,10 @@ C-c C-c to apply."
)
(add-hook 'dired-mode-hook
(lambda ()
;; Set dired-x buffer-local variables here. For example:
;; (dired-omit-mode 1)
))
(lambda ()
;; Set dired-x buffer-local variables here. For example:
;; (dired-omit-mode 1)
))
#+end_src
** Guess target directory
@ -565,9 +565,8 @@ Operate on the current line if no region is active.
#+begin_src emacs-lisp
(use-package whole-line-or-region
:config
(whole-line-or-region-global-mode 1)
:config
(whole-line-or-region-global-mode 1)
)
#+end_src
@ -689,12 +688,12 @@ https://github.com/victorhge/iedit
)
(mapc (lambda (mode)
(font-lock-add-keywords
mode
'(
("\\<\\(FIXME\\)" 1 'highlight-angry-faces t)
("\\<\\(TODO\\)" 1 'highlight-angry-faces t)
)))
(font-lock-add-keywords
mode
'(
("\\<\\(FIXME\\)" 1 'highlight-angry-faces t)
("\\<\\(TODO\\)" 1 'highlight-angry-faces t)
)))
'(text-mode emacs-lisp-mode rust-mode zig-mode c-ts-mode c-mode prog-mode)
)
#+END_SRC
@ -758,10 +757,10 @@ https://github.com/victorhge/iedit
** Dumb-jump
#+BEGIN_SRC emacs-lisp
(use-package dumb-jump
:init
(add-hook 'xref-backend-functions #'dumb-jump-xref-activate)
)
(use-package dumb-jump
:init
(add-hook 'xref-backend-functions #'dumb-jump-xref-activate)
)
#+END_SRC
** C-programming
@ -841,8 +840,8 @@ https://github.com/remyferre/comment-dwim-2
#+BEGIN_SRC emacs-lisp
(use-package comment-dwim-2
:config
(global-set-key (kbd "M-;") 'comment-dwim-2)
:bind
("M-;" . comment-dwim-2)
)
#+END_SRC
@ -1006,11 +1005,11 @@ Inspired by https://github.com/org-roam/org-roam/wiki/User-contributed-Tricks#fi
"Select a single tag from list and filter `org-roam-node' by it."
(interactive)
(let ((tag (car (completing-read-multiple "Tag: "
(org-roam-tag-completions)))))
(org-roam-tag-completions)))))
(org-roam-node-find nil nil
(lambda (node)
(member tag
(org-roam-node-tags node))))))
(lambda (node)
(member tag
(org-roam-node-tags node))))))
#+END_SRC
** Font
@ -1061,7 +1060,7 @@ in a local directory (on Linux this is ~/.local/share/fonts).
(when buffer-file-name
(find-alternate-file
(concat "/sudo:root@localhost:"
buffer-file-name)
buffer-file-name)
)
)
)
@ -1089,9 +1088,9 @@ in a local directory (on Linux this is ~/.local/share/fonts).
(defun myrmi/run-ceedling-tests (&optional file-name)
(interactive)
(let* (
(file-path (or file-name buffer-file-name))
(root-path (or (locate-dominating-file file-path ceedling-project-file-name) ceedling-project-root))
)
(file-path (or file-name buffer-file-name))
(root-path (or (locate-dominating-file file-path ceedling-project-file-name) ceedling-project-root))
)
(compile
(concat "cd " root-path " && " ceedling-cmd)
)
@ -1128,8 +1127,8 @@ in a local directory (on Linux this is ~/.local/share/fonts).
(let ((dir default-directory))
(dolist (buffer (buffer-list))
(with-current-buffer buffer
(when (equal default-directory dir)
(myrmi/reload-dir-locals-for-current-buffer))))))
(when (equal default-directory dir)
(myrmi/reload-dir-locals-for-current-buffer))))))
#+END_SRC
** Visit/reload config