 Welcome to video number 5, in a series of videos that I have entitled configuring Emacs. This series, what I did is I started with a vanilla GNU Emacs, and I've slowly worked on a configuration file, and I've kind of turned it into something akin to Doom Emacs. So we've already installed Evil Mode, and we've got a lot of extra functionality and plugins. I've added a ton of key bindings to this thing already, being that this will be the fifth video in the series. For those of you that have not been following along with the series, if you want to, what you can do, go back to the very first video and follow along, and if you want the configuration files as they existed in those previous videos, I have this over on my GitLab, this repo called configuring Emacs, and you can see I have these directories. One, two, three, four. So these are the first four videos. So for example, if you start with video one and go into the one directory here, you will find the configuration files from that very first video as they existed at the end of that video, and of course, after I finish today's video, there will be a fifth directory here on this repo, and it will contain the configuration files as they exist at the end of this video. I'm going to do something a little different for this particular video. I'm actually going to show you the finished configuration file rather than slowly adding things on camera, typing things out, copying, pasting things. All of that kind of takes a little bit of time, so I've already added some extra functionality to my configuration file, and I'm just going to talk you through what I added rather than having to type it out on camera, because these videos, they typically run kind of long, and I hope that saves a little time today. So I'm going to close the browser here, and let me show you my latest configuration. And you can see I've added true transparency to Emacs, and this is something that was not possible until just a couple of days ago, and the reason I'm just now adding true transparency to this is Emacs version 29 just came out. That's a major release of Emacs. It just hit the Arch Linux repos just a couple of days ago. For those of you on a rolling release distribution, you may already have Emacs 29 in your Linux distributions repos. If you're on a static release, then you're probably stuck on Emacs 28, and if that's the case, there's not much you can do other than wait for the next major release of your distribution and then get the latest Emacs 29, hopefully in the new version of your Linux distribution. Other than that, you could compile Emacs yourself. You could build it yourself. I'm not going to go over how to do that, because to be honest, that's kind of a hacky kind of solution, and it's tough because you have to compile Emacs with the proper flags depending on what desktop environment or window manager you happen to be using. Are you using a pure Wayland environment, for example, GNOME on Wayland, or are you using Strictly Exord, because that will depend on exactly how you compile Emacs. Again, that's a deep topic. I'm not going to go over that, but if you have Emacs 29 available for you, go ahead and take that update, and if I go into our config file here, I'm going to zoom way in. I've got our table of contents here. I'm actually going to zoom out just a little bit. I zoomed way in. I've added this new section called transparency, and this is pretty simple. You can see with Emacs version 29, true transparency has been added. So true transparency means that you get a background that is transparent, but the text and the bullet points and all of that is still completely opaque. Before what you would have to do is there were hacky ways to make Emacs transparent. You could actually make the entire Emacs window transparent. You could do that with your compositor, for example, Pycom on Linux. You could just make the entire Emacs window like 90% opaque or whatever it happens to be, but the problem with that is it also made the text transparent. And that was very bad as far as readability, but now that we have this true transparency, all you need to do is add this line of text here. Add the list, default frame, a list, alpha background, dot, and then 90. 90 is 90% opacity. Obviously, if I set that to 100, that would be fully opaque, meaning no transparency at all. If I set it to zero, then the background would be completely transparent, right? Some 50 would be 50% transparency. You see how that works. So you just add that line and then you need to reload your Emacs. In this configuration, remember, I have the key binding, space HRR, to do a hot reload of our configuration after we make changes. You can see it's loading Emacs config, LPACA, the package manager would install packages if it was needed, but I haven't added any new packages to the config, so LPACA is not doing anything. Now I could do space VP for buffer previous to get back to the config. So I really love the transparency. I think it's a nice look. It makes Emacs so much more beautiful. One thing I wanted to do, though, I wanted to go back to the themes. So this is the theme section. Now remember before we added this custom path to a theme file that I created, and I created my own theme called DTMax, and basically we had these two lines here. Add to list, custom theme, load path, and then the location to this themes directory where I stored dtmax.el, which is my own custom Emacs color scheme, right? It's basically what we're looking at here. It's kind of bluish, greenish, pinkish, purplish colors. Got kind of a bluish background, but I wanted more themes than just the one theme that I created, and there is a very, very nice collection of themes available from the DOOM Emacs guys. So actually what I'm going to do is I'm going to install the DOOM-Themes package. So all you need to do with this is, again, use a use package block. We've done this many times in past videos when you want to install an Emacs program, right? Use package, name a program. Use package, DOOM-Themes, and then I do colon config. So this is setting some configuration options. So what we're going to do, set queue, set queue, we're going to assign a variable, right? We're going to assign a value to a variable. The variables I'm going to assign a value to, DOOM-Themes-enabled-bold is set to true, and DOOM-Themes-enabled-italic is set to true. So what this is is some of these DOOM-Theme configuration files have options for bold text for certain fonts, and italic text for certain fonts, and I want those bold and italic fonts to be turned on. If I set T to nil for false, that would turn the bold fonts off. And the same thing would happen with the italic fonts. If I set enable-italic to nil, then the italics would be disabled. And after adding that use package block for DOOM-Themes, I would do a space HRR to reload my config. And then after that, I could actually do a meta-x, and I could do load-theme. If I hit Enter, I'm going to get this huge list of all the various DOOM-Themes. And there's a lot of them, and it's going to be all the standard themes you know and love, such as DOOM-1, which is my personal favorite, GrubBox, Solarized, all of that stuff. Dracula's in there. And of course, somewhere in here, it will also list DT-Max, right? Because it's also going to find my custom theme that's also in here. So the load-theme command will find all the DOOM-Themes. It's also going to find our local themes that we have sourced here from this line here, from the custom theme load path. Now, I actually set a keybinding because I might change themes often enough that I wanted a keybinding. So if I gg to go back to the top of this document, and I'm just going to click on General Keybindings here, what I did is if I go to the keybindings here, this section here, Space H for Help. Of course, you remember Space HV for Describe Variable, Space HF for Describe Function. These are helper kind of functions, Space HRR for Reloading or Emacs Config. I also did Space HT for Load-Theme. I just thought loading a theme, it kind of fit in this H category. I probably could have put it somewhere else, but it made sense. I had the keybinding available. I wasn't using Space HT for anything else. So Space HT, this is the Load-Theme command. That way, I don't have to do metaX and then type Load-Theme. And then I could do DOOM-1, for example. Let's do DOOM-1. That's the DOOM-1 color theme, right? Now, this is not saved permanently. As long as the Emacs server in this session that I'm currently in is running, so basically until I either kill the Emacs server or I reboot my computer, this theme will be enabled. But the next time the Emacs server starts, I'm gonna get my custom DTMacs theme back. And the reason is, because I have it hard-coded right here, Load-Theme DTMacs-T for True. So whatever theme you want, if you wanted the DOOM-1 theme, right, just make sure you load DOOM-1 in your config, right? And that way, every time you start Emacs, it knows to load that particular theme. Now for me, I'm gonna go back to the DTMacs theme and let's go ahead and do Space HT. And I'm gonna type DTMacs and let's switch back to that theme. So now we've got some really cool transparency. We've got a gigantic list of really nice color schemes. You really can't complain about the way this Emacs configuration has turned out as far as the looks, as far as the aesthetics. Let's talk about functionality though. There are some things that I wanted to do with DeerEd. So I'm gonna gg to get back to the top of this document and go to the table of contents and I have added this new section for DeerEd. And it looks like a lot of code, but it really is pretty simple. I'll tuck you through exactly the functionality that I've added here. So DeerEd is the built-in file manager inside Emacs and I'm gonna do these two different use package blocks. I'm gonna use package DeerEd dash open and use package peep dash DeerEd. Now DeerEd dash open I think is a part of DeerEd. Like you don't have to install it. And one reason I'm using this use package block here is because there were some configuration options that I wanted to add. And I figured I would actually add these using set queue inside a config section of a use package block. That's the only reason I needed this. DeerEd though is a third-party package that Elpaka will need to install. But let's go back to DeerEd dash open. So use package DeerEd dash open config and then set queue and what we're gonna do is we're going to assign some values to this variable here DeerEd dash open dash extensions. So when you're doing something in the DeerEd file manager, let me open the DeerEd file manager. So, you know, I could navigate around and eventually I'm gonna find some kind of file that I wanna click on for some reason. I don't know, let's find a file, you know this particular shell script. You know, what's it going to do with that shell script? Well, Emacs knows that's a text file. Emacs is just going to open that text file in Emacs. But what if I clicked on an image file such as a GIF, a JPEG, a PING. Well, you can see what I'm doing in my configuration. I'm telling DeerEd open those image formats in my image viewer, which I'm using SXIV. If you were doing a different image viewer, you would specify a different program to open these image formats. I also specified some video formats. Typically I make all of my videos, for example, for the YouTube channel and everything I typically render all those as MP4. Occasionally I'll use MKV for things and I wanted to make sure that if I was in my videos directory, for example, and I wanted to actually watch one of my videos that I'm recording, maybe this clip that I'm recording now, that if I'm in Emacs, if I'm in DeerEd and I click on that MP4, I want it to open that in MPV. So that's pretty self-explanatory, right? So that's what we're doing with this very first section here for DeerEd open. Now this next use package block here for PEEP DeerEd. PEEP DeerEd is a third-party package that allows you to preview the contents of what you're scrolling through in your file manager. Most file managers have a preview kind of feature. DeerEd has this ability with this PEEP DeerEd program. Now let's talk about the use package configuration here. So I have colon after. What this is, it's basically deferring, loading PEEP DeerEd until after DeerEd itself loads, right? There's no reason for DeerEd to load with all the configuration options until of course DeerEd loads first. Then colon hook, and so this is adding a hook. Now for those of you not used to use package, you could do this outside of a use package block. So this is typically how you would add a hook. You would use the add-hook command and then you would do quote, a single quote, and then the name of the hook space and then a single quote, and then the name of the mode or in this case, the name of the key map that I'm adding to the hook. But notice it's a little differently here in the colon hook section of use package. Everything is backwards, right? So instead of the hook being first, the hook is at the end and instead of the mode or in this case, the key map being last, it's first. So they're in reverse order here. So just something to be aware of. And as you can probably guess with evil normalize key maps, we wanna use some evil key bindings. colon config, of course, config section and evil define key. So evil mode will be loaded when we're viewing dear ed and when we're in the normal state and we're using the dear ed mode map because we're in a dear ed buffer. I want h on the keyboard to run the command dear ed up directory. I want l on the keyboard to do dear ed open file. And then I want j on the keyboard to run the command peep dear ed next file and then k on the keyboard peep dear ed previous file. Now you probably didn't understand exactly what all of I just said meant, but you can see HJKL are the key bindings. Basically, if you've ever used a terminal file manager, any kind of keyboard driven file manager that used them like key bindings, they all have a similar kind of feel. And I wanted that similar kind of function and feel in dear ed. I wanted to be able to navigate through dear ed entirely with HJKL. And I also wanted the ability to get a preview of the file, especially with the J and K keys as I'm moving up and down dear ed. Let me show you this in action. So let me go back to the dear ed buffer I had opened before. So what I'm gonna do is I'm gonna search for my wallpapers directory here in my home directory to do a search in Vim or with the evil key bindings in Emacs, right? You could do the slash, right? Slash and then search for a string for wallpapers, right? Let me hit enter. And now I'm in this wallpapers directory. And you can see J, as I go down, gives me a preview. K, as I go up, gives me a preview and I'm going up. But every time I go up or down, I get a preview. Now I have this turned on because I had already enabled this earlier. I have this key binding set up, space DP. Space DP turns on or turns off peep, dear ed. I just turned it off if I wanna turn it back on. Space DP would turn that back on. Now sometimes you will get some weird effects. Sometimes you'll think you're in peep, dear ed and you should be getting previews and you J and K up and down and it seems like it's not working. Sometimes it's like dear ed doesn't really know what state or what mode it's in. So typically what you wanna do is for some reason you know you've already enabled peep, dear ed, but you're not getting the previews. Escape a couple of times, two or three times to make sure dear ed knows you're in a normal state inside evil mode because if you're not in normal state in evil mode, you cannot get this preview because we specified that in the configuration file. Remember, evil defined key normal. And just to show you the key bindings as far as how we added that, remember general key bindings, I added a new section of D keys. So space D is going to be dear ed. So that's gonna give us a hint that anything that is space D on the keyboard right is a dear ed related key binding. If I just hit space without hitting another key, you can see D we get a hint is dear ed related key binding. So I hit D and then I get D again for open dear ed, J, dear ed, jump to current. So this would be if I'm in a file, for example, this file here, maybe I wanna open the directory that this file lives in. I wanna open that in dear ed. I could do space DJ and I'm in this directory. Space BP for buffer previous, of course would get me back to this file. And of course, space DP turns on peep dear ed. Peep dear ed is turned off by default because you probably don't want it on all the time. But if you did, you could do that, but I have a key binding here where you could quickly turn peep dear ed on and off as well. I've also added this interesting key binding here, space DN for neotree dash dear. What this does, it opens the current directory that this file is in inside neotree. Let's see that in action, space DN. Well, it's first gonna ask me what directory. So it's not necessarily the current directory, but you could specify a directory. If you are in the current directory that you wanna see in neotree, just hit enter. I do space TN for toggle neotree. I could turn neotree back off. Now, how did I do all of that? Well, I just added this section here for neotree right above the org mode section. So neotree, neotree is a file tree viewer. Those of you that are familiar with Vim, you've probably used nerdtree in Vim. Neotree very similar to nerdtree in Vim. Very similar functionality. So under the neotree section here, let me create some spacing. I've added a little description just to describe exactly what the neotree program is. And then I added a table, this table, just to give you what the key bindings are. Remember the key bindings I added in the general key binding space TN, toggle neotree. Space DN is open this directory in neotree. And then if I scroll down is the actual block of code that will actually install and configure neotree. Now this looks like a large block of code, but if you've been following along with these videos you're probably starting to figure this out, right? Use package neotree, it installs neotree if it's not already installed, right? And then colon config inside the use package statement. This is where you add your configuration options and then set queue assigns values to variables. What variables do we want to assign values to? Well, these five or six variables here, right? We're assigning some values to these. For example, neo show hidden files T for true, right? So neotree basically by default. It does not, I believe show hidden files but if you have that turned on I could click this with the mouse or I could navigate it with the HJKL keys. It doesn't matter, but you can see you can actually see my hidden directories, my hidden files there. So let me do a space TN to toggle neotree back off. The variable neowindow width set to 55. 55 is the width of that particular window. You could adjust that of course. And then this block here, it's quite lengthy. It was just a copy and paste job that I found somewhere on the internet several years back for truncating the file names in neotree. That's all this does is some file and directory names are very lengthy and you want neotree to just cut them off after a certain point. So that is neotree. It looks like I had a comment there from something from the past that is no longer there. So now we've started to get our Emax configuration really looking good now, right? Because now we've got the really cool dashboard. We've got all of our key bindings. We have our configuration file looking pretty good here. Obviously now we can toggle on neotree when we want it, right? And toggle it back off. And I can do space TV for toggle vterm to get my vterm terminal emulator here inside a horizontal split inside Emax. If I need a quick terminal emulator, let me hit I on the keyboard to get into insert mode. So I can actually type LS, for example, here in the terminal. Let me escape to get back into normal mode. That way I can do a space vk to kill the buffer. If I just want to kill vterm, of course I could have toggled it too. So space TV toggles vterm, space TV to toggle vterm back off. Now I've got a deer id working the way I want. Let me do a space DD for deer id. Let's open up my home directory. Once again, I'll go to the wallpapers directory because I have those images there. If I can type correctly, can't spell today. And peep deer id is still turned on. So we still get the fancy image previews. If I do H on the keyboard to go back into this directory, obviously we will not get any image previews in this directory. Unless I happen to have an image file in my home directory, I do not. Well let me escape and quit out of Emacs. So that was video number five in configuring Emacs. Mainly the big thing I wanted to cover today, I know this was a little quicker video, was the transparency. I wanted to cover that because it was a big deal being that Emacs 29 was just released and it's a big release. Those of you that are interested in Emacs 29 as far as the new features that were added, I strongly recommend going and reading the release notes for Emacs 29. As always, for those of you wanting the configuration files for this particular configuring Emacs episode, I'm gonna push all of that to my GitLab. Look for the configuring Emacs repo over on my GitLab at gitlab.com slash dwt1. Now before I go, I need to thank a few special people. I need to thank the producers of this episode. Gabe James Matt, Paul Royal, Wes Armored Dragon, Commander Ingrid George, Lee Methos, Nate Erion, Paul Peace, Archon Vador, Realities for the Last Red Prophet, Roland, Soul-Ashtring Tools, Devler, Ward Jintu, Anabutu, and Willie. These guys, they're my house-tiered patrons over on Patreon. Without these guys, this configuring Emacs episode 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'm sponsored by you guys, the community. If you like my work and wanna see more videos about free and open source software like Emacs, subscribe to DistroTube over on Patreon. All right, guys, peace. Eventually, we have to add some games to Emacs.