[Emacs] Finish align hydra
This commit is contained in:
parent
64c0e3a930
commit
728ac257ab
@ -2126,7 +2126,6 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
|
|||||||
** align
|
** align
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package align
|
(use-package align
|
||||||
:disabled t
|
|
||||||
:after hydra
|
:after hydra
|
||||||
:bind ("C-c C-a" . imalison:align-regexp-hydra/body)
|
:bind ("C-c C-a" . imalison:align-regexp-hydra/body)
|
||||||
:config
|
:config
|
||||||
@ -2134,10 +2133,23 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
|
|||||||
(defun imalison:complex-align-regexp ()
|
(defun imalison:complex-align-regexp ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((current-prefix-arg t))
|
(let ((current-prefix-arg t))
|
||||||
(call-interactively )))
|
(call-interactively 'align-regexp)))
|
||||||
(defhydra imalison:align-regexp-hydra
|
(defun imalison:align-whitespace ()
|
||||||
|
(interactive)
|
||||||
|
(align-regexp
|
||||||
|
(region-beginning) (region-end)
|
||||||
|
"\\(\\s-+\\)") 0 1 t)
|
||||||
|
(defun imalison:align-to-character (character)
|
||||||
|
(interactive
|
||||||
|
(list (read-string "Character to align to " "=")))
|
||||||
|
(align-regexp
|
||||||
|
(region-beginning) (region-end)
|
||||||
|
(format "\\(\\s-*\\)%s" character) 1 1 nil))
|
||||||
|
(defhydra imalison:align-regexp-hydra ()
|
||||||
"align-regexp"
|
"align-regexp"
|
||||||
("r" . align-regexp))))
|
("r" imalison:complex-align-regexp)
|
||||||
|
("SPC" imalison:align-whitespace)
|
||||||
|
("c" imalison:align-to-character))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* flycheck
|
* flycheck
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
Loading…
Reference in New Issue
Block a user