Leaving Doom Emacs For GNU Emacs? - DT Live!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to another edition of dt live hope everyone is doing okay this evening today what i'm going to do is we're going to do an emax configuration basically from scratch we're going to start at the beginning and configure just plain vanilla gnu emacs and we're going to start turning it into a proper text editor maybe a proper ide so this will be something a little different because you guys know typically i use a pre-configured emax a distribution of emacs called doom me max which honestly is fantastic there are actually many advantages to using something like doomy max doom max isn't really like it's not just a config file for emacs doomy max they make a lot of behind-the-scenes improvements to e-max some performance improvements and things that's why you can have you know all those plug-ins running and do me max and it typically will run faster than if you had those same things running in canoe emacs so there's there's a lot of advantages to doomy max now one of the advantages of starting from scratch with good new emacs and building it up is you actually learn a little bit more about emacs because you have to get in there and really you have to learn about all the the plugins the packages you need to install to build your your ide essentially where do me max of course has so many of these things already installed for you they're already running for you you may not even know that those things are installed and in many cases you may not even know that those weren't part of the default gnu emacs package until you actually open up plain vanilla emacs and plain vanilla emacs looks like this this is what we're going to start with and obviously doing this on a live stream will be a little tricky now configuring emacs especially when you don't know what you're doing i know a little bit about what i'm doing some of you guys may not know anything about emacs so it can be a slow tedious process and i can tell you i actually started yesterday on this idea for this live stream and configuring gnu emacs from scratch i essentially wanted to recreate doomy max but using the new emac so i want the evil bindings and all the cool plugins that i had gotten used to in doomy max i want to get that in standard gnu emacs and i've probably spent and i'm not even kidding 12 hours 12 14 hours in the last two days configuring the new emacs now we're gonna start from scratch again but i've got some notes that i've taken in the last couple of days for those of you that want to follow along what i suggest is install emacs right install emacs from your package manager it'll just take a minute to install it the only thing is what we're doing today because we're going to be using evil mode you don't necessarily have to know anything about emacs to follow along today but if you don't know vim it may be tricky because one of the first things i'm going to do with this config is we're going to install evil mode so i have the vm key bindings because i don't really know the gnu e max key minings i know some of the basic key bindings for gnu emacs but i haven't used gnu emacs in so long you know i'm just gonna immediately install evil mode now you guys that are hanging out in the youtube chat let me ask you guys about the audio is the audio good give me a yay or an a i'm not monitoring the stream audio today i am i've got me a beer so i do have a a nice german beer via stefano of course the camera is not going to zoom in on that but one of my favorites it's expensive being a german import i can't afford these very often but you know a few times a year i like to go to a nice shop that has a lot of imported beers and and buy a vian stefano yeah yeah yay mike is muted okay yeah we can hear you dt yeah the mic is muted yeah that that that's never gonna trip me up i would actually know if the mic was muted i just wanted to know about the audio levels you guys are hearing on youtube so if you told me hey man the audio was really really low i would actually opened up pavu control and started investigating that issue but when you tell me it's muted i know the mic's not muted as i can see the audio meter and obs going it's definitely picking up something all right so i'm gonna kind of rush through this this evening because creating a emacs config from scratch um you know every little plug-in that we install every little section that we we cover i could make a a full hour long live stream just on each little extension that we install i don't want to do that so i will kind of rush through some things i will just briefly mention hey i'm installing this package here's basically what it does but we're not going to spend a lot of time really digging into like the documentation on each and every module that i install for those of you that want to investigate further i'll let you guys do that in your time back to the chat for a second big pod says one day he might do a live stream about vs code configuration that would probably be an alright live stream i'm sure there are plenty of people that would like that so let's see how we want to tackle this today so this is going to be a little tricky so obviously when we first launch emacs by default it's got a menu bar it's got the toolbar it's got scroll bars it looks kind of ugly and it's going to use the default emacs key bindings that i really don't know the default key emacs key bindings the only ones i know because they're kind of common and even though i use evil bindings i sometimes still use these gnu emacs key bindings i know control x control f will get us the find file command so if i do control x control f you will see find file at the bottom that prompt and the file i want to find is dot emacs dot d slash init.el it's not going to exist on my system because this is brand new installed so there's no init.el so it will be an empty document in my case so what i want to do is i don't want to actually write this config as a net.el i actually want to do it as an org document i want to do a literate config because that allows me to add comments i mean you can add comments in an e-lisp document but it's so much easier to do it as an org document because you don't actually have to comment you know with uh semicolons all your comments right you can just write them as normal text and then you just make sure your code blocks are actually wrapped in code blocks so i'm going to go ahead and immediately we're going to change this to a literate config so let's see if i can zoom in i'm not sure what the default key binding to zoom in and out is in gnu emacs i do know the command though i believe it is text increase so if i do meta x alt x to get us a command prompt and then type text dash increase that should zoom us in it's actually text skill dash increase although it still ran the command it knew what we wanted i guess uh text increase is probably alias for text skill increase so let me type something just to have something on the screen and let's text increase one more time and see if it does increase it just ever so slightly though let's do it one more time just because i don't know i'm sure there's a key binding for it already built in i just don't know what it is but i think you guys can read that size font so we'll just go with that so the first thing you want to do if you're going to do a literate config like i am is i'm going to paste i don't know what the default canoe emax keybindings for pay star we're only going to have to worry about this until i get evil installed but it looks like paste is control y i could of course click it in the menu or now that i know control y i'll remember that i'm going to add this line to my init.el and what this does is it's saying hey in the default uh user emacs directory which is dot emax.d unless you change it you can change it if you want to but in emacs.d i'm going to have a file called config.org i could name it whatever but i'm going to name it config.org and that's where i want the init.el to grab all of its its source code from so now i need to save that don't know the command to save control x control s yeah i did remember that so control x control s on the keyboard to save or if you still have a menu bar of course you can just save it from the menu we're going to get rid of the menu bar as soon as we get evil mode installed because we won't need it anymore right now i need it that's why i'm not going to bother turning it off just yet now what we need to do that we save the init.el we need to go ahead and create our config.org so remember control x control f to run the find file command and then in emacs.d create config.org and this will be a new org document now you can go ahead and add some stuff to the header of your org document like you could do plus well well that's small font again i hate that let me zoom in as many times as i think is necessary here but in org document you could go ahead and title it so i'm going to do a hash symbol followed by plus sign title colon and i'm going to call this dt's emax config and then i could do author because i may export this to html or to pdf or something else later so it's nice to have all of this meta information uh already in in the document just in case you ever export it later so i could add my name i could add an email i could add a description um right now i think i'm just going to go with title and author the next thing i want to do is let's do a top level heading so i'll do a single asterisk and what do we want to do first i'm trying to figure out how i want to attack this because there's a certain order like what's going to make our life the easiest do i want to i think i want to get evil mode set up as fast as possible to get evil mode set up though we need to take care of some package management stuff so what i want to do is let's start with a section i'm going to call it package management and then let's go ahead and i'll do a second level heading here let's set up package.el to work with melpa now package.el is like a it's almost like a package manager within emacs and by default it uses the elpa repositories e-l-p-a that's where that's a e-max plug-in repository that's run by the gnu guys there is a second uh emacs plug-in repository called melpa and it's got even more plugins in it and you really want to be able to install and remove programs uh you know in both elpa and melpo so we don't have to worry about elpa support it's already here out of the box we do want to make sure that we can install plugins from the melpa repositories so then what we need to do is write some e-lisp code now ideally in org mode you should be able to type the less than sign followed by a s and then the tab and you should get a source code block that just expands that will not work just yet we will have to actually install a package to make that work so i'm going to actually have to type the source code block myself so once again the hash symbol followed by the plus sign and then begin underscore source and then space and then the name of the language that you're writing a source code block in so i'm going to do emacs lisp if we were writing bash you would write bash if we were writing python you specify python you're writing you know haskell you could write haskell it just let it know what the programming language you're writing is and then at the end of the source code block you should have end underscore source and you see the color changed and that lets us know that that is actually typed correctly i had to think about it for a second and then we need to add you know what i'm going to copy and paste off camera here since i've got a triple monitor system i've got some show notes and some browser information i'm going to copy let me make sure i've got the right page here to copy i'm gonna copy that so what we're gonna do is we're gonna require package package.el again that's the uh the package manager that's already here and then basically what we're doing is setting it up so it can connect to the melpa repository and then these last two lines refresh contents and package initialize that is every time we load emacs it's going to basically do a fresh sync with elpa and melba so we always have the latest packages available to install so that is what that is doing and i could actually close this and restart emacs to verify that that is working but then i'd have to go through the trouble of zooming the text back in and out so i'm not going to do that just yet until i get a little bit more stuff set up here i think the next thing i want to do is we're going to install a program called use package a lot of times in people's emacs configs you will see them when they need to invoke a package it'll be written this way require and then quote and then name of package use package is a little bit of a better way to do things you see a lot of people that go to the trouble of installing used package and using use package it's not necessarily a package manager in and of itself but it does make you know referring to packages and uh in your emacs config a little easier you can tell that hey this is when i want you to run the package this is one i want you to diminish this program uh defer running the program you can do a lot of things with the use package command i'm not gonna really go in depth on everything with used package i'm mainly going to use it to actually just get programs installed at least that's what we're going to do today so i need another source code block so i'm going to do begin underscore source one more time emacs dash lisp and i'll go ahead and write the ending block so end underscore source and to get use package installed what i'm going to do is this command in parentheses unless space and then another parentheses package dash installed dash p space and i got this off the use package uh github it tells you exactly how to how to get this uh installed and set up and then quote use dash package if i can type i've got a microphone in the way right in front of my screen so sometimes i'm typing i can't actually see what i'm typing so uh sometimes i make typing mistakes and don't even know about it until a few seconds later so and then the next line we're gonna do a package dash install and then quote use dash package and then the ending quote there and then or the ending parentheses and then one more ending parentheses because i needed to end that parentheses as well alright so what this will do is get us working with both the elpa and the melba repositories and get use package installed and with use package we can start using use package to install things and i think before i do anything else i want to get evil mode installed i think that's what i we should do right away so let me go ahead since this is still org i'm going to type another header here i'm going to call it evil mode and one more source block here so begin underscore source emax lisp well that's going to get tired now old really quick having to type these source blocks all the time i've got something that will help with that in just a second though and then now that we have used package i won't use package to install evil force i'm going to copy and paste some stuff this is going to be rather lengthy this is not something i came up with necessarily on my own but use package use package no quote just the name of package so you use package evil is going to tell emacs we need you to load the evil program now evil is not installed unless i do meta x package dash install and then search for evil and install it i don't want to do that though what i want use package to do is if evil is not installed i want you to install it so colon ensure t until uh use package to install evo for us if it's not already installed then also within the use package statement here we have colon init so these are things that i want use package to load up before evil you know to tweak before loading the evil configuration so i'm going to set things like typically in them i like my vertical splits to always open on the right and not the left so i made sure to add that particular line there i also like my horizontal splits to open at the bottom not at the top so i went ahead and specified that just in case it was going to be the opposite i also have a use package block here we're installing a package called evil collection now what is evil collection it is a collection of programs that help like like evil mode really only kind of works in text editing but sometimes you want to use the evil bindings and other things like uh ibuffer and deerhead and all these other emax programs the evo collection will help us with that now obviously this was a little bit of a lengthy copy and paste here i i will save whatever the configuration ends up being at the end of this live stream i will save it and i will post it somewhere i may upload it uh i don't know i may push it to my git lab or i may just paste it on paste bin or something i need to figure out what i'm going to do with this config because i don't necessarily want to get rid of my doomy max config either i've got a working doomy max config that i have on my gitlab so i don't want to have uh you know i would have to i couldn't have two different dot emacs.d directories for example now that we have that let's go ahead and save the file if you don't remember the key binding you go to file and click save or you could do control x control s that didn't work there that time it worked and now let me close and now let me relaunch emacs and see it actually launches you see it's connecting to elpa and connecting to melpa so it's syncing those two repositories and it's installing evil mode force how about that an evil collection all right now does evil mode actually work yeah now k moves up j moves down so now we can edit with the vm key bindings so if i did control x control f for find file again and emax dot d and then config.org now we can actually edit this like a normal person because you know all my vm key bindings and everything work so now we have to figure out how to zoom that might be the next thing i add to the config is a way to zoom in and out using key bindings so take a quick break for some beer yeah system crafters he says you can have multiple emacs configs on one machine with gmax i've never heard of gmax i'll have to look for that i like the name though yeah don't tell me that yeah because already you know i i wasn't planning on getting rid of my doomy max config and i'm not necessarily saying i'm going to leave doomy max because it really does a lot of things right like really when you configure gnu emags and then you check out doomy max you realize how much easier they make things especially package management like everything we just went through here we wouldn't have to go through any of this with doomy max it's already set up for us so but like evil and then melpa and elpa and all of that we could have skipped this step max it's already ready to go out of the box all right see i've got this split over here how do i close the split now that we're using the uh evil key bindings like if i still had to use the gnu emax key bindings i have a problem remembering how to close the split but now that we're using evil in vim to close a split ctrl w followed by c ctrl w followed by c now now we're to the point if you know vim you're good so you never have to worry about the emacs keybindings again all right it's like where do we go from here let me increase this text again does it remember the text increase command there we go one more time i think what i want to start with next i know one of the first things people will immediately want to do is set fonts and set a theme and just because i really like the doom emacs default theme the doom one theme uh they actually have that as a plugin on melpa it's called doom dash themes so i mean i can go down here and let's do theme and now i can do use dash package and i believe it's called doom themes with an s and then i need to ensure that that gets installed on the next start and i could actually go to the doom themes github page and find the exact code actually i could go to my doom emacs config i have this on a a workspace here this is actually arco linux running in a vm and in the vm i installed my xmonet config and my doomy max config so i can actually go and look at my doomy max config for example if i wanted to i could go check out the fonts section of my doomy max config now some of these commands might not work mononoke nerd font that's what i used to use i think i switched to source code pro here recently though i got confused between the vm and the host machine it was picking up different key bindings well the next thing i'm going to do i'll just do a quick paste here now we actually did not do this in a source code block but now that i have the vm key bindings working i'm just going to do a quick copy and paste so i'll yank that and then paste the beginning block there i'll yank that paste the ending block there now that we have that source code block so use package the next time we relaunch new me or gnu emacs it's going to install the doom themes package for us and then set cue doom themes enable bold so it's going to have the ability to have bold text it's also going to have the ability to have italicized text and then we need to load a theme because doom themes is a package of i want to say like 15 different color schemes and the one i wanted to load is doom 1. now that we have that colon w now to write so we don't have to control x control s anymore although those key bindings still work you just have an extra set of key bindings you can use now and if i close this out and assuming i didn't make any mistakes in the code if i relaunch emacs it's going to connect to melpa it should install doom dash themes for us and that's the doom 1 theme am getting an error here in the split over here i don't know if it's an error but it looks like it was complaining about the doom theme doom themes uh compiling although it must have compiled correctly because it definitely loaded the doom one theme so i don't know i don't know why it's complaining there so control x control f for find file again let's go back into emacs.d and config.org yeah that looks a lot better like literally we've spent almost no time on this config i mean we got the the package management stuff set up and then just by installing that one color scheme and installing evil i'm okay like even if you just handed somebody this to start with which is one of the things one of the problems i've always had which new emacs out of the box is is it doesn't look good it doesn't look good and like it's just rough it's rough around the edges and i think you would probably see more people adopt gnu emacs if they just made some basic changes you know some basic theme changes maybe install some fonts out of the box you know install some things like icons and emojis and that sort of thing back to the chat for a second yeah now dt is cheating with evil yeah but i think doesn't everybody use evil mode in emacs i know there's a lot of people that use the standard key bindings but i suspect that there's a lot more of us that that use the evil bindings just because it is easier on the hand it just is having to constantly control x control of control x control s control this and control that and control control control eventually you're gonna have emacs pinky you don't want emacs pinky yeah anton yeah you can place a cursor after the expression and do an eval last yeah so for a restart we're going to cover that in just a second because that's going to be very important here in a minute i'm going to switch instead of using emacs i'm going to use the emacs client and it'll be a lot easier just to do a hot reload than just closing it and reopening it's not that bad with emacs but the client would require me killing the damon restarting the daemon and all of that i wish nc spot was supported in emacs v term yeah some of the emax terminals have a problem with certain in curses programs incursive programs typically just run them in a standard terminal like you know h-top doesn't look great in most of the the emax terminal emulators yeah i just remapped everything and you know that's another thing one of the things i probably need to do right away is get the uh the key bindings because i'm so used to the doom e-max key bindings i'm basically just going to add the doom key bindings to everything but right now i want a way to zoom in and out for text so give me just a second guys got some notes here to help me to help me out and i had something i actually looked this up earlier today because the zooming in and out was really bugging me actually let's go ahead and get the fonts set up i think that's what i want to do first let me just zoom in with this command since we know it there let's go ahead and install some fonts i'll just do a fonts heading somewhere here and then we need to have a source block i'll just copy and paste the source block for now although it's bugging me enough that may be the next thing we deal with but let's go ahead and do the fonts and for fonts i think i'm just going to do what i was doing in do me max as far as you know the fonts i was using i was using source code pro which is uh an open source version of like the adobe source code pro font that everybody uses so in the aur you'll find the nerd font collection if you want to you can just install soft code pro by itself or you can install the entire nerd font package which includes like 12 15 different fonts so i'm going to go ahead and set up our default font as source or source code pro oh it's a mono space font but that'll be the default font variable pitch font so if we do something like in eww the emacs browser you know it doesn't need to be mono space font it's fine fine if that's a variable pitch font we'll just do ubuntu for that ubuntu nerdfight which is the the standard ubuntu font and then fixed pitch of course source code pro fix pitch that's going to be our mono space font if i wanted to adjust the line spacing now the spacing in between the lines you know i could uncomment this and play with this i just had this here as an example for those of you that need to play with that now this line here i'm adding because i'm going to start using the emacs client that's typically what i use anyway but right now i'm just using the emacs command but here in a minute i'm going to launch the emacs daemon the emacs server and we're going to start launching emacs as a client and the fonts won't look right without this line here add to list and then quote default dash frame dash a list and then specify a font for that also that's going to be soft code pro nerdfight let's do a colon w now if i wanted to resource this file there's a number of ways i could do it somebody in the comments mentioned we could just do an eval you could also do meta x and you could do load file and then it's asking what file to load we're already in emacs dot d that directory i want it to load init.el because remember all of this is getting written to init.el let's reload init.el and you see my fonts changed that's how we know that worked so yeah you could do an eval you can do an eval on specific code blocks you can do an e file of the entire buffer you're in or you could just do a load dash file meta x load dash file and then go find your init.el and that works too in do me max there was a key binding space hr that would restart your config i'm going to add that same key binding i think to this config all right zooming in and out we got to get zooming in and out working for sake of time i'm just going to do a copy and paste here now these are key bindings that people often add so this is not hard to google zooming in and out here and then another source code block emacs lisp and global set key we're going to set a key binding and i'm going to set control equal sign so control plus except you don't really have to use shift and so control equals it will be the text skill increase command that i've been doing with meta x and then you know text scale increase here we're just going to make that a key binding now instead of having to do meta x and then type the name of the command control minus we'll do a text skill decrease for us um if you wanted to you could actually add mouse wheel bindings i typically don't use these but typically when you do a search for zooming in and out in e-max you will often see these two bindings and these two mouse bindings together so that's why i went ahead and pasted it and if i do a colon w for write and let's do a load file again reload the init dot el and now control equals zooms in control minus zooms out control and the mouse wheel up zooms in control and the mouse wheel down zooms back out not difficult stuff you know this it take it takes a few hours really to get a working config up and running and mainly it's because you can't just go and find all of this stuff in one spot right like the use package documentation i found on the use package page on github the global set key commands for zooming in and out i found that on stack overflow you know some of the stuff in this config i found on reddit you know you would think there would be like some basic config some some basic templates out there that would really help jump start people but there's not you know typically when you search for emax configs it's these three thousand line long configs on somebody's github you can't make sense of all the e-lisp code they wrote because they're writing custom functions and everything sometimes these really long emacs configs people don't bother commenting that's one of the things i really like why why i do these literate configs these days because it gets you in the habit of actually commenting you know you should actually have comments so i have a header zooming in and out and then i tell you what this is going to do basically you can use the bindings control plus equals and minus for zooming in and out so nobody sees this code block and goes what the hell does that do well i tell you exactly what it what it does right here in the comments i didn't write a comment for the theme but i think most people would understand what the theme does i'll go back and add comments though later you guys have seen all my configs i'm a a real comment freak i could comment everything because so many people use my uh configs almost like official documentation i feel i owe it to you guys to make sure you know you guys have as good an explanation as possible and dt what beer are you drinking via stefano it's a german beer very good beer one of the best ones you'll find hard to come by you're probably going to have to go to a shop that carries a lot of specialty beers a lot of imported beers i say it's hard to come by in my neck of the woods it's hard to come by yeah arch just works yeah as far as linux distributions yeah there's no reason like if you're on arch i wouldn't wouldn't be in a hurry to ditch it and go somewhere else yeah debian just works yeah if you need something stable you need a server operating system especially debian's great dt you should try a belgian beer called delirium oh i've had it i've had almost every beer known to man so it is a great beer all right now that we have you know what now that we have evil bindings i don't really need this menu system anymore because now i know the bindings for splits and you know copy and paste and everything so i can get rid of the toolbars the menu bar and the scroll bars and this is pretty standard stuff here so let me create a new heading here i'll call this graphical user interface settings and then the source code block i'll just copy and paste again i really need to fix that to where we get an auto expansion of these here in a minute but for now i'll just deal with the copy and paste and uh this is commands that almost or configs that let me restate that these are settings that almost everybody puts in their emacs config you're going to find this setting in virtually every emacs config known to man menu dash bar dash mode and set that sucker to -1 and then let's do tool dash bar dash mode once again minus one and then scroll dash bar dash mode minus one i don't know what the heck is going on with my org mode source blocks and the spacing i i know the code that'll fix that spacing problem we'll just deal with it for right now but let me go ahead and write that load file init.el and there we go with no more menu no more toolbar no more scroll bars spacing wow i don't know that was weird why it changed the spacing on every lines i wasn't even working on it just started moving like this source code block is all kinds eject i don't know why it did that out of the box emacs has some really weird little quirky things it really like again it's one of the things that really makes you appreciate something like doomy max because you know like you can open up an org document and do me max and immediately start working on stuff and it just works fantastic and you know here i mean why when i was doing something in this line here did it you see it affected all the lines above it it's like what's it doing it won't affect anything this bad spacing actually won't cause any errors later i'll go back and fix it dt you should try slovenian beers like union or lasko i don't think i've ever had a union i might have had lasko it sounds familiar czech beers i know i've had some some czech beers i couldn't tell you which ones i've had right off hand i've had beers from all over the world years ago i worked in a rather large liquor store wine shop we did a lot of imported beers at a cigar room a humidor and you know a nice place and being a beer drinker i probably tried every beer that i could get a hold of working there you know all the imported all the good stuff you know not the cheap bud light miller light none of that swill but all the good like german beers and english beers see what version are you rocking this gonna be the latest version of emacs if that was a good question i'm on arco archbase distribution so it will be the absolute latest version now one of the things like comparing this to my doomy max one of the things that i notice one of the things that really makes this look a lot nicer is the mode line the status line the status bar at the bottom also line numbers i typically turn on line numbers i want that to always be turned on now i could do display line what is it display line numbers mode is it i notice which key is not installed so in doom emacs when you start uh typing something like if i did space f it will tell me the keys that are binded to space f plus another key and exactly what they do that's another very important plugin that i think almost all emacs users install and which key is really easy to install so let's just go ahead and do it i'm trying to figure out just for sake of time what i want to tackle what i don't which key though is an easy one let's do which key let's get the source code blocks here which i'm still just going to copy and paste and let's install it using use package you remember use package use package and it's which is it which dash key i believe it is and then we're not going to use the closing parenthesis just yet because i'm going to do ensure colon or a colon in short space t and then the closing parenthesis and then start a new line once it's installed i want you to run which key mode all right colon w to write let's go ahead and load our init.el one more time and now when i do control x for example now it tells me all the other bindings associated with control x so that is which key that is a very nice plug-in to heavens that really should have been one of the first things i mean i really wanted evil first and just so i could actually function because i know the evil key bindings but which key is definitely one of the first things you want to install the theme was also one of the first things to install i think i want the doom mode line going back to the vm with doom emacs i mean we could customize our own mode line but why just grab somebody else's that's already pre-configured for us they've already got it packaged up in melpa just gonna take the doom guys mode line because why not uh it's sexy it's yet minimal i have no problems with that mode line so let me make sure the package name i think it's just doom mode line though pretty sure it is yeah doom dash mode line so where should i put that i could just put it under theme here even though i guess i could have a heading specifically about the mode line but you know what i i think it it's kind of about the theme anyway so i don't know i may rearrange this config later but for now so let's install it with use package no i cannot type the word package for one thing my moon landers not directly in front of me let me move it over a little bit people have asked me about the moon lander keyboard yes it's fantastic do i regret purchasing it absolutely not so insure t again to make sure that doom mode line is installed if it's not installed install it for us and then i think what we want to do is doom dash mode line dash mode set that to uh one load or init one more time and i don't don't have a new mode line yet or do i hard to tell but i don't think that's the doom mode line let me make sure it is doom dash mode line dash mode line dash mode did i not write before doing all of that i may have not written the document before trying to reload yes that was the problem now that's the doom mode line right and the nice little icon we got the org mode icon next to the title of the org document yeah the coloring over here letting us know how many minor modes are going on yes now it's shocking how similar you know do me max and gnu emacs are starting to look now it helps that i'm using the doom theme and the doom mode line let's see can't you set insure t globally i'm not sure i haven't checked on that now there are a ton of different uh commands you could give within use package i'm just i'm just keeping this simple because i didn't want to like go real deep into what each command does and trust me we could do whole video probably whole video series on used package but typically with used package how it works is you do use package basically load this this package when it's needed if it's not installed ensure t installs it some of the other commands you could do i wouldn't use this one unless you need it defer t defers loading this package until it's needed and that can get you into trouble for example if i wanted to defer evil well that would kind of suck because i don't want to use the the default good new emacs key bindings right also sometimes you'll defer loading a package but another packages depends on it so you can play with the defer command if you need it within use package because it may help with performance on some things but i'm not going to play with that another one you could use i think i showed you this one earlier a knit and then some commands as far as things to load up before doom themes is initialized another one is colon config and that is for config type settings you could do all of that within the use package statement there but can you load uh ensure globally i'm not sure i'm not sure i would bet you can dt can you do a gentoo install video sometime i think it would be interesting to watch you do it since you explained things very well i have done a gentoo installation on camera before a couple years old but you can watch that i guess i need to do another one but it's it's not hard if you guys can install arch linux you know a command line install of arch linux you can install gentoo it's just longer it's uh not necessarily because there's a lot more commands to enter it's just because you have to wait so long on all the packages to compile but essentially if you can read the arch wiki and get through the arch install you can read the gen 2 wiki and get through a gen 2 install it's really not any more difficult it's just time consuming it's just a little tedious it's all yeah you just looked up the moon lander keyboard yeah i did a video about me buying the moonlander what two three weeks ago it's essentially like the ergo docks it's just a different kind of from the same company that makes the ergo docks so it's a split hand keyboard ortholinear mechanical and programmable so and daniel in the chat says yeah set cue use dash package dash always dash ensure t okay see i knew we'd get an answer all right now we have not nearly installed like the two 300 packages that i need to install to eventually get this thing to function like my doomy max config and we're not going to get it anywhere close to doom e max we just simply don't have enough time even you know you know we've been going an hour now and we're not even close although with what we've done just by getting a theme and a mode line that looks good the fonts look good and just having the evil key bindings already this is a good place to start like if i just package or uploaded this config somewhere for you guys especially you new to emacs users you know you could just use what i've done so far here and this is a nice start right this is a lot less scary than starting with an empty init.el which is what really what you start with with gnu emacs is all right open empty file init.el and start programming your text editor you know now one of the things i didn't like is looking down here i had some lines that were running kind of long especially when i zoomed in i don't see them now but the lines were not truncated meaning i start typing something the lines are not truncated uh i don't like that i want truncated lines so typically i have a key binding and doomy max where i can toggle on and off truncated lines the command is already built into emacs if you did a meta x i believe it is so toggle dash truncate tab complete yeah toggle dash truncate dash lines would toggle that on and off typically i want it to automatically set the truncated lines as soon as i open emacs and if i want to i can always toggle that back off if for some reason i needed it i think what i want to do go back to graphical user interface settings here and let me just make a comment because i'm going to add some stuff here so disable we disable menu toolbar and scroll bar and then let's go down here let's do a new heading get rid of spaces there so that actually looks right the org mode spacing is still off do i really want to dive into configuring org mode on this camera on this video i don't know because that can get deep i may just do a massive copy and paste because i have a rather large org mode section in my doomy max config and some of that stuff will probably solve some of my org mode spacing issues and and all of that what we're going to do here let's display line numbers which we already did and truncated lines so where did i put the line numbers or i haven't i did meta x to display the line numbers i want line numbers to always display though so we might as well kill two birds with one stone here so source code block right there get the ending statement of it and what was the command for line numbers do you guys remember i believe it was google global dash display dash line dash numbers was it numbers dash mode very lengthy command all right all right that'll take care of line numbers for us and then global what what truncated lines how do we want to do this i left a note here off camera global dash visual dash line dash mode let's toggle that on because if i did meta x the command is actually visual dash line mode to uh toggle on and off the truncated lines but if you do global visual line mode toggle that on that will get us what we need i'm going to write that you know what i'm going to do let's close let's relaunch connecting to melpa i don't know if it had anything else it needed to install everything looks good control x control f to find file let's get back into dot emacs config.org control equals and zooms back in already it's it's pretty comfy to live in already this is all right and it's blazing fast one of the things not having hardly any packages installed yet this thing is actually rather speedy now what really slows emacs and vim and vs code and sublime and other text editors is when you start adding things like uh auto completion frameworks spell check especially just makes things slow to a crawl now if your your work demands you need those things in your text editor obviously you have to have them if you don't need them though i wouldn't be so quick to install those things all right now one of the things i like about doom emacs is i like having all of my key bindings have the space prefix not all of them but you know most of them probably have the space prefix and we can actually do that here in doomy max let me find a spot to i'm gonna put this near the top of the config because the package i'm gonna install most everything in the config after it will need it so it makes sense to put it somewhere near the top because this needs to load first and i think what i want to do is install a package called general so i'm going to title this general key bindings so this is going to be where i get my space prefix for my key bindings general is nice because it really makes setting key bindings in emacs quite a bit easier it's got a nice little format to it if i can type i don't know if it's the the vayne stefan er that's affecting me it is i want to say this is like 5.9 alcohol this particular beer here not not a light beer not terribly strong though so let me install the general package so why are things not wanting to work for me use package install this plugin here general and once again ensure t and let's say you have ensure working globally as was suggested from someone before and then i'm going to do colon config because i want to set this setting as well general dash evil dash setup now where did i get that particular code block i got that from the github page for the general.el plugin and then we can start actually get some space here we can actually start writing key bindings now because i played with this for a few hours in the last couple of days i have done a lot with my key bindings here here are some of the ones i use all the time in doomy max and because i use them all the time i wanted those same key bindings here so once we have general installed then we can use this command nvmap colon prefix space so what we're saying is i'm going to have a bunch of key bindings after this they all begin with space so space followed by a space runs council dash m x so that's your meta x command you know alt x command space followed by period and doomy max did a find file command i want that also to be find file here and gnu emacs etc etc now some of these key bindings are going to call upon programs that i haven't installed yet but we'll worry about that later let me write and let me go ahead and load our init.el and see if some of these key bindings actually work okay so now space followed by a period runs find file the same as in doom emacs let me get back to my vm of doom me max space period runs find file looks a little different because it does it in a different kind of split but it's the same program running i also wanted a lot of the buffer key bindings because i i used the uh i buffer commands a lot in doomy max and they were space b followed by some other key so space b and then here's the i buffer commands that were listed in this list here so the way you do this is you do prefix space and then the key binding should be the other keys you want to have to hit in addition to space so space space runs this command council dash m x and then you have colon which key that means if in which key which is the thing that shows you like space f for example shows me if i hit r would be recent files how does it know that that recent files where does it get that description from well it's going to get that description from colon which key and that's the description colon so space period runs the command find file colon which key find file is the description so if i do space and period is find file say period find file so that's how that works pretty easy like this really makes setting your key bindings pretty simple i went ahead and added the toggle truncate lines keybinding to space tt so if i did space tt that toggles truncate lines on space tt toggles truncate lines off the other thing i wanted is in doomy max there was a keybinding space hr for reload your config i did space hrr runs this command it's an interactive command it runs the load file command on the init.el which i've been doing meta x load file and then the path to init.el this just makes that command a key binding so if i did space hrr that reloads are config so i never have to i never have to go back to meta x to do that again so no load file no eval uh nothing like that i've just got got that binding now back to the chat for a second all right we're starting to get somewhere i mean we started with nothing and already it's a pretty decent text editor already now we're mainly focusing on the text editing here obviously because that's the most important thing to get straight like i haven't really added anything about the shells or about deerhead or ill-feed any of the other emacs programs that i typically run we were just trying to make sure that emacs kind of works as a text editor now there is one thing that is missing and i i think this will seal the deal is in doomy max well let me close my uh do me max here here in this virtual machine now let me relaunch new me max one of the really cool things about doom emacs is it has this really nice start screen this dashboard in do me max the program is called doom dash dashboard now in the new emacs you can have a dashboard too the program you need to install is actually called dashboard and it's pretty easy to set up and configure give me just a second i've already configured one i'm going to do a rather big copy and paste just because we're running out of time i only wanted to stream for an hour and a half tonight we're already at an hour and 10 minutes so where do i want to paste the information about the dashboard i think i'll just do it right here before evil mode i don't think it matters that it loads before evil mode it might i don't think it matters do i really need the evil key bindings in the dashboard there we go so emacs dashboard is an extensible startup screen showing your recent files bookmarks agenda items it also shows registers it can show like five or six different things and how we're going to install it again i went to the emacs dashboard github and i think they had already had an example of how to install it using use package so use dash package dashboard and then colon and surety meaning uh install it if dashboard is not already installed and then there's the init section again this block all of this here was already on the dashboard website so this was not something that i had to come up with on my own it's not something you guys will have to come up with on your own you just go grab that section of code from the emacs dashboard github so the init is say is we're tweaking the dashboard before you initialize it and we're setting uh set heading icons it's turning icons on file icons we're turning that on as well dashboard banner logo title so this is text that will be displayed at the top of the dashboard and this is something i came up with i don't know what the default logo was but i wanted to change it just to verify this setting worked and i typed emacs it's more than a text editor exclamation point and then you can have a banner at the top of the dashboard by default it is just your emacs logo the standard gnu emax logo uh you know with the the bull and the blue and red coloring it's kind of hard to see on a dark background you can also do an alternative logo which is the circle the purple circle with the stylized e for emacs you can also create your own image and that's what i did i created an image i called it emacs dot dash dot ping and then dashboard items i want the 10 most recent files we've edited i want my five my last five agenda items my org agenda items my last five bookmarks the last five projects i was using if we had projectile installed which we didn't install it yet so projects may not even work registers the last five registers that we've saved and now that i've explained a little bit what that does let me do a colon w and now let me do my space hrr command to reload my config space hr and really i should have just closed it and restarted it because we want to see the dashboard so let me close that and then let me i've got a key binding to launch emacs you relaunch it there it is although it didn't display the image and it didn't display the recent files i think the problem was yes complaining about projectile not being installed one of the things i told it to display was our last five projects we don't have any projects and what was find file uh space period i had to remember that let's see if we can actually fix the error here there's two things i could do to fix this error just right off the top of my head if it is the code that was referring to projects in the dashboard i could just delete that code or i could just install projectile which i probably would want to do anyway projectiles another emacs program a common one people install to manage projects and all i'm gonna do i'm not gonna try to configure projectile at all i'm just going to install it so i'll go down here i'm going to try to keep things kind of in alphabetical order i'm just going to paste that that's just a used package block let me zoom in so you guys can see it installing projectile and then turning it on that's all we want to do space hr to reload our config if i did space bb for i buffer let's go back to the dashboard dashboard still looks the same let me kill emacs let's relaunch it all right now emacs is starting to look or the dashboard starting to look right it actually displayed the correct information here in the correct order it did not display my image you know why it can't find the image well i can fix that i think what it was is that image yeah that image was not in the right directory yeah i see you guys left some super chats there give me just a second let me paste that that image there let me close emacs let's verify that my banner for the dashboard works all right there we go i created this in it's just the purple circle with the stylized e i just added the rest of the the emacs name to it just to have a different banner just to verify that you can change it to whatever you want i mean you could put a picture of yourself there a picture of richard stallman there whatever there's the uh the text that we added emacs is more than a text editor my recent files are down here and it says r so if i typed r on the keyboard it'll go for the recent files and i could immediately select one and open it oh again a nice little dashboard kind of like the doom dashboard except is set up differently the doom dashboard they use it mainly to help new doom emacs users know some key bindings they don't really list uh like your last five recent files or anything like that and i like having the recent files in my dashboard so let me get to the super chats here in just a second guys i know i missed some daniel appreciate the super chat he says amazing channel dt i've started using emacs watching your videos as a much more productive and fun thank you i agree it is much more productive and it is fun farson says did you hear that luke smith was permanently banned from youtube any thoughts or comments i haven't heard that he's been permanently banned from youtube because his channel's still there as far as i know of you sure you got the correct information parson if i go into youtube and i do a search for luke smith he's there may be suspended maybe he can't post but if you were banned when they ban you they delete all of your content so he has not been banned all right so i hope that kind of calms you down a little bit let's see farzin luke has announced on his another one from luke has announced on his website that he's been banned from youtube his channel will be deleted soon okay uh i don't know what to say he's not just on youtube though like most of us in the uh tech space linux based free and open source software space and anybody that deals with cryptocurrency most channels like that now they're probably already on odyssey ever everybody everybody that's anybody in in those niches they already have odyssey channel library slash odyssey so you can still watch luke over there i'm sure i know he posts over there one of the the bigger linux channels on odyssey matter of fact while we're taking a break from emacs pull up the browser let's see go to librarynomics see what the the top channels oh can we zoom in i guess not uh let me go to a different workspace then and i have to make this full screen i think whoever created this website did not want us to actually be able to view it a lot going on on this web page though it doesn't want to load now very slow website probably a lot of javascript but i know luke is on here somewhere yeah there's luke he's not luke smith on librarian odyssey he's just uh just at luke and you know the 56th most popular channel on librarian odyssey which is rather good you know there's probably thousands and thousands of channels now on odyssey these days so and you've got other folks on there one duke is on there right here there's the linux gamer where she got me the quartering see who else we know jordan peterson donald j trump now what's he doing on odyssey how would he even know what odyssey is veritasium just to point out a few all right let's get back into the emacs i'm probably i've probably done about all i can do not all i can do but in the time span that we i mean we set up well let's just go over what we set up so we set up the package management and use package set up general general dot el the for our key binding so we can have space as a prefix for certain key bindings we added the dashboard which i'm very happy about the dashboard by the way launch a second instance really like the dashboard set up evil mode of course this is a big thing uh we set our fonts to the fonts i like made sure that we could zoom in and out some minor tweaks to the interface turn off the menu bar the toolbar and the scroll bars we have lines being displayed line numbers being displayed by default now we also have truncated lines by default now install projectile we haven't done anything with it that was mainly just to make sure that the project listings on the dashboard displayed correctly we installed doom dash themes that gives us a nice collection of color schemes to choose from we installed the doom mode line which is our status bar and we installed which key so if i did control w for example it will tell me what the next key binding i could add to control w and the programs it would run which key really really nice program i think that's a good stopping point we got we got pretty far along actually in you know what i wanted to do in an hour and a half and we're pushing an hour and a half that's a pretty good working config like i could push that config to my git lab and i should link it in the show description after the stream is over once i push it so you guys actually want this so you don't have to type it all out yourself i think that's a nice starting point because we really haven't we haven't bloated up anything right it's not bloated in any way we just installed a few basic packages and quite frankly all the packages i installed are probably packages most everybody wants installed anyway like i don't think i installed anything that's questionable like anybody's gonna say no no i don't want it well maybe evil mode like if you really like the emacs key bindings the default mx keybindings maybe you don't want evil mode i think that's kind of crazy but you could do it let's see and forzan said i misread luke's website he's on strike two which means he's close yeah if you get three strikes within 90 days they delete your channel yeah you're banned and they delete all your content typically when they strike your channel though i've never had a strike i had a strike one time it was a false strike that they uh reversed it it had something to do with me hitting the wrong button streaming one time in obs years ago like my very first live stream i got a 90-day strike from being able to live stream which i appealed it and it was actually overturned they just like yeah we shouldn't have our algorithms shouldn't have caught that you did nothing wrong but typically when you really do something wrong and they strike your channel they also prevent you from posting new content you know they'll give you like a couple of weeks where you can't post content for two weeks usually if you did something wrong on a live stream you can't live stream for like a month or two so the people that get three strikes within 90 days i do wonder about because whatever it was you were doing to get the first strike why the hell did you do it two more times especially when they're trying to prevent you from even posting content you know that makes it that much harder for you to get those extra strikes but ultimately you know youtube it's it's their game they're running the show and they can strike you for any reason and it doesn't have to be a legitimate reason and you can appeal it they they won't hear your appeal most of the time so that's one of the things if you actually enjoy being on youtube you do have to try to appease the youtube gods right you can't you can't quit you can't can't constantly be trying to give youtube the finger on camera in every video and then one day get banned from youtube and then complain about it especially the really hot take channels you know the political ones and the guys that are really flamethrowers everything they say is just crazy and then they get their channels banned and well youtube's just canceling me they're censoring me they're against free speech yeah whatever you want free speech go set up your own uh video platform or you know what try out library odyssey that's it's a little harder to get cancelled on a platform like odyssey you'd have to do something just crazy dumb on odyssey but the problem with youtube as opposed to a site like odyssey youtube depends on ad revenue they depend on businesses large corporations that pay youtube money to run ads on your videos the content creator if the advertisers don't like certain content creators they don't want to be associated with their videos that costs youtube money it's in youtube's best interest to get rid of those channels odyssey there's no ad network on odyssey odyssey doesn't care right if you put out crazy content on odyssey it does not cost odyssey a dime so it's in no way in their best interest to go and delete channels off of the platform because you're not hurting them anyway all right xmo nad tutorial please uh we've done plenty of those we'll do some more x mode and add stuff soon yeah doom e-max is a bunch of add-ons and command line utilities on top of gnu e-max yeah now the doom e-max guys they write so many like custom modules specifically for doomy max and custom functions that the way do me max does things is nice like like package management and doomy max is so much better than all the stuff that we did in this thing with used package and you know we got all these used package statements all over this document you don't have to do that and do me max there's a specific file eo you just list everything you want installed in doom x boom it installs it for you you got to do a doom build or a doom sink and you know they all get compiled another super chat from antonio hi dt love your videos what's your favorite terminal simulator you probably are wanting a terminal emulator these days i would say alacrity been using alacrity since i made that very first video about alacrity what year year and a half ago it's just fast everything displays right in it and just looks good now if and when i ever create dts os dt's os is going to be revolving around xmo nad as a window manager and emacs as our text editor emacs will also be the default terminal emulator actually the default shell in dtos because what we'll do is we'll have the e shell or our default shell inside dtos we didn't configure the e shell in any way here actually the e shell is not even installed is it or is it there it is we can get to it with meta x e shell this is the e shell with an e max a lot of the basic gnu core utils have been rewritten in e-lisp why why not why wouldn't you run a meme text editor like emacs and then run your meme terminal emulator with a meme shield the e-show written in a meme programming language emacs lisp is perfect throw all that into a meme window manager x monad written in a meme programming language haskell i can't lose right dt's os is going to be a monster success one of these days we'll get around to it what do you guys think would you be interested in a linux distribution that was essentially xmo.net with emacs and not much else everything is in emacs your default file manager is dirad within emacs the empty set says that'd be rms os not dt os touche yeah the v term inside emacs yeah we i had a section of code that i wanted to add to our config to actually go ahead and configure the e shield and to configure v term fish the fish shield within the term but we just didn't get around to that on camera today because quite frankly i was trying to go in what i thought was order of most importance so unfortunately we didn't get to all that stuff maybe we'll do that on another video on a future video i don't know it's probably enough emacs though for you guys for a little while yeah rubix thanks for the super chat exwm is the best window manager changed my mind exwm is okay and i do sometimes log into it and play around with it the problem with exwm for somebody like me that does a lot of cpu intensive work on my computer you know rendering video and things like that compiling software sometimes is that emacs is single threaded so exwm is single threaded so that you you can have some slowness using exwms things sometimes slow down and sometimes things crash and if emacs crashes and emacs is your window manager that's a problem you lose everything you were working on essentially so that's why i don't use exwm it's fine for most users but if you're doing a lot of resource intensive stuff on your computer you'd do better using a proper window manager at least until emacs finally has multi-threading i don't know when or if they'll ever get around to that people have been complaining about it for years though yeah x-monad is wonderful i agree justin dtos open box demian testing no if if i was going to do dt os it's it x monad would probably be the window manager the only other one that i'd feel really confident writing and putting out to you guys is q-tile and because q-tile and x-monad are so similar i could actually put both on the system and theme them and do the key bindings the exact same way most people wouldn't know whether they were in x-monette or q-tile except you know in my configs i think you know my in x-monad and x-mobile we have the haskell logo in qtil on qtiles panel i think i put the python logo you know on my panel just to keep them straight so when people see them on camera nobody ever has to ask me hey what window manager you are in you know the python logo gives you that hint all right guys it's been an hour and a half let me get out of here i want to keep this video to a manageable link so hopefully it gets synced over to odyssey i do appreciate you guys hanging out with me and sometime after the stream ends uh i don't know 15 minutes half an hour i will try to get this config posted somewhere and i will link to it in the show description before i go though let me thank a few people let me thank the producers of this episode absolutely blue mitchell allen and comey archbishop 30. david david dylan gregory paul scott steven whitson willie there's no way i'm going through this list of names but all these guys do i want to thank each and every one of those guys thank you guys for hanging out in the youtube chat all right peace i think i had one too many beers you
Info
Channel: DistroTube
Views: 20,534
Rating: 4.9412842 out of 5
Keywords:
Id: hoP4I9ounyQ
Channel Id: undefined
Length: 93min 40sec (5620 seconds)
Published: Thu Apr 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.