Vim Versus Emacs. Which Is Better?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
having been using Emacs for about three months or so now one question keeps coming up again and again from viewers of the channel and they keep asking me which one is better vim or Emacs well that's a tricky topic but I think it's one we should go ahead and try to tackle today I think the first thing we need to talk about is the fact that vim and Emacs are not really the same thing Gilman Emacs are two totally different kinds of programs it's really comparing apples to oranges when people try to compare them to Emacs veeam is a text editor and it's a damn good text editor it's a great text editor Emacs is really a programming platform or a development environment right it just happens to ship also with a text editor but it's not really a text editor Emacs is much much more than just a text editor let's talk a little bit of history first about these two text editors how they got started them was first released back in 1991 so it's been around for a long time but VM is actually a direct descendant of a much older text editor called VI VI was first released back in I think the mid 1970s around 1976 a man named Bill joy created VI for the old UNIX operating system films creator is a man named Bram Mullen or again he released him initially back in 1991 and film stands for VI improved that's how young got its name it's basically a better version of VI and of course Beyond is free and open source software it's licensed under a free license is actually a charity where license because the creator of doom encourages the users of that text editor to consider donating to children in Uganda viim is intended to be a fast readily available extremely versatile text editor that comes pre-installed on pretty much every unix-based operating system on the planet including most of your Linux distributions and because it's available on pretty much every Linux distribution out of the box it really pays off to know the basics of them what you are going to be a film user or not you need to know some of the fundamentals of using them if you work with Linux BSD Mac OS these unix-based operating systems a lot it's a really good idea to have a working knowledge of them now Emacs has been around also since the mid 70s around 1976 Emacs stands for editor macros that is what Emacs stands for the version of Emacs most people are familiar with is of course good GNU Emacs which was created by none other than Richard Stallman himself who is the founder of the new project and the free software movement just like them Emacs runs basically on every operating system known to man you can install Emacs on Linux and BSD and Mac and Windows however because Emacs is a rather large piece of software it usually doesn't come pre-installed so on your Linux distros while almost every Linux distribution all of them shipped with VI most of them shipped with them very very few Linux distributions ship with Emacs already installed out of the box so don't expect Emacs just to be on every machine so if your Emacs guy again might be a good idea to know a little vim because film will always be there so already we get into some of the reasons why you might choose memo for Emacs MEMS already pre-installed Emacs is a large program some might say Emacs is bloated but don't jump to that conclusion too quickly you know I like to rail against bloated programs a lot but you got to understand something here Emacs has bloated I guess if you're comparing it to other text editors but remember Emacs is not a text editor the reason Emacs is large really has everything to do with the fact that it's much closer to a operating system than a text editor so Emacs it features a turing-complete programming language Emacs Lisp a lisp which really makes it possible to customize and extending Mac's in ways that really like mentally you would have trouble comprehending everything you could do with Emacs it's that powerful so emacs's is not just a text it's really a Lisp interpreter it's also a shill actually it's multiple shells or inside Emacs by default it's a browser it's a git client it's an email client heck the other day I came across a video editor plugin for Emacs can you imagine that you can actually edit video within Emacs obviously these are things that you normally wouldn't couldn't dream of doing it something like vim hence the difference in size I think one thing we should do is kind of compare similar workflows in Emacs and BIM now that I've used both quite a bit and you know you can do pretty much the same things in VMs and Emacs and vice versa but there are little differences why don't I switch over to my desktop here and you know what I'm gonna do I'm gonna go ahead and open up something I'm gonna open up my X monad config here in Emacs so this is my X monad HS file here and you know what let me go ahead and open a terminal and I will do the same thing in film here so let me open up my X monad HS in vim now we could talk about text editing but honestly text editing on them and on Emacs or pretty much the same thing the one thing I will say where film really shines compared to Emacs the keybindings the default key bindings for Emacs are terrible and they're actually dangerous because they're really tough on your hands the the constantly stretching of the pinky to hit ctrl + Alt + escape the fact that the key bindings are a little more complicated they're typically two key bindings not just one key binding they're really key chords in Emacs for the default good GNU Emacs so I think what most people do and what I eventually did I spent about a month learning the default Canoe Emacs key bindings but eventually I switched over to evil mode which basically turns Emacs into them it uses all the Vilma key bindings it uses the Ville modes you know normal mode insert mode visual mode once you switch over to using the VM key bindings in Emacs text editing on VM and text Emax is pretty much the same thing so I won't discuss that but where things get a little tricky is when you get outside of the text editor because that's where Emacs is you know a completely different beast than him for example let's talk about there are file managers within these particular text editors Emacs has a built-in file manager called dear Edie di re D which stands for directory editor so here my version of Emacs by the way is a distribution of Emacs called doom Emacs and to get to dear Edie I can either space period or space space either one works and you know I get this little file manager here inside Emacs and I can search for something whatever it is I want to search for if I want to search for my bash or C I can search for it and hit enter and it'll open it here in Emacs or if I wanted to just open a directory I could just hit enter on a directory path and I get the file manager dear Edie here in Emacs and you know I could search through of the directory editor here vim has a built in file manager as we'll and to get to it you need to do command mode so colon and then you need to type explorer e capital e explorer and hit enter and it opens the directory that you're currently in so I was in my X monad directory because I was editing my X monad config but it's very similar to dear ed over in Emacs you can navigate the directory structure you can search so if I you know hit a slash symbol I can search for something maybe I want to know CD into my wallpapers directory or maybe I just want to get back into the X monad directory which I probably should go back into and go back to the file that I was in so you do have built in file managers in both Emacs do me max especially since that's the one I'm running and in view now although you do have built in file managers in both Emacs and them a lot of people in both Emacs and VM also install third-party file managers if you will one very popular one in vim is called nerd tree and I have it installed in minus one a few plugins I have in my gym config I don't heavily edit really anything you know I don't add a ton of plugins and either Gilmore Emacs but I do a dinner tree in film and I have that set to control in and this opens nerd tree in veeam now in Emacs you have various nerd tree like plugins one of them is called neo tree and I had that installed here in Doom Emacs actually its installed and do me max out of the box so if I do space o P and it opens neo tree here inside do me max they function very similarly you navigate the directory structure you know you can get into directories sub directories and finally open the document that you want to work with let me close the Neo tree and the nerd tree so and do me max to close a frame space WC for space window close and boom you could do ctrl W see again for window close let me show you one deep trick that do me max has I discovered the other day which I thought was really neat that you really don't have built into them so you see the first three lines actually the first six lines of this config are really just comments you know high school documents comments begin with the dash symbols the two dashes or sometimes several dashes if I want to create line breaks and what if I want to uncomment these lines well in Emacs you can uncomment a line here and do me max anyway the key binding is GCC so if I do G CC it uncomment that first line you see that now if I did GCC again it would come in it back out how cool is that and of course you could you know give this a number of lines to uncomment or comment so if I did three GCC you know in comments those three lines you for undo of course or I could do how about six GCC you see how cool that was it uncommented the next lines and it removed the entire line of dashes that was here plus the three dashes that was in front of imports that's really cool because it figures out how many - or in the comments you know so it can be a variable amount of dashes that are commenting the lines and Emacs is smart enough to get rid of them now in vim I know of no way just to hit a key binding to comment a line or uncomment now because VM is extensible you could script it in such a way that it could have some kind of functionality like that that's beyond my abilities but I'm there's probably people that have worked something like that out but in them typically what you would do the easiest way to income yet or to come in a bunch of lines is to simply get into visual mode so you know if you did a ctrl V to get into visual block mode and then you could just go over a couple of lines and then start going down and then you could D and you could delete everything but the problem is you see I'm still left with the one random dash here it's because it visual block mode it's not going you know you're it's gonna take away the same amount of hyphens or dashes you know it's not gonna handle a variable amount of them the way that Emacs command was and there are some things I think do me max gets better than them for example say I want to open up a recently viewed file I'm going to open up some recent document that I've played with you know in the past couple of days well in doom Emacs to view your recent files all you need to do is space fr and here's my recent fall so I could go and open anything and bother opening anything this is a little clunkier in vim so to view some recent files and film you could do something like : and then browse old files hit enter and you get a list of the last hundred files that you've played with and you actually have to scroll to the bottom of the document and eventually you'll get to one hundred once you're at a hundred hit enter one more time it asks you which number of the document do you actually want to edit and just looking through some of these I see number 77 as my I three config so if I get 77 you know it would open up my I three config with that that's certainly a little more clunky a little more TD is then what do me max offers as far as just quickly opening up a recent file now getting into some more general workflow stuff I'm gonna send my film document to a different workspace just so we have the whole screen taken up by Emacs for second let's talk about some of the integration with all the other tools because that's really what we're talking about when we're talking about Emacs let's talk about get integration and Emacs has a built-in git client called maggot ma GI T and it is a really really cool program a really powerful program so basically just to show you a very easy example of me using maggot gonna space space to get back into D read the directory editor and I'm gonna travel to my wallpapers directory and get into that and then I'm gonna alt X and I'm gonna go ahead and launch maggot and by the way there is a keyboard shortcut to launch maggot inside do me max you can just simply type space GG and then you don't have to worry about alt X and then typing maggot your space GG launches maggot and since I have the doom Emacs the evil mode key bindings J and K to go up and down if I find something maybe that I want to stage here I hit s for stage and I just staged wallpapers number 275 and 276 and then for a commit or maybe I don't know that the key bindings maybe I could type H for help and you can see there is a ton of stuff you can do and get pretty much every command you can imagine as far as a get command and I'm not a get master so I would probably need to get help you know help documentation on some of this but for what I'm doing right now I just want to do a simple commit so I think just typing C and then C again we get a commit we need to type a commit message I'm just gonna type adding new wallpapers I'm gonna do P to push and where do we want to push it to we're gonna do origin/master hit you it's gonna ask me a force for my get lab username and then my get lab password hit enter and it says it's finished if I open a browser I'm sure we'd see that those walls purrs were pushed to my git lab now switching back over to the workspace that I had them open on obviously mom's not gonna have a built-in get client there may be some plugins out there I think there are some maggot-like plugins for them but again you got to go add them you're gonna have to configure them they're not built in the way that maggot was just built into standard Emacs Canoe Emacs or to my distribution do me max so if I want to you know I want to push something to my get lab you know I actually have to open up a terminal and you know if I wanted to well I could do a quick one here I could do a config which is alias for my dot files and add space - you and I do it config check out let's see these are some of the files I have edited recently I could do a config commit - um for message I'm just gonna say minor edits and then of course we need to push it and same thing we got to do it username password and so you know I don't use git all the time I mean I push things every day every other day but it's not like I use get all the time so it's maggot it's not something that is a real deciding factor in whether I use Emacs over Veeam vice-versa the workflow is pretty much the same whether I pull up maggot and do a quick push or just pull up a terminal and do a quick push it's the same for me but again I am NOT a programmer by trade I am NOT a developer those of you that are professional software developers I can tell you you're gonna love maggot that may be the killer feature that makes you use something like Emacs over him and really that's kind of the big difference between the workflow if you're a bemused and if you're Emacs user is you know if you're using film here and you know you're gonna have to use other programs to do things like but integrate with git or check your email or play games or whatever it is you want to do where Emacs of course has all that stuff built in for example if I'm a young user can't use you know a built-in email client and you know there may be some plugins available I don't know but I'm probably gonna have to use a terminal based email client like Neo mutt let's see I haven't actually used neo mud in a while on my system but it is still here and if I switch over to Emacs I don't have to open a terminal and use a separate program to check my email because I can just check my email right here inside Emacs with mu for e and check my latest emails here right here in Emacs and if I wanted to get back to the buffer I was working in which was my X monad HS I just knew space be B and get back to my X monad config and having played with Neo mutt a lot over the years and then just playing with mu for e for the last couple of months as a Emacs user account whether new Emacs user I can tell you mu for e is a nicer email client the Neo mutt it's easier to config it looks better feels better it doesn't tend to crash on you all the time you can have some weird things go on in Neo mutt where really the tools that are built into Emacs are typically better than those terminal based applications that you typically use if you're a film user just to throw out a another example here go back to the screen with me I'm on it you're a VM user you're probably gonna use H if you need a terminal based a web browser you know you guys know I love links ly NX it's the oldest active web browser still in existence and lynx is great because it also has support for the Gopher protocol as well as your standard HTTP protocol I open a terminal here and I type links will do HTTP colon slash slash distro tube comm and hit enter this is my website here inside the links browser and I have a film Keys integrated so I can J&K to go up and down there are no images and links and I like that links also doesn't try to do any kind of formatting to try to format it like columns and everything kind of like it would look in a proper web browser it is very much text oriented and that's why I really like links I think it's a it's a fantastic terminal based web browser now and that being said if I get back to Emacs here you has a built-in browser and it's called a WWF or I think Emacs web something i don't know ii w w hit enter and then I go to distro tube comm once again this is distro tube comm and II W W let's make it a little bigger here and you know this is it does have images but you can toggle the images on and off actually so I can get rid of the images if I don't want them I probably would most of the time because usually if I'm just looking for something you know inside a terminal or inside Emacs in this case I probably don't need all the images but anyway it's a built in browser and it looks good it really does and it I played a little bit with aaww I think it is perfectly okay as an alternative to things like links and w3m and you know those other terminal based web browsers that people use let me space WC to close that just speaking of terminals in general I don't actually have to open up a you know a terminal if I'm using Emacs the way I often have to do with VM now you can run commands in both you could just run a terminal a shell command in Veeam while you're running them or run a shell command in Emacs but sometimes you want to bring up a proper terminal well in Emacs what you can do is you can alt X and then you can load one of the three or four built-in shells that are actually inside at least do me max now I added one called V term because it's really nice it looks and feels like any other terminal obviously LS works let me CD into the home directory LS you know what clear the screen I'm gonna list and I have this document in my home directory called emoji test let me hit enter and this document is full of emojis they don't actually display properly here duh this is because I didn't toggle on emoji mode let me talk Alon emoji Phi dash mode and hit enter I have emojis inside Emacs how cool is that for those of you that for some reason emoji support is a big thing it's like a deal-breaker for some people I don't understand why you need emojis in a terminal or in text editor or in Emacs but for those of you that want it Emacs handles emojis great let me close my Emacs here and I'm gonna launch a terminal this is my alacrity terminal now some of you guys to switch to Emacs for your development environment sometimes you're gonna want to open something in Emacs and not Emacs the editor may be all you want is d rid the file manager in Emacs or one of the various shells in Emacs like the ISIL or V term maybe you just want to open up aaww the browser or EMM s which is the multimedia player your audio player inside Emacs I should show you guys that too but I can run a command like this Emacs client and then give it the C and E flags and then you know in single quotes and in parenthesis V term and then in the line with a ampere sign and hit enter and it will launch V term in Emacs again it says the V term shell here the one that I was just in a minute ago if I do my standard tiling window manager key binding to close a window it's gonna ask me do I really want to close this buffer because it's a Emacs buffer that's the only problem you see if you wanted to do something like that for your default terminal is closing it you're always gonna be asked you know do you really want to close it now of course you can configure it to never ask you those safety questions but I'm not sure if you really want to run one of the Emacs shells as your default terminal but if you wanted to it's possible let me change V term let's see if we can launch EMS which is the audio player inside Emacs it just gave us the welcome screen let me just go ahead I have to choose a directory for some music to play as part of the problem so let me figure out what we want to load and then I could start playing something here inside EMS here inside Emacs if I wanted to play some music [Music] and the track is playing just fine me all decks and then EMM s space - stop of course I could keep buying that - something it may already be a key binding I just don't happen to know it offhand this was just showing you some of what you can do with both VM and Emacs of it again there's you can pretty much do whatever it is you can imagine and both of em and Emacs are so extensible they're really the only text editors that make sense if you do a lot in a text editor if you're a programmer or a developer you do any kind of serious writing actually you deserve to actually take a look at via minimax those those text editors are so powerful now getting back to the editor wars right which one's better people are always gonna ask you which one's better and since I've used both people are asking me which one's better I don't know that's like asking me what's the best distro what's the best car or what you know having used both I can use both I'm comfortable with both and I like both but let's talk about the differences again film I think film is a little more straightforward and easier to learn initially then Emacs I think Jim is definitely the best text editor out of the box especially them just blows away standard give me Emacs as a text editor now once you get evil mode installed and you know get your film key bindings and male modes in Emacs it's a lot better but film is definitely the better text editor and I think it's easier to learn Emacs though it's much more powerful and probably far more extensible than even film the fact that if you're willing to learn a little a lisp you can do anything inside of Emacs you can create plugins for anything inside of Emacs and another thing we should talk about is Emacs is actually a GUI program this is not Emacs and a terminal this is a GUI that's why you had images and that web browser aaww when I launched it in Emacs that's why the emoji support is so fantastic is this is a GUI where VM has to run in a terminal so whether you get the emoji support in film is not dependent on him because vom has to run in a terminal the emojis support is dependent on whether the terminal that you're running them Yin has emoji support so that is a real plus actually for Emacs is the fact that it is a GUI program one of the things I've noticed though the difference between Jim and Emacs users is there's a fundamental difference when somebody says I'm a VM user what they say is I almost always use them as my text editor that's basically all they're talking about they're talking about for a text editor I use vim if I'm a gym user it's completely different when somebody says I'm an Emacs user because they're not talking about hey I do all my text editing inside Emacs that's not what they mean they mean literally they do everything inside of Emacs a Emacs user it's not talking about text editing when somebody says I use Emacs they they're talking about I use the D read file manager I use the e shell inside Emacs I use maggot I use org-mode I use the web browser inside Emacs they live inside Emacs and again I think that's why you're comparing apples to oranges when people could try to compare them and Emacs it's two completely different things now if the Emacs way of doing things you know really resonates with you then I strongly suggest you give it a try and if you want a nice pre-configured Emacs out of the box obviously take a look at do me max I've done a couple of videos on do me max here recently now if you are one of those people that adhere to the UNIX philosophy do one thing do one thing will then obviously Emacs which tries to be a complete operating system unto itself that's not the UNIX philosophy you probably want to be a film user because VM is just a text editor if you want to email client you go install an email client you want to browser you go install a web browser you don't live inside them so again it's what kind of person are you I'll be honest I'm more of the UNIX philosophy kind of person you know I that's probably why I gravitated toward film initially but the more I play with Emacs the more I underst and what Emax is trying to accomplish I got to admit the more I like it and if what you're really after is control and customization then I think the path that Emacs has laid out is the one a lot of you guys probably want to be traveling on so if you're one of those people like my vim RC is very simple I don't have a million plug yeah I have you know maybe 810 plugins and it's not a very customized VMRC I'm not one of those people they'd sit around and play with my config files all the time typically I get something and however it works out of the box if I can make it work I stick with it and I try to edit as little as possible this force my configs but a lot of you guys I've seen your vim Marcis if you have 50 plus them plugins in your VMRC if your VM RC is 2,000 lines I've seen some of those memoir seeds out there then you know what maybe you guys are the ones that actually should consider Emacs because if you're constantly editing that VMRC and tinkering with things and trying to learn mm scrip and trying to create your own plugins I think you owe it to yourself to really take a look at Emacs now before I go I need to think a few people this episode was made possible by Chris DJ Donny Dylan George Kaplan 8-core Bennion lamda Michael Mitchell Rob Sean Stallman and Willie these guys they're the producers of the show without these guys this episode about VM and Emacs it wouldn't have been possible shows also brought to you by all these other names you're seeing on the screen right now these guys they help support my work over on patreon sincere thank you to all these guys without these guys this channel wouldn't be possible you'd like to support the channel consider doing so you'll find me at distro tube over on patreon alright guys peace you you
Info
Channel: DistroTube
Views: 172,746
Rating: 4.8911009 out of 5
Keywords: emacs (software), software development, text editor, emacs tutorial, vi (software), text editor vs ide, vim (software), vim versus emacs, vi versus emacs, doom emacs, emacs magit, emacs eww, emacs mu4e, emacs emms, vim plugins, emacs plugins, extensible text editor, linux text editor, windows text editor, mac text editor
Id: VaBdlcYaZLQ
Channel Id: undefined
Length: 30min 37sec (1837 seconds)
Published: Fri Feb 07 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.