问题
Is it possible to use align-regexp in wdired mode (Emacs)?
I want to align folder names that contain a space after the first word.
So:
folder1xxx xxxxx
folder2xx xxxxxx
folder3xxxx xxxxx
where x can be any alphanumeric character, should become something like this:
folder1xxx xxxxx
folder2xx xxxxxx
folder3xxxx xxxxx
As of now I only get a 'Text is read-only' message, because not the whole buffer is editable.
Thanks.
回答1:
A possibility is to select the filenames by putting the mark on the first "f" and point on the last "x", C-x r k
(kill-rectangle
), go to a temp buffer, C-x r y
(yank-rectangle
), do the align-regexp
there, and then kill/yank rectangle back to the wdired buffer.
More about rectangles here.
来源:https://stackoverflow.com/questions/2034814/is-it-possible-to-use-align-regexp-in-wdired-mode-emacs