credit: wikipedia De
Table of Contents
1 Dired the filemanager hidden in emacs.
So when you use emacs it makes sense to use emacs for as much as possible since it is mostly build-in, or gets to run rather cheaply since emacs uses so many resources, or well it used to use a large amount of the resources on the machines, that using software made to work inside emacs made a lot of sense since this software will not have the additional cost.
So I want to write a serious of posts about software that can run inside emacs, this post is about a rather essential item. The file manager, emacs has one builtin namely dired. Accessing dired is very easy you only need to type C-x d, that is Control+x then a lonely d. This brings up a prompt in the message area, now you can type in some folder on your machine. And this folder will open up in dired mode, this is a very convinient way to move around different folders if you are looking for something in a specific folder (or you know use find so you know where it is).
Since dired can be a bit stale in its initial state let's configure it to be more useful.
Some useful commands
"C-u s" lets you change the formatting (ls command)
1.1 Some useful actions
C - copy R - rename D - Delete Z - compress/uncompress S - symlink
- - create directory
! - shell command on file M - mark files f - open file v - view file
1.1.1 Notes
- difference v and f.
pushing 'v' on a file will open the file in a view buffer, this is very useful if you want to quickly check the file, but not edit it since after pressing 'v' you can quickly quit by pressing 'q'. Whereas using 'f' will open the file as any other exactly as if you pressed 'C-x C-f'.
- Marking
The way you mark files are usually with 'm', but if you want to mark some other files there are lots of clever ways to do this, depending what you want to mark. #,~,. If you want to delete a lot of files matching a regular expression you can use
% d <re>
where <re>
is the regular expression you want to use, Then delete with x.
1.2 Finding files in your filesystem.
M-x `find-name-dired` That is Alt-x and then type in find-name-dired <ENTER> this will run the command called find-name-dired. It is also possible to bind it to a keyboard command, if you find yourself using it a lot.
1.3 Expanding dired to include more functionality
As with all things inside emacs it is fairly easy to go and expand the functionality, this has lead to several extensions for dired, that can be freely downloaded and added in your emacs config, there are many options to choose from, so I have not used any in particular in this article, though it seems most people have gone with the "dired+", but this is not the only option that is available, there is also "diredc" and possibly a lot more options.
1.4 Resources
Might be a few mistakes and bad formatting, but if you found this useful do consider leaving a
vote for me.
And I will write more about emacs and how it can be made to do a lot of things, so if you want to see these posts subscribe as well.
Thanks.