Check out a free preview of the full VIM Fundamentals course

The "Wrapping Up" Lesson is part of the full, VIM Fundamentals course featured in this preview video. Here's what you'd learn in this lesson:

ThePrimeagen wraps up the course by answering student questions regarding different commands for plug, getting an editor going on a new system, personal workflow set up, and the benefits of vim over emacs.

Preview
Close

Transcript from the "Wrapping Up" Lesson

[00:00:00]
>> Hopefully, this feels aspiring, this feels like wow, that workflow looked and felt fast. And hopefully I gave you that same feeling there for just a moment of what a fast editing experience looks like, because I just did a whole bunch of stuff. And I technically didn't practice that and so except for the merge conflict, that's the only thing I knew.

[00:00:19]
And so it all worked out. Hey, it all worked out. This probably even works. I'm sure if I just resourced it, everything will just work first try, but we won't do that now. All right, I think that's about it. I think that's the end of the Vim fundamentals.

[00:00:33]
Plug clean, yeah, plug clean, just simply, you want me to explain? Let's see is there are any other commands for a plug? There are commands for the plug but even some plugins have their own defined commands. If you look up conqueror of completion, it actually has a bunch of stuff that it does, but if you're talking about plug the vim plug, plug in, it has a few other ones, but I honestly only ever used plug install and plug clean.

[00:00:55]
How plug clean works, is you remember, inside, here let me close, pen control. If you remember inside of here, all of these plugins, whatever is inside of here, by the way, I mean you might have noticed right away look, Python, auto formatting for Python, right? Everything's already available.

[00:01:11]
So anything that appears between here if I delete any of them, and then this is what happens between these two, what's gonna happen? It's gonna go hey, this is missing from your plugin list, do you wanna delete it, right? And so that's what plug clean does. Plug install just simply after this thing has been executed, it will attempt to see which one of your directories don't match the plug install.

[00:01:33]
And that's all it does. It's actually pretty straightforward. That's fine hey, thank you. Hopefully got it, hopefully let's see quite late here, but thanks yeah, no problem. Hopefully it was, if you're late, that's probably good because a lot of the beginning stuff, I think. If you're from the stream, which it sounds like, then you probably at least have some vague familiarity.

[00:01:51]
>> So two questions.
>> Yeah.
>> One is that, when you use an LSP, you add extra dependencies outside of them. I know you just bootstrapped your laptop with getting it back up to speed and everything. What are some patterns that you found for success of getting your editor up and going on a new system?

[00:02:08]
>> Well, I have, so there's a couple of things there. First, there's like the new system itself. I'm gonna explore doing Git bare repos and the .config folder, right? So that way my XDG config home or whatever it is, I can actually like, just clone right into. And not even symlink you can clone I believe Git bare repos.

[00:02:30]
I have to go file there's an Atlassian, I know I hate Atlassian, everyone hates Atlassian because of JIRA, right? We all unfortunately use a company that created JIRA. But they have a walkthrough on how to do these bare repos for being able to do better .file management. And so I'm still working on that.

[00:02:45]
So that's like the bootstrapping of a computer, but the Vim stuff, I have all of my Vim stuff, all nicely placed. So if you'll notice that I actually have it quite a bit different, I have a bunch of these extra files, here's all my mappings for harpoon, right?

[00:02:59]
I have them all kind of by filed. And what that effectively does, it allows it and I take advantage of what is called Vims runtime path. I didn't go over that, but Vim has a runtime path just like your computer has a runtime path, right? So if you try to execute say, nil, then it looks on your computer's path to find it, it goes in order until it finds the first one.

[00:03:15]
Vim does effectively the same thing. At the boot it has a series of runtime paths it looks forward till it finds its RC. Once it finds its RC, you can add in more runtime paths or you can have specific folders In specific locations that will get automatically sourced, and that's what I do.

[00:03:33]
So I take every one of these and put them into my right now I'm simlinking into my config. So I have this plugin folder. So inside of config and Vim, a init.vim. If you have in the same folder, a plugin folder, it will automatically source every one of those Vim scripts for you.

[00:03:53]
Lua does not get automatically sourced. But if you have a Lua folder, it will put that into the runtime lookup for Lua. So I have notes that I do require the primeagen, it will actually look in all Lua folders for a folder called the primeagen or a script called the primeagen.lua, and then if there's an init.lua, it'll automatically execute that.

[00:04:12]
So I have everything commented out right now, but I can actually set up all of my harpoon to be able to be all Lua driven, because it's a Lua plugin, right? So this is gonna be me slowly moving my setup into Lua. And that's kinda how I do it, I have my own repo, clone it down symlink it in right now into the my .config, and then when I open up vim, it just works.

[00:04:32]
I currently make Neovim, so we do this Neovim bragging to see who has the latest version of Neovim. It's gonna be pretty embarrassing if I do this but Neovim, my goodness, git pull origin master git checked git fetch, right? Git fetch gosh this gonna be so embarrassing git checkout master no.

[00:04:54]
No, I'm 51 commits behind this is just a travesty on the Internet. I'm 51 commits behind the git checkout origin master and then I just literally I just make and then sudo make install, right? And I just use vim the most bleeding edge of Neovim just because it has all the sweet functions.

[00:05:15]
I can't do sudo make install because you're gonna see all my sweet pass codes but yeah. And so it's just fun to be on the latest for me because it has all those really nice API's. Like nvim buff is valid is in the 5x branch with the bleeding edge branch you can't get it by doing a brew install.

[00:05:30]
And so I'm always living on the edge. It's been really, really good. I've actually really enjoyed using the latest and that's effectively my workflow setup, is something super simple as that, just symlinking and going though I am considering something different. So what's the benefit to Vim over Emacs?

[00:05:48]
Is it purely preference? Effectively, I'd say more and more at this point it becomes more and more purely preference. Just because Vim or Emacs has an Evil mode, which is Vim mode. If I don't know how one to one it is because I haven't used Emacs in depth enough to know if it is one to one with Vim.

[00:06:05]
But vim has its own eccentric ways of doing things such as quick fix list and if you use Emacs with the default key bindings you're gonna get carpal tunnel in like five years. Those things are terrifying but nonetheless, besides for that, if you all only use Vim, really, you just have a different set of plugins, right?

[00:06:23]
They even now have apparently a magit for Vim, so you can get the Emacs, Git library now on Vim. So, we'll see.
>> [APPLAUSE]
>> Bye.
>> [APPLAUSE]
>> Appreciate it.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now