doom: Spruce up Ctrlf with transient
Ctrlf already makes isearch nice with few extra goodies. With transient,
things become a lot more interactive and discoverable, boosting actual
utility of this venerable and rich tool. Hopefully with this, I'll be
able to make use of it more often
Thanks to :
http://yummymelon.com/devnull/improving-emacs-isearch-usability-with-transient.html
original source:
a4c7bacbd3/cc-isearch-menu.el
This commit is contained in:
parent
33f8f2e276
commit
06bcd2b6d8
1 changed files with 72 additions and 1 deletions
|
@ -926,8 +926,79 @@ All the modifications that are necessary enough to exist, but not big enough to
|
|||
(use-package! ctrlf
|
||||
:demand t
|
||||
:commands (ctrlf-mode)
|
||||
:after (transient)
|
||||
:config
|
||||
(ctrlf-mode +1))
|
||||
(ctrlf-mode +1)
|
||||
(transient-define-prefix b/isearch-menu ()
|
||||
"isearch Menu"
|
||||
[["Edit Search String"
|
||||
("e"
|
||||
"Edit the search string (recursive)"
|
||||
isearch-edit-string
|
||||
:transient nil)
|
||||
("w"
|
||||
"Pull next word or character word from buffer"
|
||||
isearch-yank-word-or-char
|
||||
:transient nil)
|
||||
("s"
|
||||
"Pull next symbol or character from buffer"
|
||||
isearch-yank-symbol-or-char
|
||||
:transient nil)
|
||||
("l"
|
||||
"Pull rest of line from buffer"
|
||||
isearch-yank-line
|
||||
:transient nil)
|
||||
("y"
|
||||
"Pull string from kill ring"
|
||||
isearch-yank-kill
|
||||
:transient nil)
|
||||
("t"
|
||||
"Pull thing from buffer"
|
||||
isearch-forward-thing-at-point
|
||||
:transient nil)]
|
||||
|
||||
["Replace"
|
||||
("q"
|
||||
"Start ‘query-replace’"
|
||||
isearch-query-replace
|
||||
:if-nil buffer-read-only
|
||||
:transient nil)
|
||||
("x"
|
||||
"Start ‘query-replace-regexp’"
|
||||
isearch-query-replace-regexp
|
||||
:if-nil buffer-read-only
|
||||
:transient nil)]]
|
||||
|
||||
[["Toggle"
|
||||
("X"
|
||||
"Toggle regexp searching"
|
||||
isearch-toggle-regexp
|
||||
:transient nil)
|
||||
("S"
|
||||
"Toggle symbol searching"
|
||||
isearch-toggle-symbol
|
||||
:transient nil)
|
||||
("W"
|
||||
"Toggle word searching"
|
||||
isearch-toggle-word
|
||||
:transient nil)
|
||||
("F"
|
||||
"Toggle case fold"
|
||||
isearch-toggle-case-fold
|
||||
:transient nil)
|
||||
("L"
|
||||
"Toggle lax whitespace"
|
||||
isearch-toggle-lax-whitespace
|
||||
:transient nil)]
|
||||
|
||||
["Misc"
|
||||
("o"
|
||||
"occur"
|
||||
isearch-occur
|
||||
:transient nil)]])
|
||||
|
||||
(map! (:map (ctrlf-mode-map)
|
||||
:desc "isearch-menu" "C-." #'b/isearch-menu)))
|
||||
#+end_src
|
||||
|
||||
** Company
|
||||
|
|
Reference in a new issue