align comments and macro pf multiple lines
| ;; align-regexp with space instead tab | |
| (defadvice align-regexp (around align-regexp-with-spaces activate) | |
| (let ((indent-tabs-mode nil)) | |
| ad-do-it)) | |
| (defalias 'ar #'align-regexp) | |
| (defadvice align (around align-with-spaces activate) | |
| (let ((indent-tabs-mode nil)) | |
| ad-do-it)) | |
| (defun align-c-comments (beginning end) | |
| "Align instances of // or /* */ within marked region." | |
| (interactive "*r") | |
| (let (indent-tabs-mode align-to-tab-stop) | |
| (align-regexp beginning end "\\(\\s-*\\)[//|/*]"))) | |
| (defun align-c-macros (beginning end) | |
| "Align macros within marked region" | |
| (interactive "*r") | |
| (progn | |
| (align beginning end) | |
| (untabify beginning end))) | |
| (require 'cc-mode) ;; c-mode-map | |
| (dolist (m (list c-mode-map c++-mode-map)) | |
| (bind-keys :map m | |
| :prefix-map align-prefix-map | |
| :prefix "C-c a" | |
| ("c" . align-c-comments) | |
| ("m" . align-c-macros))) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
("a" . align) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
("a" . align)
("r" . align-regexp)