Emacs dired5/20/2023 Probably the most useful part of WDired is the ability to edit filenames as though they were ordinary lines of text in a buffer. You can set it to one of three switches: nil, meaning it will not do anything out of the ordinary sometimes, meaning Emacs will move the point to the beginning of filename if the point is before it and t, meaning Emacs will always, unequivocally move the point to the beginning of the filename, mirroring the behavior in normal dired mode. If you are a keen user of Emacs macros you may want to configure wdired-use-dired-vertical-movement as it governs how where the point is put when you navigate up and down the dired list. Two useful “safety” variables are wdired-use-interactive-rename which if set to t will prompt for every filename change you have made you when you commit the changes with C-c C-c, and wdired-confirm-overwrite asks if you want to overwrite files if your altered filenames conflict with existing files. By default wdired-allow-to-redirect-links is set to t, meaning you can by default change the symlinks in Editable mode. If you want a free-form permission field without the system handholding, you can set it to advanced.Īnother feature of wdired is its ability to rewrite symlinks. If you set wdired-allow-to-change-permissions to t you can also edit the permission bits directly, although wdired will ensure you can only enter valid permission bits. There are, however, a couple of switches that let you change more than just the filename. Configuring WDiredīy default only the filename is editable, and for most that is good enough. To cancel the changes and revert to the original state you can type C-c ESC. If you are in editable dired mode the modeline for the dired buffer will say Editable.Īny change you make to the buffer will remain unchanged until you commit them by typing C-c C-c. Its mode of operation is simple: if any dired or dired-derived buffer is switched to writable from read-only with the globally-recognized binding C-x C-q, you can edit the dired buffer as though it were an ordinary buffer. This feature is another hidden gem of Emacs, only briefly mentioned in a sub node in the dired info manual. WDired – meaning writable dired – has been part of Emacs for a long time now. In the article I describe how you can work with files across multiple directories – for instance all the matches from a find call – in a dired buffer.īut wouldn’t it be great if you can combine the text editing capabilities of Emacs on the files themselves? Well, if you’re a long-time reader of this blog, you will recognize the rhetorical nature of the question and know instinctively that, yes, it is indeed possible. A while ago I wrote an article about Working with multiple files in dired.
0 Comments
Leave a Reply. |