diff --git a/03hydra.el b/03hydra.el index 7e19136..4aa8df5 100644 --- a/03hydra.el +++ b/03hydra.el @@ -21,3 +21,26 @@ _t_: Find file _g_: ag in current project ("m" magit-status)) (global-set-key (kbd "C-c p") 'hydra-file-switcher-menu/body) + +(defhydra hydra-programming-actions (:color teal :hint nil :columns 4) + " + Programming actions + +^Windows^ ^Code Manipulation^ +^^^^^^^^----------------------------------------------------------------------- +_k_: kill buffer and window _c_: comment line +_sh_: split horizontally _r_: regex replace +_sv_: split vertically _i_: indent region +^^ _a_: align regexp +" + ("q" nil "cancel" :color pink) + + ("k" kill-buffer-and-window) + ("sh" split-window-below) + ("sv" split-window-right) + ("c" comment-line) + ("r" vr/replace) + ("i" indent-region) + ("a" align-regexp)) + +(define-key prog-mode-map (kbd "C-c c") 'hydra-programming-actions/body) diff --git a/05prog-mode.el b/05prog-mode.el index e106e17..06596c2 100644 --- a/05prog-mode.el +++ b/05prog-mode.el @@ -31,13 +31,6 @@ ;; Key bindings (define-key prog-mode-map (kbd "C-d") 'dash-at-point) ;; Jump to dash definition -(define-key prog-mode-map (kbd "C-c c") 'comment-line) -(define-key prog-mode-map (kbd "C-c r") 'align-regexp) ;; Because C-c a is used - ;; by ag already. -(define-key prog-mode-map (kbd "C-c i") 'indent-region) -(define-key prog-mode-map (kbd "C-c v") 'vr/replace) ;; Visually replace all - ;; occurences of a specific - ;; regex ;; When possible, show code documentation (global-eldoc-mode 1)