Update hydras
This commit is contained in:
parent
48991c2d8f
commit
d1fb4a661c
6 changed files with 71 additions and 77 deletions
|
|
@ -24,16 +24,15 @@
|
||||||
;; Hydra
|
;; Hydra
|
||||||
(defhydra my-clojure/context-hydra (:color teal :hint nil)
|
(defhydra my-clojure/context-hydra (:color teal :hint nil)
|
||||||
"
|
"
|
||||||
Clojure actions
|
^ Clojure actions
|
||||||
|
^^^^^^^^--------------------------------------------------------------------------------------------
|
||||||
^Cider^ ^Actions^
|
Buffer: _r_: Reload _f_: Format _l_: Load
|
||||||
^^^^^^^^-----------------------------------------------------------------------
|
Cider: _j_: Jack in _t_: Test
|
||||||
_j_: Jack in _t_: Run loaded test(s)
|
^^
|
||||||
_f_: Format buffer
|
|
||||||
_l_: Load buffer
|
|
||||||
"
|
"
|
||||||
("q" nil "cancel" :color blue)
|
("q" nil "cancel" :color blue)
|
||||||
|
|
||||||
|
("r" revert-buffer-no-confirm)
|
||||||
("j" cider-jack-in)
|
("j" cider-jack-in)
|
||||||
("f" cider-format-buffer)
|
("f" cider-format-buffer)
|
||||||
("l" cider-load-buffer)
|
("l" cider-load-buffer)
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,15 @@
|
||||||
|
|
||||||
(defhydra my-elixir/context-hydra (:color teal :hint nil)
|
(defhydra my-elixir/context-hydra (:color teal :hint nil)
|
||||||
"
|
"
|
||||||
^Elixir actions^
|
^ Elixir actions
|
||||||
^^^^^^^^-----------------------------------------------------------------------
|
^^^^^^^^--------------------------------------------------------------------------------------------
|
||||||
_r_: Reload buffer _f_: Format buffer
|
Buffer: _r_: Reload _f_: Format _i_: Indent
|
||||||
_i_: Indent buffer _m_: iMenu
|
Other: _m_: iMenu
|
||||||
|
^^
|
||||||
"
|
"
|
||||||
("q" nil "cancel" :color blue)
|
("q" nil "cancel" :color blue)
|
||||||
|
|
||||||
("r" revert-buffer-no-confirm)
|
("r" revert-buffer-no-confirm)
|
||||||
("i" indent-region)
|
("i" mark-and-indent-whole-buffer)
|
||||||
|
|
||||||
("f" elixir-format)
|
("f" elixir-format)
|
||||||
("m" lsp-ui-imenu))
|
("m" lsp-ui-imenu))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(require 'icejam-pkg-hydra "$HOME/.emacs.d/pkg/hydra.el")
|
||||||
|
|
||||||
(use-package tuareg
|
(use-package tuareg
|
||||||
:defer t
|
:defer t
|
||||||
:straight t
|
:straight t
|
||||||
|
|
@ -24,15 +26,16 @@
|
||||||
|
|
||||||
(defhydra my-ocaml/context-hydra (:color teal :hint nil)
|
(defhydra my-ocaml/context-hydra (:color teal :hint nil)
|
||||||
"
|
"
|
||||||
OCaml actions
|
^ OCaml actions
|
||||||
|
^^^^^^^^--------------------------------------------------------------------------------------------
|
||||||
^OCaml^ ^Actions^
|
Buffer: _r_: Reload _f_: Format _i_: Indent
|
||||||
^^^^^^^^-----------------------------------------------------------------------
|
Other: _o_: Opam env
|
||||||
_f_: Format buffer
|
^^
|
||||||
_o_: Update opam env
|
|
||||||
"
|
"
|
||||||
("q" nil "cancel" :color blue)
|
("q" nil "cancel" :color blue)
|
||||||
|
|
||||||
|
("r" revert-buffer-no-confirm)
|
||||||
|
("i" mark-and-indent-whole-buffer)
|
||||||
("f" ocamlformat)
|
("f" ocamlformat)
|
||||||
("o" tuareg-opam-update-env))
|
("o" tuareg-opam-update-env))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,7 @@
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;; Old and rudimental completion framework.
|
;;; Old and rudimental completion framework.
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(require 'projectile)
|
(require 'icejam-pkg-projectile "$HOME/.emacs.d/pkg/projectile.el")
|
||||||
|
|
||||||
;; Do not mix ctags between folders
|
|
||||||
(provide 'my-ctags-config)
|
|
||||||
|
|
||||||
(setq tags-add-tables nil)
|
(setq tags-add-tables nil)
|
||||||
|
|
||||||
|
|
@ -27,7 +24,7 @@
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(cl-defun ctags/refresh-ctags (&key silent)
|
(cl-defun ctags/refresh-ctags (&key silent)
|
||||||
"Refresh ctags according to currently set command."
|
"Refresh ctags according to currently set command. With SILENT you can make it, uhh... silent."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
||||||
;; Print message if not silent
|
;; Print message if not silent
|
||||||
|
|
@ -54,5 +51,6 @@
|
||||||
(add-to-list (make-local-variable 'ctags/major-modes-to-update-on-save) mode))
|
(add-to-list (make-local-variable 'ctags/major-modes-to-update-on-save) mode))
|
||||||
|
|
||||||
(add-hook 'after-save-hook 'ctags/update-tags-on-save)
|
(add-hook 'after-save-hook 'ctags/update-tags-on-save)
|
||||||
|
|
||||||
(provide 'icejam-pkg-ctags)
|
(provide 'icejam-pkg-ctags)
|
||||||
;;; ctags.el ends here
|
;;; ctags.el ends here
|
||||||
|
|
|
||||||
90
pkg/hydra.el
90
pkg/hydra.el
|
|
@ -5,23 +5,30 @@
|
||||||
|
|
||||||
(require 'icejam-pkg-avy "$HOME/.emacs.d/pkg/avy.el")
|
(require 'icejam-pkg-avy "$HOME/.emacs.d/pkg/avy.el")
|
||||||
|
|
||||||
|
(defun mark-and-indent-whole-buffer ()
|
||||||
|
"Mark and indent whole buffer."
|
||||||
|
(interactive)
|
||||||
|
(indent-region (point-min) (point-max)))
|
||||||
|
|
||||||
(use-package hydra
|
(use-package hydra
|
||||||
:straight t
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(defhydra hydra-file-switcher-menu (:color teal :hint nil)
|
(defhydra hydra-file-switcher-menu (:color teal :hint nil)
|
||||||
"
|
"
|
||||||
General Actions
|
^ General actions
|
||||||
|
^^^^^^^^--------------------------------------------------------------------------------------------
|
||||||
^Ivy^ ^Perspectives^ ^Projectile^ ^Magit^
|
^Ivy: _a_: Grep in buffer _B_: Buffer list _t_: Find file
|
||||||
^^^^^^^^-------------------------------------------------------------------------------------
|
^Avy: _w_: Goto word _l_: Goto line _:_: Goto char
|
||||||
_a_: Grep in buffer _p_: Switch perspective _s_: Switch project _m_: Git status
|
^
|
||||||
_B_: Buffer list _b_: buffers in perspective _f_: Find file in project _C_: Git checkout
|
^Perspective: _p_: Switch perspective _b_: Buffers in perspective _K_: Kill perspective
|
||||||
_t_: Find file _K_: Kill perspective _g_: Grep in current project _M_: Git blame
|
^Projectile: _s_: Switch project _f_: Find file in project _g_: Grep in project
|
||||||
_d_: Deft _c_: Invalidate cache
|
^ _c_: Invalidate cache _n_: New project
|
||||||
_w_: Avy goto word _n_: New project
|
^Magit: _m_: Git status _C_: Git checkout _M_: Git blame
|
||||||
_l_: Avy goto line _i_: IELM console
|
^
|
||||||
_:_: Avy goto char
|
^LISP: _i_: Console _e_: Eval region
|
||||||
|
^ _d_: Deft
|
||||||
|
^
|
||||||
"
|
"
|
||||||
|
|
||||||
("q" nil "cancel" :color blue)
|
("q" nil "cancel" :color blue)
|
||||||
|
|
@ -44,6 +51,7 @@ _:_: Avy goto char
|
||||||
("c" projectile-invalidate-cache)
|
("c" projectile-invalidate-cache)
|
||||||
("n" projectile-add-known-project)
|
("n" projectile-add-known-project)
|
||||||
("i" ielm)
|
("i" ielm)
|
||||||
|
("e" eval-region)
|
||||||
|
|
||||||
("m" magit-status)
|
("m" magit-status)
|
||||||
("C" magit-checkout)
|
("C" magit-checkout)
|
||||||
|
|
@ -51,16 +59,12 @@ _:_: Avy goto char
|
||||||
|
|
||||||
(defhydra hydra-programming-menu (:color teal :hint nil)
|
(defhydra hydra-programming-menu (:color teal :hint nil)
|
||||||
"
|
"
|
||||||
Programming actions
|
^ Code actions
|
||||||
|
^^^^^^^^--------------------------------------------------------------------------------------------
|
||||||
^Code Manipulation^ ^Code Completion^
|
Manipulate: _c_: Toggle comment _r_: Replace _i_: Indent _a_: Align
|
||||||
^^^^^^^^-----------------------------------------------------------------------
|
Complete: _y_: Snippet _m_: Any (Company)
|
||||||
_c_: Comment line _y_: Yasnippet
|
Find: _s_: Swiper _u_: Undo tree
|
||||||
_r_: Regex replace _m_: Company
|
^
|
||||||
_i_: Indent region _u_: Undo tree
|
|
||||||
_a_: Align to regex
|
|
||||||
_e_: Eval region
|
|
||||||
_s_: Swiper
|
|
||||||
"
|
"
|
||||||
("q" nil "cancel" :color blue)
|
("q" nil "cancel" :color blue)
|
||||||
|
|
||||||
|
|
@ -68,7 +72,6 @@ _s_: Swiper
|
||||||
("r" vr/replace)
|
("r" vr/replace)
|
||||||
("i" indent-region)
|
("i" indent-region)
|
||||||
("a" align-regexp)
|
("a" align-regexp)
|
||||||
("e" eval-region)
|
|
||||||
("s" swiper)
|
("s" swiper)
|
||||||
|
|
||||||
("u" undo-tree-visualize)
|
("u" undo-tree-visualize)
|
||||||
|
|
@ -77,51 +80,52 @@ _s_: Swiper
|
||||||
|
|
||||||
(defhydra hydra-window-menu (:color teal :hint nil)
|
(defhydra hydra-window-menu (:color teal :hint nil)
|
||||||
"
|
"
|
||||||
Window actions
|
^ Buffer actions
|
||||||
|
^^^^^^^^--------------------------------------------------------------------------------------------
|
||||||
^Windows^ ^Move around^
|
Move: _<left>_: Left _<right>_: Right _<up>_: Up _<down>_: Down
|
||||||
^^^^^^^^-----------------------------------------------------------------------
|
Split: _h_: Horizontally _v_: Vertically
|
||||||
_k_: Kill buffer and window _<left>_: Move left
|
_k_: Kill Buffer
|
||||||
_h_: Split horizontally _<right>_: Move right
|
^
|
||||||
_v_: Split vertically _<up>_: Move up
|
|
||||||
_f_: Set font size to screen _<down>_: Move down
|
|
||||||
^^ _p_: Previous buffer
|
|
||||||
^^ _n_: Next buffer
|
|
||||||
"
|
"
|
||||||
("q" nil "cancel" :color blue)
|
("q" nil "cancel" :color blue)
|
||||||
|
|
||||||
("k" kill-buffer-and-window)
|
("k" kill-buffer-and-window)
|
||||||
("h" split-window-below)
|
("h" split-window-below)
|
||||||
("v" split-window-right)
|
("v" split-window-right)
|
||||||
("f" set-font-to-screen)
|
|
||||||
|
|
||||||
("<left>" windmove-left)
|
("<left>" windmove-left)
|
||||||
("<right>" windmove-right)
|
("<right>" windmove-right)
|
||||||
("<up>" windmove-up)
|
("<up>" windmove-up)
|
||||||
("<down>" windmove-down)
|
("<down>" windmove-down))
|
||||||
("p" previous-buffer)
|
|
||||||
("n" next-buffer))
|
|
||||||
|
|
||||||
(defhydra hydra-language-context-menu (:color teal :hint nil)
|
(defhydra hydra-language-context-menu (:color teal :hint nil)
|
||||||
"
|
"
|
||||||
Context actions
|
^ Language-specific actions
|
||||||
|
^^^^^^^^--------------------------------------------------------------------------------------------
|
||||||
^Context^ ^Actions^
|
Buffer: _r_: Reload _f_: Format _i_: Indent
|
||||||
^^^^^^^^-----------------------------------------------------------------------
|
Other: _m_: iMenu
|
||||||
_r_: Reload buffer _f_: Format buffer
|
^^
|
||||||
_i_: Indent buffer _m_: iMenu
|
|
||||||
"
|
"
|
||||||
("q" nil "cancel" :color blue)
|
("q" nil "cancel" :color blue)
|
||||||
|
|
||||||
("r" revert-buffer-no-confirm)
|
("r" revert-buffer-no-confirm)
|
||||||
("i" indent-region)
|
("i" mark-and-indent-whole-buffer)
|
||||||
|
|
||||||
("f" lsp-format-buffer)
|
("f" lsp-format-buffer)
|
||||||
("m" lsp-ui-imenu))
|
("m" lsp-ui-imenu))
|
||||||
|
|
||||||
|
(defhydra hydra-move-menu (:color teal)
|
||||||
|
"Buffer history"
|
||||||
|
("<left>" previous-buffer "Previous buffer")
|
||||||
|
("<right>" next-buffer "Next buffer")
|
||||||
|
("[" previous-buffer "Previous buffer")
|
||||||
|
("]" next-buffer "Next buffer")
|
||||||
|
("q" cancel "quit"))
|
||||||
|
|
||||||
:bind ("C-c p" . hydra-file-switcher-menu/body)
|
:bind ("C-c p" . hydra-file-switcher-menu/body)
|
||||||
("C-c c" . hydra-programming-menu/body)
|
("C-c c" . hydra-programming-menu/body)
|
||||||
("C-c w" . hydra-window-menu/body)
|
("C-c w" . hydra-window-menu/body)
|
||||||
|
("C-c s" . hydra-move-menu/body)
|
||||||
("C-c l" . hydra-language-context-menu/body))
|
("C-c l" . hydra-language-context-menu/body))
|
||||||
|
|
||||||
(provide 'icejam-pkg-hydra)
|
(provide 'icejam-pkg-hydra)
|
||||||
|
|
|
||||||
|
|
@ -34,15 +34,6 @@
|
||||||
(define-key icejam-keys-mode-map (kbd "C-c {") 'windmove-up)
|
(define-key icejam-keys-mode-map (kbd "C-c {") 'windmove-up)
|
||||||
(define-key icejam-keys-mode-map (kbd "C-c }") 'windmove-down)
|
(define-key icejam-keys-mode-map (kbd "C-c }") 'windmove-down)
|
||||||
|
|
||||||
;; Switch to previous and next buffer
|
|
||||||
(define-key icejam-keys-mode-map (kbd "C-c s <left>") 'previous-buffer)
|
|
||||||
(define-key icejam-keys-mode-map (kbd "C-c s <right>") 'next-buffer)
|
|
||||||
|
|
||||||
;; The same, but without arrow keys.
|
|
||||||
(define-key icejam-keys-mode-map (kbd "C-c s [") 'previous-buffer)
|
|
||||||
(define-key icejam-keys-mode-map (kbd "C-c s ]") 'next-buffer)
|
|
||||||
|
|
||||||
|
|
||||||
;; Kill current buffer and window
|
;; Kill current buffer and window
|
||||||
(define-key icejam-keys-mode-map (kbd "C-c q") 'kill-buffer-and-window)
|
(define-key icejam-keys-mode-map (kbd "C-c q") 'kill-buffer-and-window)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue