4 ms·
Fun dired trick: dired is essentially a styled, read-only output of `ls`, but you can use standard Emacs combination for switching buffer from/to read-only mode
by TeMPOraL 7y ago
Fun dired trick: dired is essentially a styled, read-only output of `ls`, but you can use standard Emacs combination for switching buffer from/to read-only mode, C-x C-q. Once you've done that, you can literally edit the output of ls (or most of it) to make it reflect the desired state, and then press C-c C-c to commit, and dired will apply the changes.
I use it almost daily, it's particularly useful for batch renaming files - and since you're working with an editable text buffer, you can use whatever tools you like - like copy-paste, regex search&replace, multiple cursors, etc.
- sdegutis 7y agoIt's also smart enough to know to use a temporary intermediate filename when you rename multiple files to use each other's names, e.g. swapping a.txt and b.txt.