Files
.emacs.d/lisp/init-utils.el

76 lines
2.6 KiB
EmacsLisp
Raw Normal View History

2025-12-15 22:08:54 +11:00
;; -*- lexical-binding: t; -*-
(use-package which-key
:diminish
:functions childframe-completion-workable-p
:bind ("C-h M-m" . which-key-show-major-mode)
2026-03-29 19:12:45 +11:00
:hook (after-init . which-key-mode)
2025-12-15 22:08:54 +11:00
:init (setq which-key-max-description-length 30
2026-03-24 22:02:04 +11:00
which-key-idle-delay 0.5
2025-12-15 22:08:54 +11:00
which-key-lighter nil
which-key-show-remaining-keys t)
:config
2026-03-22 23:57:48 +11:00
(which-key-add-key-based-replacements "C-c a" "LSP")
2026-03-29 19:12:45 +11:00
(which-key-add-key-based-replacements "C-c b" "beframe")
2026-03-22 23:57:48 +11:00
(which-key-add-key-based-replacements "C-c c" "code")
(which-key-add-key-based-replacements "C-c n" "org")
2025-12-15 22:08:54 +11:00
(which-key-add-key-based-replacements "C-c l" "llm")
(which-key-add-key-based-replacements "C-c f" "find")
2026-03-22 23:57:48 +11:00
(which-key-add-key-based-replacements "C-x p" "project")
2026-03-20 00:44:25 +11:00
(which-key-add-key-based-replacements "C-c !" "flycheck")
(which-key-add-key-based-replacements "C-c &" "yasnippet")
2025-12-15 22:08:54 +11:00
(which-key-add-key-based-replacements "C-c q" "quit")
2026-03-20 00:44:25 +11:00
(which-key-add-key-based-replacements "C-c C-w" "workspace")
2026-03-22 23:57:48 +11:00
(which-key-add-key-based-replacements "C-c w" "windows")
(which-key-add-key-based-replacements "C-x a" "abbrevs")
(which-key-add-key-based-replacements "C-x b" "abbrevs")
(which-key-add-key-based-replacements "C-x r" "rectangle/bookmarks")
(which-key-add-key-based-replacements "C-x t" "tabs")
(which-key-add-key-based-replacements "C-x v" "version control"))
2025-12-15 22:08:54 +11:00
(use-package grep
:ensure nil
:autoload grep-apply-setting
:init
(when (executable-find "rg")
(grep-apply-setting
'grep-command "rg --color=auto --null -nH --no-heading -e ")
(grep-apply-setting
'grep-template "rg --color=auto --null --no-heading -g '!*/' -e <R> <D>")
(grep-apply-setting
'grep-find-command '("rg --color=auto --null -nH --no-heading -e ''" . 38))
(grep-apply-setting
'grep-find-template "rg --color=auto --null -nH --no-heading -e <R> <D>")))
2026-03-22 23:57:48 +11:00
;; Writable grep buffer
(use-package wgrep
:init (setq wgrep-auto-save-buffer t
wgrep-change-readonly-file t))
;; Fast search tool `ripgrep'
(use-package rg
2026-03-29 19:12:45 +11:00
:hook (after-init . rg-enable-default-bindings)
2026-03-22 23:57:48 +11:00
:bind (:map rg-global-map
2026-03-24 22:02:04 +11:00
("c" . rg-dwim-current-dir)
("f" . rg-dwim-current-file)
("m" . rg-menu))
2026-03-22 23:57:48 +11:00
:init (setq rg-show-columns t)
:config (add-to-list 'rg-custom-type-aliases '("tmpl" . "*.tmpl")))
2026-03-29 19:12:45 +11:00
;; (use-package pdf-tools
;; :config
;; (pdf-tools-install))
2026-02-08 23:44:31 +11:00
2026-03-29 19:12:45 +11:00
;; (use-package saveplace-pdf-view
;; :after pdf-tools
;; :demand t)
2026-03-24 22:02:04 +11:00
2026-02-25 22:12:47 +11:00
;; (use-package keycast
2026-03-29 19:12:45 +11:00
;; :hook (after-init . keycast-mode-line-mode)
2026-02-25 22:12:47 +11:00
;; :config
;; (setq keycast-mode-line-remove-tail-elements nil))
2025-12-16 01:58:26 +11:00
2026-03-20 22:04:25 +11:00
(use-package elcord)
2025-12-15 22:08:54 +11:00
(provide 'init-utils)