 My text editor of choice these days is DOOM Emacs and DOOM Emacs is great because it's not just a text editor, it is a full suite of applications, it's this environment that has all of these cool tools, not just a text editor, but many things, including a really great file manager. The file manager within Emacs is called DeerEd and today I wanted to highlight some of what you can do with DeerEd inside DOOM Emacs. So let me switch over to my desktop and let me go ahead and launch DOOM Emacs here and I'm going to go ahead and open my DOOM Emacs config file. So this is a config.org. So it's written in org, which is great because I love to leave a lot of comments. You see, I have these tables specifying various keybindings. This is the DeerEd section of my config file. If I go to the top of my config.org, you can see my config files rather lengthy. But the great thing about having a org document as a config file is you can organize it very neatly. So let's go to the DeerEd section. I'm going to show you some of the settings I use for DeerEd, some of the keybindings. And let me also go ahead and open a DeerEd window. So this is my home directory in DeerEd. And essentially you can think of this as the LS command with a few flags and options like in a terminal. It's basically the same thing. DeerEd is essentially that LS listing in a long format. Now the very first thing you need to know about DeerEd, if you're brand new to DoomyMax, you need to know that DoomyMax uses the evil keybindings. So navigation is done with the standard HJKL VIM navigation keys. The other thing you need to know of course is how to get into DeerEd. There's a couple of different ways you could launch DeerEd. First is do metaX and then type the word DeerEd. If I hit enter, it's going to ask what directory do we want to launch DeerEd in and by default it's going to default to the home directory, which is where we're already at here. Another way you can get into DeerEd is if you're working in a file, you could do space period for the find file command and you could navigate to a directory. For example, maybe I want to go into my app images directory here. If I hit enter, we'll go into that directory inside a DeerEd buffer. Now that's not really what I wanted to go to. So let's go back to the home directory. So space BP for buffer previous gets us to that previous buffer, which was the home directory here. Now for the most part, I'm using DeerEd as it comes out of the box in Doomy Max. I haven't made that many major modifications. The one major modification that you'll notice in my config up front, when I say HJKL is the navigation, by default, J and K work in DeerEd inside Doomy Max. So J would be down, K would be up. But typically to go into a sub directory, for example, maybe I want to go into this dot DWM directory instead of L, which is what you would expect. L actually was not set to that binding, but I thought you would have to hit enter to go into that directory. And then H wouldn't actually go back. I believe it was the carrot symbol that goes up a directory. Now those are kind of weird. I didn't want to fool with return and carrot. I just wanted to have my four fingers on HJKL, where if I wanted to go in a directory, for example, that dot DWM directory, I just hit L. If I want to go back, I just hit HJK, right? If I go into config here, put the cursor point on dot config, I could do L to go into that directory, and then I could go around into this directory, hit L to get into that directory. Or if I want to go back up a couple of directories to get back into home, all I have to do is hit H to go up, H to go up, and I'm back in home. Of course, standard Vimkey bindings will typically work here. So GG would go to the first line in the document, right? In this case, it takes me to the top of this buffer. Capital G would take me to the end of the buffer. If I do five capital G, it would take me to the fifth line of the buffer, which in that case was dot bin, because it does count the first two lines here that are not really directory information. The first line is just the path, and then the second line is total used in the directory, the size of the directory. So to get this HJKL working as you would expect, the way it works in a lot of especially terminal based file managers that use the VIM bindings. What I did is I have this section here of evil key bindings. Remember that it was the carrot symbol to go up a directory, but now I've changed that to where H on the keyboard is up a directory. And L is dear ed open file, meaning wherever the cursor point is, go into that file or that directory. So that is now why HJKL works as expected. I mentioned that dear ed by default has this basically long format of the LS command as the output. You can change that a little bit for me. I actually quite like this. My typical LS command is basically LS-LAH for long format, all the files including the hidden files, and H for human readable numbers. That's what it's defaulting to here. So that's typically what I use, but you could edit that a little bit if you wanted to. The other thing is you can quickly go from this long format listing to a short format listing using this key binding here, the opening parentheses. If I hit opening parentheses, you can see all the information goes away except for the directory or file name, as well as the icon in front of it, because I have icons turned on here inside Doomy Max just to make things a little prettier. If I wanted the long format back, I would just hit that opening parentheses again, and it toggles the long listing back on. Now there is a closing parentheses binding as well, and that is for a get information, I believe. If I do the closing parentheses, if there's anything that is like a get repository here, or it doesn't look like there was in this, but that was deer-ed get info mode, what that toggles a specific get mode inside deer-ed on and off. I've never found that particularly useful, and honestly, I never really toggle on the long format either, but I know some people may find that useful. Now I mentioned you could edit the output of this. There is a variable. There is deer-ed listing switches that actually list the flags and options for the LS command that deer-ed shows by default. So if I do space HV inside Doomy Max, space HV is a help command. All the help commands typically start with space H and then another character. Space HV is described variable, and the variable I want to describe is deer-ed listing switches, and it's the second one here in the list, and I'm not going to hit enter on it because it already tells me exactly what I wanted, which is what is that variable set to? It's set to dash A-H-L. I remember I typically use the LS command in my terminals with dash L-A-H-L. It doesn't matter the order of the switches. They're using A-H-L. They're going in alphabetical order. They are also using dash V and dash dash group dash directories dash first as a flag as well. And what this does, it makes sure that the directories are actually listed first in the output because by default, if you didn't have that set up that way, it would actually list everything alphabetically and all the files and directories would be jumbled up. They wouldn't be in a specific order. I think most people are going to find that confusing, so most people would actually set it with the group directories first flag on, and that's what Doomy Max does out of the box. So you really don't have to play with that unless for some reason you don't want that functionality. So let's talk about file previewing. Let me make this full screen, this deer-ed buffer here, and let me go down toward the bottom. And let's say I want a preview of one of these files. Now, what I could do is I could do meta return, so that's the alt key return, so alt return, and what it will do, it will give me a preview in this vertical split. And I say it's a preview. I could actually edit the file, but by default what that alt return does is it opens that in the split, but it keeps the focus in the deer-ed buffer, so I could go down to a different file and do alt return and get a new preview, or I could keep going. Let me go up and maybe alt return on this. So you can see that's very cool because you just keep previewing, essentially, these files in this vertical split, and that's kind of a nice feature. Now, if I want to get into that vertical split to actually edit the file, I could do control ww, which is a standard VM command, right, to switch from one frame to the next, and now I'm over here and I could do whatever control ww to get back into the deer-ed buffer, right? And for DOOM EMAC specific bindings, instead of control w followed by w, you could do space ww, so space ww works the exact same way space ww gets me back. If I wanted to close that split over there, I could do space ww and then space wc to close, and now that split, that preview window goes away. And of course, sometimes you don't want to actually get a preview. Sometimes you're on the file you want to work with and you just want to start editing it. And for that, instead of doing the meta return, just do a simple return and it'll open that file in the current frame you're working in. Now remember, in EMACs, buffers don't just magically get killed and go away, even though we're not actually viewing it, the deer-ed buffer is still open. We can go back to it exactly where we left it. If I do space bp for buffer previous, I just go back to the deer-ed buffer that I was in before. Now say you're working on a config file. For example, I'm in my config.org here. Maybe I want to open up deer-ed in the directory that I'm currently working in as far as this file. Well, there is a deer-ed command called deer-ed-jump, which will just jump to our working directory here. I have this key binding to space dj for directory jump and it goes immediately into my .config slash doom directory because that's where that file I was working in actually lives the config.org. And you don't necessarily have to use the deer-ed-jump command to do that. You could also simply do a space period for the find file command because by default, it defaults to your current directory's location. And if you just hit enter, it works the exact same way. Let me hit enter and get back into my config file. Actually, let me go ahead and switch back over to that deer-ed buffer. So let's talk about how deer-ed works as far as marking things for renaming and moving and copying and deletion and things like that. So actually what I'm going to do, I'm going to search for a specific directory on my system because just like in Vim, you do a slash to search. I'm going to search for a directory I have called .screenshots. I'm going to hit enter and go in this directory. Let me zoom in a little bit here. And the reason I picked this directory to work on is because there's nothing really important in this directory. If I accidentally move something someplace or delete something, it's not a big deal. I don't want to work on any important config files like my do-me-max config or X-mode-add configs or anything like that. This is just a directory of a lot of peeing images. So let's start by marking files. Typically what you want to do before doing any action, you're going to do M on the keyboard to mark a file for whatever action you want to perform on it. So let me highlight a file here. I'm going to go down to this file here, .files04.ping. I'm going to hit M on the keyboard. And now I have marked it. Marked it for what? Well, we'll get to that later, but right now it is a marked file. You can see an asterisk at the beginning of that line. It's letting me know that that file is a marked file. I can go down here to .files06.ping, hit M on the keyboard, and I've marked that as well. And maybe go down one more to .files09.ping and M on the keyboard for mark. And now that they're marked, I can run any command as far as moving, deletion, compressing the files, uncompressing the files. You know, whatever it is I'm trying to do to these particular groups of files that I've marked. I could now do that. Now I've marked them, but sometimes you mark a file and then you decide, you know what, I didn't mean to mark that file, or I've changed my mind on what I was wanting to do. How do you unmark a file? Well, you to unmark. So just highlight the file that you made a mistake on and you unmarks it. Or let me do M to mark that again. What I could do is simply do a shift U, capital U, right? And that unmarks all the files. Now I would have to start over again, marking the specific files I wanted to work with. Another really cool thing you could do is you could mark all the files you don't actually want to select. So maybe I wanted every file marked at CIP369. Well, the easiest way to do this would be to actually mark .files369. And then after that hit T on the keyboard for toggle the mark, which means basically do the inverse. So everything I didn't have marked is now marked. Everything I had marked is now unmarked. So that is a really cool little keybinding. T again would invert that back to the way I had it before. Shift U unmarks everything. Now when you're working with a lot of files, sometimes you just want to mark files based on a particular search pattern or a regular expression, things like that. One neat little keybinding that you'll use all the time for marking files is the asterisk symbol followed by the period. And what this does is it marks files based on an extension. So you can think of asterisk and then the dot as being the dot as part of the extension. So think of .png, for example, is what I'm searching for. And if I do that, it marks all files that had the extension .png. Now let me do shift U, capital U again, to unmark all files. Again, asterisk and then the period for the extension. And if I was searching for HTML as an extension for file names, I'd hit enter. And of course, in this case, there's nothing in this directory that has .html as an extension. It's all .png files. Now let me go back up a directory. So I'm just going to hit H to go back into the home directory. And I'm going to go into .stump.d. This directory here, it doesn't have very many files in it. Let me also zoom in in this buffer as well. Another cool key binding you can use is the percent sign M. Percent sign M means mark files based on a regular expression. For example, I can do a regular expression for, I could just do anything. I could search for the pattern log, for example, because maybe the file I'm really searching for is anything that ends in .log.log. But if I search for that pattern, of course, I get two files because I get this that matched the pattern and then stump wm.log.1 that also matched the pattern. So this is where regular expressions would come in handy because now I could do percent sign M for mark using regular expressions. Except this time, let me actually do a backslash period because I want to escape a period because I want that as part of the expression. And I'm also going to add a dollar sign here, meaning the end of the line. So search for .log at the end of the line. So that should eliminate the file that has .log.1. If I search for that, it says zero files marked because I already had the files marked from the previous time I ran that. So let me actually do a capital U to undo and then percent M for mark files with regular expression. Let's try that again. So backslash.log, dollar sign, and now you see it actually marked the one file this time because of the way I used it with that regular expression and it no longer marks the second file, the .log.1 file. Now what exactly are we going to do with the file or the multiple files that we might have marked? In this case, I've got one file marked. Well, I could do capital C for copy. So shift C. And where's it going to copy this to? You could specify a location by default. It's going to default to the current directory, which is fine. And then I could just give it a name, stumpwm.log.2 and again, it just copied that to this new location, which essentially is a new file with a new name is how that worked. Now let me shift U, capital U to undo everything. Now this file here that I just copied, this was just for test purposes. So I could M to mark and then I could capital D for delete. And it's going to ask me, do I really want to delete this file? You can see, do I want to trash stumpwm.log.2? Yes or no? Why for yes? And it asked me to trash it is because I've got my config set up to where it actually sends my deleted files to my trash bin rather than just permanently deleting them. So this is a safety mechanism. You want your file managers typically to send deleted files to a trash bin because sometimes you do make mistakes. And how I accomplish that trash bin, by the way, is in my DRID section of my config, somewhere in here. Let me scroll down. Have this section here. Making deleted files go to the trash bin. So I run set Q and this variable here, delete by moving to trash and T for true. By default, unless you have that set to true, it's probably going to be set to nil. Meaning anything you delete in DRID is permanently deleted. So just make sure that variable is set to true. And then you need to specify a trash dash directory, which on your Linux systems typically is going to be home directory slash local slash share slash trash with a capital T. And in my case, I'm sending it to slash files within slash trash. Now that's kind of a lengthy path to navigate to if you've trashed something and then later want to undelete it, right, to get it out of the trash. Sometimes you don't want to have to travel four subdirectories into your home directory. So for convenience, you see I made a note here, you may want to create a sim link to that trash directory in your home directory just for convenience. So if I go back into my home directory here, let me zoom in a little bit here, you will actually see if I scroll down here, let me just search for it because organizing it by uppercase and lowercase, you see there is trash and you can see trash is a sim link. It's actually really dot local slash share slash trash. So if I hit enter, it'll actually go into dot local slash share slash trash. And then if I go into slash files, these are all the files that are currently sitting in my trash bin that I could, if I made a mistake, I could go in here and get them out if I needed to, but everything in there is actually deserving of being in the trash at the moment. So let me do a search and back into the dot stump wd directory. Let me go up here and let's actually mark that file one more time for something. And let me do a copy. So I'm going to do capital C again. I'm going to do stumpwm.log.2 to get that copy and then capital U to unmark it. And then I'm just going to do a m to mark that new copied file. And this time I'm going to do capital R, so shift R. And this is for renaming. And what I could do is I could do stumpwm.log.3 and hit enter and you can see it renamed stumpwm.log.2 to .log.3. So very similar copy and rename except copy. You can make a copy and still keep the original rename actually takes the original and renames it. And of course what I've done with copy, rename, delete. You could do this on multiple files if I had multiple files marked. Same thing with rename. I could move multiple files to a directory. As a matter of fact, why don't we actually try this? So I've got this .log.3 file marked right now. Let's go ahead and capital R for rename and this time I'm going to rename it to a new subdirectory. I'll call the subdirectory test slash and then stumpwm.log.37. And it's going to ask do you really want to create this new subdirectory that was part of that path just in case you made a mistake, you know, for safety reasons. In this case, I actually do want that directory. And now we have this new directory test. If I go into test, we have that renamed file, right? Stumpwm.log.37. If I go back up the stumpwm.log.3 that was here is gone because a rename is essentially a move, right? So that can be kind of confusing for those of you used to using file management typically in the terminal, which is where I spend most of my time. A rename is actually move, right? MV, but in Emacs and Deer-Ed, they call it actually rename. So just know rename, move, they're synonymous for what they do. One last thing I want to show you is I'm going to mark the test directory and, of course, that directory has that one file in it. And now I'm going to do capital Z. Think of capital Z for compression. Capital Z is going to ask me, do I really want to compress this test directory? I'm going to hit Y for yes. So you can see I've got the original test directory. Now I have test.targz. Now, I actually don't want any of these directories. So let's go ahead and mark both the test and the test targz file and do capital D for delete. It's going to ask for confirmation Y for yes. And it's going to ask, do you want to recursively delete the test directory because there's stuff in it? Also, yes, so. And now this directory is back to looking the way it was before I started the video. Now let me go back into the home directory and I'm going to go into my Xmonad directory. So let me go into home slash dot config. So that is an invalid search. Let me just do space period to do find file because it's got tab complete inside find file and it's just an easier way. It still gets me to that dear ed buffer, right? So here is my Xmonad directory. Now, imagine this directory, I've got a bunch of files here, but maybe I don't want to actually see all the files and that could be the case if you're working in a large directory that has a bunch of stuff, but maybe you only need a small subset of files that you're working with today. Well, you can actually do a kill line inside dear ed. There's a functionality called killing lines and killing lines means making lines go away, hiding them essentially. You don't actually delete anything. It's not going to delete files or directories or anything like that. It just hides those lines. It kills those lines. So for example, maybe I only want to work with my Xmonad config file, which is really the readme.org and maybe the Xmonad.hs and everything else I want to get rid of. Well, I could mark all of these. So m, right? Go ahead and mark all of these. And then if I do meta X, there is a command called dear ed do kill lines. If I hit enter, those lines go away. All those files, all those directories that I didn't want to see, they're no longer here. Now they're not deleted or anything. Again, it's just hiding those lines. If I want to get those lines back, I could just revert this buffer, refresh this buffer. And how you do this, and this is not a dear ed specific command. This is a general evil mode command. Anytime you want to refresh a buffer inside Doomy Max using the evil bindings, gr for revert buffer. So gr goes back to the buffer, refreshes it essentially. And now I get all of the files and directories displayed again. As a matter of fact, I think that dear ed do kill lines command is so useful. Instead of having to do meta X and executing the command from the prompt here, I should actually bind that to a key binding because it is actually not set to a key binding by default inside Doomy Max. So let me go to my config. And looking at my config, there are some standard bindings that were already here. These were not things I added. These are default Doomy Max bindings. But I don't necessarily use this one. For example, the key binding, the dash, the minus symbol for dear ed up directory, going up a directory. Well, I already use H for that, right? H, J, K, L. I'm never going to use the minus sign for going up a directory. I've never used that. So why don't I change that? Because I think that makes sense for killing lines, right? Minus making lines go away. It kind of makes sense for a key binding. So I'm going to change that to dear ed dash do dash kill dash lines. And then I'm going to write that. And then inside Doomy Max, space H R R to restart or reload your Doomy Max config that you've made changes to. And it says config successfully reloaded. So let me go back into this dear ed buffer here. And now if I do a search for dear ed do kill lines, you can see now there's a binding associated with it, the minus symbol. So let's see if that works. So I'm going to mark these first three directories. And now let's see if the minus symbol actually kills the lines. So minus and they go away. And again, if I wanted those lines back, G R to revert buffer. Very cool. And let me hit H to go up into the home directory again. And this time I'm going to go into my wallpapers directory here. So let me hit Enter on that. And if I wanted to get a preview of images because a lot of people want image previews I could do just like I did on the files earlier with meta return. So alt return, right? Alt return. I'm going to get that split with that preview, right? And I could go down to some other image and do alt return and get the preview for that. But sometimes you want the actual preview to actually happen just as you change through the images because a lot of people just want instant image previews. And I actually do have a binding for this. First of all, let me do space ww to get into the split over there then space wc to close that split. And let me show you in my config. This section right here, I have a program installed called peep-deer-ed. Essentially peep. You can think of it as a file preview. And I have these binded to leader key space, right? Space dp to launch peep-deer-ed and space dv for leader-ed view file. And then once this is actually opened, just navigating with j and k through the directory structure will actually just give you the image previews. Let me show you this. So if I do space dp, you can see it opens that preview, that split. But now just navigating with j and k up and down the directory structure here. So if I go down to the next image with j, right? I'm always going to get that preview immediately. I don't have to worry about alt return. And if I wanted to turn that off, space dp would kill that because you wouldn't want that on all the time, especially if you're constantly navigating through a lot of images because it's going to open up a million buffers in emacs. And it's going to be very cluttered when you go and look at your buffer list. As a matter of fact, let me show you space bi for iBuffer inside doom emacs. And I'm going to have a lot of stuff that we have previewed earlier. I've got several of those scripts that early in the video I previewed are here. I've got one image preview it looks like here as well. And of course from iBuffer, you know, I could delete some of these buffers, kill some of these buffers. But for now, I'm just going to let them go. iBuffer was really not the focal point of today's video. Today was all about Dear Ed, the file manager inside emacs. And I hope this video, the short little walkthrough of Dear Ed inside doom emacs, helps some of you guys. I know some of you guys just now trying out doom emacs for the first time. You're kind of wondering how this thing works, right? It's a different kind of experience where you have pretty much all of your applications that you work with. Your text editor and your file manager and your terminal emulator or your email client and your Git client and all of this all in one program. And sometimes it's kind of hard to conceptualize how all of that stuff fits together. So I hope today's video helps some of you guys out. Before I go, I need to thank a few special people. I need to thank the producers of this episode. Dustin Gabe James, Matt Maxim, Mimit, Michael Mitchell, Paul West. Why you bald homie? Alex Allen, Armoredragon, Chuck Commander, Ringer, Yida Yokai, Dylan Greg, Greg Marsh, Drummer, Erjan Alexander, Paul Peace, Archon Fodor, Polytech Realities for the less-read profit Steven Thules, Devler, and Willie. These guys, they're my highest-tiered patrons over on Patreon without these guys. This quick look at the Dear Ed file manager inside emacs would not have been possible. The show is also brought to you by each and every one of these fine ladies and gentlemen. All these names you're seeing on the screen right now, these are all my supporters over on Patreon. I don't have any corporate sponsors. I depend on you guys. If you like my work and want to support me, subscribe to DistroTube over on Patreon. All right, guys. Peace.