Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding a hot key for equal sign alignment.

  • Loading branch information...
commit bbe440712da01bbb848f364baa9f3b49e16e88fc 1 parent 24d1fcc
@JEG2 authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 emacs.d/functions.el
View
8 emacs.d/functions.el
@@ -558,3 +558,11 @@
(jeg2s-trim-backwards)
(jeg2s-trim-forwards))
(global-set-key (kbd "C-c w w") 'jeg2s-trim-backwards-and-forwards)
+
+(defun jeg2s-align ()
+ "Aligns equal signs in the region or buffer."
+ (interactive)
+ (let ((begin (if (region-active-p) (region-beginning) (point-min)))
+ (end (if (region-active-p) (region-end) (point-max))))
+ (align-regexp begin end "\\(\\s-*\\)=" 1 1 nil)))
+(global-set-key (kbd "C-c =") 'jeg2s-align)
Please sign in to comment.
Something went wrong with that request. Please try again.