My text editor of choice these days is Doom Emacs. What is Doom Emacs? Well, it's a distribution of GNU Emacs, but it includes some pre-configuration out of the box and some of the configuration that's included with Doom Emacs includes the evil key bindings, which are the Vim key bindings, which are fantastic and One of the videos I've been needing to make it's been brought to my attention I've made some Doom Emacs content in the past But I've never really made a Doom Emacs video for people that have never used Vim Because I've always just assumed anybody that would be interested in Doom Emacs has probably used either Vim or Emacs before in The past and that's not necessarily the case I'm getting a lot of new subscribers to my channel recently that want to check out Doom Emacs, but they've never used Vim or Emacs So some of my videos in the past even though they're kind of basic videos. I do Expect people to have a certain knowledge level going in for example I expect you to already went through the Vim tutor and know the Vim key bindings before you ever get into Doom Emacs Well, I shouldn't do that. So today I'm gonna backtrack a little bit. We're gonna do a Doom Emacs for noobs So if I start from the very beginning Let me switch over to my desktop and open up a terminal and you guys should open up a terminal Because we're gonna install some software because before we can actually install and start using Doom Emacs We need to make sure that some dependencies are installed on our system now. I'm on an arch based system So I'm going to use Pac-Man because that's the package manager in Arch Linux So pseudo Pac-Man dash capital S to install some software. We need to install the following dependencies We need to install Emacs, of course. We also want yet. We also need rip grip We also need FD, which is a find alternative and you also need the find command itself Installed on the system, but almost certainly you already have find already installed if you're running a GNU slash Linux operating system Because it's part of the GNU core utils. So install these dependencies here Emacs get rip grip and FD and Hit enter and put your password in now I already have these installed on my system. So I will decline doing that install But once you have those installed now when to do actually install Doom Emacs to install Doom Emacs You need to run get clone. So we're gonna get clone a GitHub repository in this case. So do get clone dash dash depth One and then the URL to the Doom Emacs repository, which is at HTTPS colon slash slash github.com slash H listener slash Doom dash Emacs and Then do a space and then the tilde character which signifies your home directory Slash dot Emacs dot D because we're gonna clone this into Dot Emacs dot D. I hope that makes sense I will of course put this command in the show description that way all you guys have to do is just copy and paste But run that get clone. All right, and then once it runs that get clone it put everything in dot Emacs dot D We need to run the following command. We need to run Emacs dot D slash Ben slash Doom slash and this is a directory where all the Doom binaries live and then the Doom command we want to run here is Install and then it asked do we want to generate this? Environment of variable fall. Yes or no, it really doesn't matter for most of us if you're on Mac OS I think it matters in a big way. I don't think do me max will actually work unless you create that fall on Linux I haven't noticed that that matters at all. Sometimes I answer. Yes, sometimes I answer no I don't know how that works on Windows. I've never actually run Emacs on any operating system other than Linux I don't actually use Windows or Mac. I haven't used Windows and probably 12 years or so and I haven't run a Mac since the 90s at some point during the do me max installation It's going to ask. Do you want to download and install all the icon fonts? You're probably gonna want to answer yes to that and you see it finished in a hundred and thirty-eight seconds So it took just over two minutes to install do me max I think all I need to do now is simply launch Emacs So how I'm going to launch Emacs here is in my command prompt here my run prompt here you guys If you have a menu system you can look for Emacs in your menu system If you have Rothy or D menu open that if you want to launch it from the terminal You can launch Emacs from the terminal regardless how you do it the command to run Emacs here or doom Emacs in this case It's simply to run the command Emacs and this is how doom Emacs looks out of the box This is the stock configuration now. Let's talk about some commands to run space fr space fr That searches for recent files. So anything you've ever opened in Emacs in the past will be available for you if you do space fr That's a command I often use when I first launch doom Emacs because it typically I'm working on something I've already opened before in Emacs anyway now in this case because this is a brand new installation space fr Does nothing, but you could do this to get into dear Ed the directory editor the file manager built into Emacs do space period And then you've get this prompt here. It's basically your directory structure here This is the file manager. What do you want to search for now? I'm going to search for something on my system because I know I have a documents folder slash org for org mode documents that I Typically put stuff here and then I'm going to look for this document I created for this video doom Emacs for noobs org We're gonna hit enter. Let's see if I can zoom in a little bit So you guys can see this and you can see this is already what we've covered on this video Installing the dependencies and then installing doom Emacs with the get clone and we ran doom install Now there are other doom commands. You could use other than doom install. There's also doom sync You will run that command often any time you change your doom Emacs config file You typically are gonna have to run doom sync to make those changes take effect in a permanent way Especially when we start adding software, I'm gonna cover that later But you have commands like doom sync doom upgrade doom doctor for diagnosing problems doom purge For purging orphan packages or packages that are no longer necessary doom help of course for getting help information Now the full path to all these doom commands Just like the doom install command is actually dot emacs dot d slash bin slash doom Space and then whatever command sync upgrade doctor purge Now if you don't want to have to type the full path To the doom binary you should add the path to the doom binary to your path Your shills path so in your bash RC or your zsh RC you should add this here What I have highlighted their export path equals and then home slash dot emacs dot d slash bin colon dollar symbol path all uppercase now let me open up a File manager here. I'm gonna open up through NAR here on my system Because let's talk about where all of these files were placed when we ran the installation So when you install emacs just regular gnu emacs, which we had to because it's a dependency, right? So we installed emacs it creates this hidden directory in your home directory at dot emacs dot d And this is where all of the standard config files for emacs go You're not gonna want to ever play in this directory Just pretend like that directory doesn't exist because we're gonna be playing with inside this directory Dot doom dot D. This is where the doom emacs configuration files are When we ran that get clone it placed this stuff here and it created these files for us config dot el Which is our config file are a knit dot el This is the stuff that gets loaded when you first launch doom emacs and packages dot el And what that is is that's where you place Packages that you want to install within doom emacs, and I'm talking about plugins and extensions now you don't necessarily Have to have your doom emacs configuration in Dot doom dot D. You could actually in your home directory There's a folder called dot config go into dot config you could create a doom folder within dot config and then place Your three configuration files in that config dot el and yet dot el and packages dot el in that directory if you would rather Use the dot config directory me personally. I just go with What's default you know emacs always creates the dot emacs dot D folder and doom when you run that get clone But by default it's set to use dot doom dot D. So I just leave those in my home directory I know some people are pretty anal about that sort of thing They want all their config files in the dot config folder for me. I don't care But if you do care you are free to move it The only thing is you can have a dot doom dot D Directory in your home directory and also have a dot config slash doom directory You can have one or the other but you can't have both So let me close this file manager and I'm going to zoom in a little more here inside emacs And let's talk about your three configuration files the a knit dot el the config dot el and the packages dot el And I will actually open these up So I'm going to open up a second instance of doom emacs And I'm going to do a space period to get into the directory editor dear ed the file manager, and I'm going to go to dot doom dot D slash a knit dot el let's open up the a knit dot el I'm going to zoom in I might have zoomed in a little too far So reading a little bit on the right hand side where I had the note about a knit dot el This is where you'll find your doom exclamation block. You see this here doom exclamation And that's all this document is is That massive block that starts with doom exclamation and what this is is this controls what doom modules are enabled And in what order they will be loaded. So by the file name a knit dot el this is when you launch doom emacs This is what gets loaded as soon as you launch doom emacs This file is evaluated early when you start up and because of that you shouldn't just add Any configuration stuff to this really you don't ever really want to play with the a knit dot el The only thing you do in the a knit dot el really is comment outlines or Uncomment lines because you should basically leave it as is the only thing you should do is Is You see the lines that are uncommented These are modules that are active the lines that are commented out Which are the ones with two semi colons in front of them Those are modules that are not enabled by default. So if I go through here For example, you see right here colon term and then I have e-shell shill term and v term They're all commented out.  So I'm going to uncomment that So now that I have those uncommented They will be available to me as emacs plugins when I restart doom I'm going to have to do a doom sync for all of this to take effect But that's how that works and that's how you should do this You should just go through here and if you know what plugins you want What plugins you don't want just comment out the lines that you don't want Uncomment the lines that you do want the really important ones though is this section here colon lang this is for the languages This is for programming languages You know the syntax and the tools that go along with them. So whatever languages that you Program in or script in all the time. Make sure you uncomment those lines So emacs lisp is uncommented Of course, you're going to be using a lot of elisp Configuring emacs, but some languages that I use on a regular basis. I'm going to uncomment haskell I'm going to uncomment javascript. I actually don't do much with javascript la tech might be a good one To also have uncommented Sometimes I do stuff with lua markdown is already uncommented or it is already uncommented I do sometimes edit php files. I play a lot with python I definitely want that uncommented. I think the only other one I might uncomment it Is a yaml because sometimes I do edit yaml files So what I'm going to do is escape to make sure I'm in normal mode and then I'm going to do a colon wq for write and quit To quit out of that now that we've done what we needed to do with the init.el The next configuration file I want to tackle is actually the third one that I've got listed here packages dot el So I'm going to launch another instance of doom emacs here And this time I'm going to get into the directory editor and go to dot doom dot d slash Packages dot el let's launch that file And this file there's really nothing in it. It is a whole bunch of comments, but that's it So what you want to do is go to the end of the document and then type i or o on the keyboard to get into insert mode I'm going to type o because that gets me a new line and puts me into insert mode and then What you want to do here is list all the packages that all the plugins for emacs that you want to use within doom emacs And these are packages or plugins that were not included in the init.el. So this is extra stuff So how you do this is you run this command. So within parentheses do package exclamation point space and then name of plugin Now, of course, you wouldn't put name of plugin. You would put the actual name of a plugin So let's do this for an example. So if you're a brand new doom emacs user and you've never used emacs or vim Definitely install this package here package exclamation space evil dash tutor and then hit escape and then do colon wq for write and quit Now because we edited our init.el and our packages.el Let's go ahead and close this doom emacs window as well It's asking me. Do I want to really close? Yes, I do and then open a terminal But because we edited those files the init.el and the packages.el We actually have to run a doom sync for those to take effect So I opened up a terminal and i'm going to run this command dot emacs dot d slash ben slash doom Because I have to type the full path to the doom binary because again, it's not in my shill's path and then this command here sync And it's pulling down any extensions any plugins that I added to the packages.el file It's going to install them for me and it's real rebuilding doom emacs basically So the next time I launch it anything that I added to the init.el should be enabled and anything that I added to the packages.el Should be available for us as well And I should mention that adding stuff to the packages.el file is the correct way to install plugins in doom emacs On videos you guys have seen me install software using other methods and those other methods though are a Temporary thing like if I do meta x on the keyboard and run package install, which is command built into emacs If I do package install name of plugin it will install that plugin for me in that session of doom emacs But when I restart doom emacs that plugin won't be available, right? To actually make changes permanently the correct way to install plugins in doom emacs is to use the packages.el file All right, that sync has completed. So let me close that terminal and I'm going to relaunch doom emacs And let's see if our changes took effect and the easy way to figure out if our changes took effect or not Remember we added evil dash tutor to our packages.el.  I'm going to hit enter Let's run through the evil tutor. So this is the emacs evil tutor It is a tutorial on how to use the evil mode key bindings, which are the vim key bindings That's basically a vim tutor. It's just a vim tutor with emacs in mind because it's got some emacs specific stuff in here as well I don't want to turn this into a vim tutor or a emacs evil tutor, but I will cover just some of the basics So if I page down on the keyboard one time in my case because I'm zoomed in so far But do j on the keyboard for down And eventually you will get to this diagram h j k l if I hit l I move right if I hit k I move up if I hit j I move down of course h goes left All right, so now that you've figured out how h j k and l work. These are the navigation keys That's really the most important lesson to learn. I won't cover much of the rest But I will say evil mode emacs is very much like vim and that it's modal and there's really Two modes you need to know about it first. You need to know about normal mode Which you're automatically in and you know you're in normal mode if you can navigate with h j k l That's how you know you're in normal mode. You can't just start typing a word and stuff happens, right? Now if you want to get into the other mode that's very important insert mode hit i on the keyboard So if I hit i Now i'm in insert mode. You see it says insert at the bottom left hand side of the screen there Now I can actually start typing stuff. So this is a line of text Exclamation point I could hit enter and start a new line And then when you're done entering the stuff you want to enter you need to get back into normal mode Just hit escape on the keyboard Get you back into normal mode and now I could j or k or l or whatever to navigate around Now let's talk about Copying and pasting and deleting. Let's talk about deleting first. So if I wanted to delete a line I'm going to go back to that line. I created I'm going to delete it dd For delete a line dd Now maybe I didn't want to delete that line. Well in normal mode just type u For undo so dd to delete a line u to undo. Let's talk about copying a line y y For yanking a line.  It deletes everything from my cursor to the end of the line For this inaction. I'm going to go into the middle of this line I'm going to do d dollar symbol and it deletes from my cursor to the end of the line Let me undo that and what if I want to delete all three of these lines Well, I could do dd dd dd, but that's inefficient Let me undo a couple of times to undo everything. What if I did three dd For delete three lines that works as well u to undo I could also do three y y to copy or yank these three lines And if I did a p for paste or put you see it actually paste those three lines Now for those of you that want a more in-depth tutorial on the evil key bindings or the vim key bindings What I strongly suggest is you run through the evil tutor Or if you are a visual learner look for two videos. I did a couple of years back I did the vim tutorial part one and part two Look for those two videos on my channel I cover all of the basics as far as vim key bindings the last thing I want to discuss here I'm going to do a space fr for recent files And I'm going to get back into my org document that I created, you know for Purposes of this video. By the way, I will share this org document I created I will post a link to it or something in the show description if you guys want this It's really not a very lengthy document. It's just some notes. I had for the show here But the last configuration file I wanted to discuss we already talked about the init file and the packages file config.el that is the file where 99% of the time you want to make a configuration change to doomi max the config.el file is the one you need to be playing with That is where you change like custom settings things like maybe you want to change the font size or the font face or Some setting within a plugin that's already activated within doomi max typically you do that in the config.el So if I do space period to get into the directory editor here and I'm going to go to dot doom.ds And I'm going to open up config.el And zoom in this is what this file looks out of the box But again, if you wanted to change some things you can for example, I'm just going to pick this empty space here I'm going to type i on the keyboard for insert mode and I'm going to run this command and you can run this command to set q space doom dash theme space and then a single quote And then the name of the doom theme I want to set here by default I think the default doom theme is called doom one or dark one or something But the one I want is doom dash pill night Another thing I want to do is I'm just going to paste this line here for you guys to see Set q doom dash font. We're going to set the font and for me. I'm going to set the font to family mononoke nerd font. I love the mononoke nerd font And I'm going to set it to size 15 because by default the doom emacs font is a little small for me Size 15 is about where I want it normally. And so I'm going to paste these lines here Now I'm going to do an escape to get back into normal mode. I'm going to do colon wq for write and quit I'm going to open a terminal and I don't know if I really need to do a doom sync for Changes in the config dot el. I know you have to do them anytime you edit a knit dot el or packages dot el I think config dot el you don't necessarily have to run the sync But since it just it just takes a second to run the sync I went ahead and did it Then if I relaunch doom emacs did my changes take effect? Yes I can already tell you that the font is a little bigger than the default font So those changes did take effect. Let me do a space fr for recent files and get back into my notes Here and I think that's all I wanted to cover here on this doom emacs for noobs video I hope I was able to demonstrate that it's not that hard It was very quick to actually get doom emacs installed two minutes, right? We got it installed and it's really not that hard to configure once you understand The three main configuration files the init dot el the config dot el and the packages dot el You don't have to ever really learn elisp I mean it would be nice if you knew a little elisp, you know to write a configuration file, but you don't necessarily have to doom emacs really takes some of the pain points away, right? And I would say it even takes some of the pain points away from you guys that spend hours and hours and hours Configuring vim. There's no reason to have dozens and dozens of plugins installed in vim and to have a thousand line Plus vmrc if you guys are spending all of that time Configuring your vim You're wasting so much time just install doom emacs because a lot of that stuff You're trying to get to work inside vim doom emacs already has it out of the box Now before I go I need to thank a few special people I need to thank the producers of the show michael gabe corbinian michael devin fran arch 55 30 a commie channel Chuck claudio donnie dylan george kelev devils lewis paul scott and willy these guys They are my highest tier patrons over on patreon without these guys This episode about doom emacs for the noob. It wouldn't have been possible The show is also brought to you by each and every one of these ladies and gentlemen all these names you're seeing on the screen right now These are all my supporters over on patreon because this channel is supported by you guys the community You'd like to support my work. Look for distro tube over on patreon. All right guys peace I just tried to quit obs with colon wq You