Is it possible to use align-regexp in wdired mode

2019-08-10 02:23发布

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.

标签: emacs dired
1条回答
霸刀☆藐视天下
2楼-- · 2019-08-10 02:36

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.

查看更多
登录 后发表回答