Add a keybinding for aligning lines to "{"

This commit is contained in:
2013-02-18 00:55:02 +00:00
parent 271acb6a15
commit 2d6e354a6a
2 changed files with 7 additions and 0 deletions

View File

@@ -60,6 +60,11 @@ there's a region, all lines that region covers will be duplicated."
(interactive "r")
(align-regexp begin end "\\(\\s-*\\)=" 1 1 ))
(defun align-region-to-opening-brace (begin end)
"Align region to equal signs"
(interactive "r")
(align-regexp begin end "\\(\\s-*\\){" 1 1 ))
;;
;; Yank Pop Forwards

View File

@@ -46,6 +46,8 @@
;; Align to equal signs (via helpers.el).
(global-set-key (kbd "C-x a =") 'align-region-to-equals)
(global-set-key (kbd "M-]") 'align-region-to-equals)
(global-set-key (kbd "C-x a {") 'align-region-to-opening-brace)
(global-set-key (kbd "M-[") 'align-region-to-opening-brace)
;; align-regexp
(global-set-key (kbd "C-c \\") 'align-regexp)