 Recently, I've been playing a lot with my DOOM Emacs config and one of the things I've been working on is I wanted to have a start page, an initial buffer choice that wasn't the DOOM Emacs dashboard. Typically when you launch DOOM Emacs, you get a start page, the DOOM dashboard with the DOOM logo and some important DOOM Emacs key bindings and I wanted to set that to some other program or maybe a start file that I created, maybe a org file with some important links to other files on the systems or whatever it happens to be. Let me show you what I've been working on. So if I launch DOOM Emacs, this is now my initial buffer. I created this image here, but DOOM Emacs, right, the DOOM Emacs logo and then a custom start page. Just for purposes of this video, I want it to be obvious what's going on here. This is my new start page. It's essentially an org document where I've created these tables inside org mode. If I zoom in a little bit, you can see I've got a list of key bindings for people that maybe want to borrow this file and maybe you're new to DOOM Emacs. I kind of created this for new to DOOM Emacs users where you get some of the important key bindings, the program that the key binding launched, a description of the program. And by the way, these links, I have made these links clickable. So and if I do meta X on the keyboard, of course, I get the command prompt here inside Emacs, right? But if I just click the program, I also get it too. So every one of these links actually in this is a program, an Emacs program that I can launch, for example, iBuffer. Typically the key binding for it would be space bi. But if I just click on iBuffer, I could also get to a space bp for previous buffer, gets me back. Some other important key bindings here. I've got the eShell and vTerm. The eShell, of course, is the Emacs shell where I just written in Emacs list, but it's its own custom shell. It's not bash or fish or anything. But if I click on it, you can see, I get a little split with eShell. I click on it again. I toggle that back off. Same thing with vTerm, assuming vTerm is compiled. I recently did a reinstall. So I think I've got to compile vTerm first. Let me close that split. And now that I've compiled vTerm, now vTerm opens. That's just a standard terminal emulator. So that will actually run your default shell, whatever you set that in your Doom Emacs config. I've got it to use the fish shell here inside vTerm. So the first table really is just important key bindings that you need to know to get started with Doom Emacs. The second table also is very important key bindings. These are related to buffers and splits. You have to figure out how to manage buffers and splits, you know, the split frames inside Doom Emacs to be able to function correctly, right? Because it's one of those things, especially Vim users. A lot of Vim users don't really know how to manage buffers and splits. Because Vim, it's not a priority. You can kind of get away with not knowing that. But within Emacs, because you have to, when you launch Emacs, you typically live inside of Emacs. You really have to learn how buffers and splits work. Also have important links to help documentation. And this is local documentation right here inside Emacs. For example, the Doom help documentation, right? So you get the Doom Emacs documentation, right? And they've actually, for those who've never read it, they've actually got some links to my videos here in their official documentation, which is pretty cool. Let me do space BP for buffer previous to go back to the custom start page. This last table I have here. Now these are important config files for Doom Emacs. So this is the config.org, the init.el, the packages.el, the three standard config files for Doom Emacs. Plus I have two config files for Eshell. So if you use Eshell, you may want to create a aliases file. So aliases kind of like bash aliases or fish aliases, right? Eshell also has aliases in space BP to go back. I also have a profile file for Eshell, which is to auto run something every time I launch the Eshell. And what I auto run is my color script random program. So that gives me the random shell color scripts that typically works in bash, fish and ZSH. In my terminal emulators, it also works inside the Eshell and Emacs because I have that profile. So this is just a little file that I've been working on. Let me do a split here and let me I'm going to have to zoom back out so the split doesn't mess things up. But if I open my doom Emacs config, so let me open my config.org here. I have a section now in my doom Emacs config. You can go check it out on my GitLab, the .files repository on my GitLab. I have a section called start page and I've played around with some different things here. The main thing you need to know is this line right here, this set queue initial buffer choice. So you know what, let me close that buffer. I'm just going to open up a new window and make that full screen. So let me open the config.org. So you need this line right here set queue initial buffer choice. And you know, how did I look up this information? Well, remember Emacs, every function, every variable is documented inside Emacs. Even the ones you create yourself. Emacs is a self documenting kind of program. Just remember all help key bindings inside doom Emacs begin with the key cord space H. And then some other key, you can see which key pops up and you can see the complete menu of the rest of the key bindings for space H and then something else. But the two most common ones you're going to look up all the time as a Emacs user are space HF for look up a function. For example, maybe I want to know what iBuffer actually does. Well, I can actually do space HF for iBuffer functions or essentially programs, right? And I'll get information about iBuffer here. I can actually see some examples of the code. I can actually go look inside the source code for iBuffer.el, this file that pretty much controls iBuffer if I want to. The other help key binding you need to know is space HV for variable. And initial buffer choice here is a variable. So if I look it up, you can see it actually before I hit enter, it tells me what the current value is because that's the current value in my config. But by default, that value was actually set to the dashboard buffer, which is a special buffer inside doom Emacs. Well, I just created this line here, the set queue initial buffer choice line. And by setting it to my own start.org file, it overwrote what the doom dashboard would have been. So really, that's all I needed to do was set queue initial buffer choice. And then what I needed to do, one other thing is to go into init.el. So this is a very important config file. This is for all the standard modules that doom Emacs kind of ships with out of the box, you just go in here and comment lines or uncomment lines to enable them. And the doom dashboard by default is enabled. But of course, you know, I disable it by commenting that line out and then do a space hrr to restart doom Emacs. And if you've made this change and you've made the change for the initial buffer choice in your config.org, you should be good. Now what you would need to do if you're running the Emacs daemon, the Emacs server, you probably need to kill that process and start it again. And then the next time you open Emacs, you should see your custom start page. So let me space bp to go back to the previous buffer, which is my config.org, some other things I experimented with. I'm actually going to delete these, but you know, I defined my own functions, essentially functions, remember programs that run, you typically do a meta x to launch something. Well, I accidentally hit the wrong key there, but you have def fun, right? Define, so define function and I created this function. Anytime you create your own custom functions, you should prepend them with some kind of a word or acronym or whatever it happens to be. For example, dt slash open config.org. I typically, you know, your functions are going to be something like some descriptive name separated by dashes, but if they're your own custom functions, make sure you prepend them with something that it's obvious. Hey, this is one of dt's own functions. It's not something that was built into Emacs. And then you can see I made it an interactive function. That's the second line wrapped in parentheses interactive means when I do all text meta x, right? And I do a search for dt slash open config.org, right? It is actually in this menu. If I didn't have that interactive line, that wouldn't appear in that meta x menu system, right? And then the code for what this open config.org function actually does, well, it's going to run the command find file on this path to my config.org. And the reason I initially made this is because if I go back to the start page, these important config files I had in this table, that's initially how I was going to launch them. I was just going to have these, you know, when I click on it, it's going to run the function dt slash open dash config dash org, right? That custom function. But I was like, why am I making a custom function for that? Let me zoom back in because let me toggle the links off. So let me toggle org, what is it? Org toggle link display. Let me toggle that. So this is what a link really looks like in org mode when you write it out, you know, before it squishes it. Essentially links in org mode are two opening brackets. And then of course at the end, two closing brackets. And then you have a closing bracket and an opening bracket in the middle. It's kind of like a link in something like markdown where, you know, maybe you're doing a markdown link for your readme.md for your GitHub or your GitLab, something like that. Org links are similar. They're a little different. But in the first group of brackets, what you have is I do elisp colon, meaning run this elisp code, execute this piece of elisp code. And what I'm going to do is I'm going to find file on concat yet env home. So that's the path to my home directory. That's all that means. I'm concatting the path to my home directory to this, the rest of this path.config slash doom slash config.org. And the find file on a path to a file just opens the file. So before what I was doing is I was having it execute elisp colon and then dt slash open dash config dash org, my custom function. But I was like, that's really more work than what I need, right? I don't need that to do all of that. I'm creating these functions that really there's no need for. I've got them in the config here. It's just some examples of how you can write your own custom functions. But really, since I'm not using them, they can go away now. So I'll get rid of that. Let me go ahead and write that. So let's talk about this next section, which is define minor mode start dash mode. So what I wanted to do, everything past initial buffer choice here is I'm creating my own start mode, right? I named it start dash mode because the page was start.org. I wanted it to have its own minor mode. When you go to my start page, of course, it's going to be the major mode is org. It's an org document. But I also wanted it to have this special start mode that was running. That way I could define some special key bindings that only work in start mode, which will only be for this page here. And those key bindings are one, two, three, four, five. So if I hit one on the keyboard right now, I go to my config.org. Let me space BP to go back. If I hit two, I'm going to open my init.el, right? Space BP. If I hit three, I'm going to go to the packages.el, et cetera. Right? And of course, having that key binding, how I accomplish that is because I've got this start mode, this custom mode for that particular page. And I actually had to look this up in some of the official GNU Emacs documentation. Once I looked up how to create this minor mode, which is really just these three lines here. And then inside it, I went ahead and did this evil define key. So I'm going to define some evil key bindings because I'm also running evil mode inside that page, right? So I have to use evil key bindings, evil define key when I'm in normal mode. So of course, evil mode, same as in Vim, you have mode, you have normal mode, you have visual mode, you have insert mode. When I'm in normal mode, anytime I hit a one, I want you to run this function right here. It's a lambda function, meaning it's an anonymous function. I'm not going to name it properly because it's not something that's ever going to be used other than this one time and this one config, right? So no need to name it. So I just make all of these functions lambda functions. And all they do is run the find file command on a particular file. And you see one through five. And I've got the various five config files that I want those key bindings set to. And you can see the comments down here. Originally, I had those key bindings set to those custom functions that I created myself. And then I realized doing these lambda functions was actually the proper way to do this. So again, I can get rid of that. That's just, it was good to put there for an example, but I think this is a lot cleaner. Let me write that. And then finally, after I define the start mode that I created and the key bindings, I need to add this hook. So I need to add hook to start mode hook because I create start mode. There automatically will be a variable for start mode hook. Every mode that gets created in Emacs, there will be a hook for it. Just automatically there. So I didn't have to create a start mode hook. It was created when I created start mode. I hope that makes sense. What I wanted to do was add dash hook and then start dash mode dash hook. And then I wanted to make start mode read only mode. And the reason I wanted this is I wanted this to be a read only file. So for example, if I go, well, let me go to the top of the document. Maybe this line I'm on right now. If I hit DD, you know, standard vim command to delete a line, nothing happens. You can see in the echo area at the bottom, it says buffer is read only. I can't make changes to this file. Now I can make changes to this file because I could type a read only. What read only mode, I can toggle that off. Let me go ahead, space TR is the key binding. Now that I've toggled that off DD actually works. Let me undo that though, space TR to make that read only again. And now DD no longer works. Now, why did I make this file read only? Well, I did it as a safety measure because I had this here where I set those key bindings one through five opens a particular file. You know, in your standard vim key bindings, you're often using numerals to do things. For example, I want to delete two lines. I would do to DD, right? And you can see what just happened to because I had that as a key binding to go to the init.el took me to the init.el and then the DD command actually just deleted a line in this file by accident. So that is why I have that there. So let me write that to make sure that's put back. And once again, let me go back to toggle. I don't think I toggled read only correctly, toggle read only. But you can see how very easily it is to quickly hit a numeral and then DD, right? Or a numeral and PP to paste or, you know, whatever numeral to because every vim command can be propended with a number to do that action a certain number of times. So the fact that I was using these simple key bindings one through five, I really needed this file to be read only. Now, I know what you're thinking. You're probably thinking, well, you could still type to DD. Even if it's read only mode, it's still take you to that init.el. It'll still run the DD. Yes, it will. But now I've made it a read only file. You know, I'm never actually probably ever going to be editing this file. I already know in my mind, this is a read only file. I can't just edit it. So again, it's just more of a safety measure just to have it in my head that, hey, you can't edit this file. You shouldn't be trying to edit this file. One thing I also need to mention about the start mode that I created is, how does Emacs know that start.org, this custom start page I created, how does it know that start mode should be one of its minor modes? Because we didn't mention that in my config.org. Well, you actually mentioned that in the org document itself. If I scroll down to the bottom, I've got these three lines here. Commented lines, but Emacs will read them. And you can see local variables eval, meaning evaluate, and I'm evaluating start dash mode. And then I've got the ending tag here. So that's how this org document automatically launches start mode. So that is how that magic happens. So that's just a little bit of what I've been working on the last few days, creating my own Emacs start page, essentially. You can think of it almost like a dashboard, although I'm not doing any kind of dynamic stuff where it's got menus of my most recent files or anything like that, although I could probably write some custom functions to create some of that. For now, it's mainly just this table of these functions and config files that are in these org tables that I can quickly click on, or I can hit a key binding for some of them to actually execute that function. And again, for those of you that want my configs, or you want to check out my configs for inspiration on creating your own custom Emacs start page, check out my .files repository over on my GitLab. Look inside the directory .config slash doom. Now, before I go, I need to thank a few special people. I need to thank the producers of this episode. And of course, I'm talking about Brian Gabe James, Matt Maxim, Emmett Mitchell-Paul-West, while you bought Homie Alex, Armored Dragon Chuck, Commander Angry, Diokai George-Leib, Marsh Drum, Nate Irion, Alexander Paul, Peace, Archimvedor, Polytech, Reality's for Less Red Profit, Roland, Steven, Tools, Devlin, and Willie, these guys. They're my high-steered patrons over on Patreon, without these guys. This quick little video about an Emacs custom start page would not have been possible. The show's 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, the community. If you like my work and want to support me, check out DistroTube over on Patreon. Alright guys, peace. I should add links to Tetris and Pong on my start page.