[hydra] create multiple cursors hydra

This commit is contained in:
contrapunctus 2021-02-20 04:55:55 +05:30
parent 4f314d8e2b
commit b2d431d17e
1 changed files with 51 additions and 22 deletions

View File

@ -822,6 +822,33 @@ Add these common operations to the hydra -
("l" enlarge-window-horizontally "increase width")
("k" shrink-window-horizontally "decrease width"))
#+END_SRC
*** multiple cursors
#+BEGIN_SRC emacs-lisp
(defhydra contrapunctus-mc-hydra (:color red :hint none)
"
_a_: previous word ^^^^ _h_: previous whole symbol
_,_: all words ^_i_: insert letters^ _c_: all symbols
_._: words in defun ^_d_: insert numbers^ _r_: symbols in defun
_u_: next word ^^^^ _s_: next whole symbol
"
("l" mc/edit-lines "edit lines")
("a" mc/mark-previous-word-like-this)
("," mc/mark-all-words-like-this)
("." mc/mark-all-words-like-this-in-defun)
("u" mc/mark-next-word-like-this)
;; ("a" mc/mark-previous-like-this-word "previous word")
;; ("u" mc/mark-next-like-this-word "next word")
("h" mc/mark-previous-symbol-like-this)
("c" mc/mark-all-symbols-like-this)
("r" mc/mark-all-symbols-like-this-in-defun)
("s" mc/mark-next-symbol-like-this)
;; ("s" mc/mark-previous-like-this-symbol "previous symbol")
;; ("h" mc/mark-next-like-this-symbol "next symbol")
("d" mc/insert-numbers)
("i" mc/insert-letters))
#+END_SRC
*** General
#+BEGIN_SRC emacs-lisp
(defhydra contrapunctus-general-hydra (:color blue)
@ -833,6 +860,7 @@ Add these common operations to the hydra -
("P" list-packages "packages")
("e" contrapunctus-emms-hydra/body "emms")
("C" contrapunctus-mc-hydra/body "multiple cursors")
("h" helpful-at-point "Help")
("i" (find-file "~/.emacs.d/init.org") "open init")
("d" dired-jump "dired-jump")
@ -888,19 +916,6 @@ Add these common operations to the hydra -
("H" org-promote-subtree "promote")
("S" org-demote-subtree "demote"))
#+END_SRC
*** eval
#+BEGIN_SRC emacs-lisp
(defhydra cp-el-eval (:color blue)
("b" eval-buffer "buffer")
("e" eval-defun "defun")
("l" eval-last-sexp "last sexp"))
#+END_SRC
*** unit testing
#+BEGIN_SRC emacs-lisp
(defhydra contrapunctus-el-test (:color blue)
("e" (cp/compile-project "Cask" "cask exec buttercup -L . --traceback pretty") "buttercup")
("r" ert "ert"))
#+END_SRC
*** Emacs Lisp
#+BEGIN_SRC emacs-lisp
(defhydra cp-el (:color blue)
@ -911,9 +926,10 @@ Add these common operations to the hydra -
("h" helpful-at-point "Help")
("j" xref-find-definitions "Jump to definition")
("b" (cp/compile-project "Cask" "cask build") "Compile")
("C" (cp/compile-project "Cask" "cask clean-elc") "clean")
("B" (cp/compile-project "Cask" "cask clean-elc") "clean")
("t" (contrapunctus-el-test/body) "Test")
("C" contrapunctus-mc-hydra/body "multiple cursors")
("i" (find-file "~/.emacs.d/init.org") "open init")
("d" dired-jump "dired-jump")
("u" find-file "new")
@ -927,17 +943,18 @@ Add these common operations to the hydra -
("Q" toggle-debug-on-quit "tdoq")
("G" contrapunctus-programming-hydra/body "up"))
#+END_SRC
*** eval
**** eval
#+BEGIN_SRC emacs-lisp
(defhydra cp-cl-eval (:color blue)
("b" slime-eval-buffer "buffer")
("e" slime-eval-defun "defun"))
(defhydra cp-el-eval (:color blue)
("b" eval-buffer "buffer")
("e" eval-defun "defun")
("l" eval-last-sexp "last sexp"))
#+END_SRC
*** documentation
**** unit testing
#+BEGIN_SRC emacs-lisp
(defhydra cp-cl-doc (:color blue)
("d" slime-documentation "slime")
("e" slime-documentation-lookup "CLHS"))
(defhydra contrapunctus-el-test (:color blue)
("e" (cp/compile-project "Cask" "cask exec buttercup -L . --traceback pretty") "buttercup")
("r" ert "ert"))
#+END_SRC
*** Common Lisp
#+BEGIN_SRC emacs-lisp
@ -959,6 +976,18 @@ Add these common operations to the hydra -
("m" magit-status "Magit")
("G" contrapunctus-programming-hydra/body "up"))
#+END_SRC
**** eval
#+BEGIN_SRC emacs-lisp
(defhydra cp-cl-eval (:color blue)
("b" slime-eval-buffer "buffer")
("e" slime-eval-defun "defun"))
#+END_SRC
**** documentation
#+BEGIN_SRC emacs-lisp
(defhydra cp-cl-doc (:color blue)
("d" slime-documentation "slime")
("e" slime-documentation-lookup "CLHS"))
#+END_SRC
*** Scheme
**** eval
#+BEGIN_SRC emacs-lisp