---
title: "Installing Plugins (Vim plug + Airline)"
url: "https://courses.osherove.com/courses/vim-hates-you/installing-plugins-vim-plug-airline.md"
canonical: "https://courses.osherove.com/courses/vim-hates-you/installing-plugins-vim-plug-airline/"
tags: []
author: "Roy Osherove"
description: "Lesson 16 of 26 in Vim Hates You (Bring in reinforcements - Plugins), 8:57. Free video by Roy Osherove."
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Installing Plugins (Vim plug + Airline)

1. [Courses](https://courses.osherove.com/#courses)
2. [Vim Hates You](https://courses.osherove.com/courses/vim-hates-you/)
3. Bring in reinforcements - Plugins

Lesson 16 of 26

Duration: 8:57 [Watch on YouTube](https://www.youtube.com/watch?v=YUKb-4Ekkps)

## In this lesson

Roy points to vimawesome.com for the most used plugins and installs the vim-plug plugin manager by running the curl command from its GitHub page, then declares plugins between its two lines in the vimrc file. He adds Vim Airline and its themes, fixes the word Plugin to Plug, runs PlugInstall, sets laststatus to 2 so that airline is always visible, and picks an airline theme. He also adds comments to the vimrc, which start with a double quote.

## Transcript

1,318 words

[\[00:09\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=9s) There are many types of plugins that are available for Vim and those plugins really provide a lot of the usefulness that you'll see other people using in screencasts and online is that they usually have a bunch of plugins installed and some of those plugins might be as very wellknown like the NERDTree or surround vim Actually, there's a great site called vimawesome.com where you can really see the list of the most used plugins. I'm going to show a couple of them. But in this specific session, I'm going to show some one that really provides a very visual way to know that you have a new plug-in installed.

[\[00:48\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=48s) It's called Vim Airline, which basically gives you a status or tab line for Vim and shows where what's the current active line or column, etc. And technically, you could create your own plugins using Vimscript and sometimes Python, but I'm going to show how to be productive and really get plugins installed and running as quickly as possible. So, the first thing you'll need is a plug-in manager for Vim. Technically, you could install these manually, but plug-in managers exist and they solve the problem in a very, very easy and simple way.

[\[01:20\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=80s) And one such plugin is called Vim Plug. And it's a very simple, downto-earth plug-in manager. The way you install it, basically you go to the GitHub repository. It has the instructions there. It even has like a GIF that shows how to use it. And you basically just run the curl command here, which will install it directly from the source control in GitHub onto the vim/.vim/autoload hotfam/autoload folder, which is usually where the plugins that get autoloaded are running.

[\[01:54\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=114s) So, we're going to take this command and literally just paste it into our command line which basically just install the plugin. Now, the next thing we need to do is to configure the plugin. And there's a configuration instructions right here. But basically you go to your vimrc and then you add this line at the beginning and then this line right after. And any line in the middle is basically you declaring that you would like a plugin to be installed.

[\[02:27\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=147s) And once you have this you go to Vim after it's running and you call the command PlugInstall which installs a plugin. So let me just really quickly just copy this file. We're going to remove most of it. Let's see. We're just going to take this one. This command and I'm going to do a vim vimrc edit. And right now what we're going to do, I'm just going to say

[\[02:58\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=178s) Paste the fault the first line and take the last one and paste the last one here. And in between them, I pressed shift O to go one line above. I am just going to choose one. And I I really had a a dilemma which plugin to install first to show you kind of what it's like. So the plugin I chose is called Vim Airline.

[\[03:30\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=210s) And the nice thing about it's very visual. It gives a lot of cool features at the beginning. And it's a good way to kind of start looking at how to kind of pimp your Vim in a way. So how do I install Vim airline? Basically, I I just put the vim-airline command here. Now, notice this command is for a different plug plug-in manager. But we're just going to use the word plug instead of plugin. That's the only difference.

[\[04:01\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=241s) And it also has two plugins. There's a plugin, the Vim airline, and then it actually has the themes where you can install different themes and how it looks the the command bar. So, let me just copy these two lines and go to my vimrc. Press O to enter a new line and paste. I'm going to delete this line because it's empty. I'm going to press DD to delete the whole line. DD. I'm going to add a new line right after to make things a bit easier to read.

[\[04:32\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=272s) And a new line just above with shift O and escape. And I'm going to take these two lines. I'm going to indent them. So I'm going to shift V to select line and then down to select both lines and shift bigger than to move them and indent them a little bit. Now press escape to move out of selection mode and I'm going to do command right quit and I'm going to close Vim and reopen it.

[\[05:04\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=304s) Oops. Now there seems to be an issue. We forgot to change the word plugin into plug. So I'm going to press X to delete one character. X and another X to delete the other. I went down and then XX. Notice I'm not even in insert mode. Just like a surgical precision. And again I'm going to escape command right quit. Try to load vimrc again. Now I don't have an issue. Now the plug-in is not yet installed. To install it, I run a command colon

[\[05:36\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=336s) PlugInstall. Now I just I'm going to press tab and I'm going to and you see that it autocompletes. That how I know it's actually running. I'm going to press enter. What you'll see is there's a new window in Vim that opens on the left and it shows me the status of installing two plugins. Now they're installed. But if I want to actually run them, I can command write quit. Oops. Now it doesn't let me write cuz this window is kind of read only.

[\[06:07\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=367s) So I'm just going to quit all. QA quit all. And if I load up these plugins again, doesn't look like there's a bunch of difference. But watch what happens if I try to split to a vertical window. For example, commandV split. Now you see that there is a command line here at the bottom which shows me a bunch of stuff. But let's say I want to always set that command line to to be visible, not just when I split stuff.

[\[06:39\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=399s) Let me just go back to one single window. So I can I'm going to type command only. So only the current window is going to be visible. And I'm going to edit this vimrc file. And I'm going to say set laststatus equals 2, which is the way things are working by default to get the tab always visible. That's what the plug-in needs to hear. By default, it's set to non-visible. Escape. Command right quit.

[\[07:10\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=430s) Now, if I open Vimrc, I can see that it's always on. Let's say we want to change the theme. I can actually do a command airline theme. And then if I press tab again, I can see there's a bunch of themes already for airline. So for example, let's use bispin.

[\[07:41\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=461s) Okay. So it kind of changes the colors etc. And you can see now that if I move I can see the columns here on the on the right where I am what's the percentage of in the file that I'm in etc etc. If I want I can start putting some comments above and below stuff to make the vimrc file a bit more readable. So shift o to start insert mode the line above and if you want to put a comment just put a double quotes.

[\[08:11\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=491s) This is a comment or you know what? I'm going to press CC to change the whole line CC. Double quotes using vim plug. And I'm going to say shift O here. Double quotes. Set airline to always be visible. Okay, I'm going to press O here to enter an empty line here.

[\[08:43\]](https://www.youtube.com/watch?v=YUKb-4Ekkps&t=523s) And that's it. That should be enough for now. And I'm going to right quit, open vimrc again. You can see everything is the way it was.

[Previous lesson Tabs as window Layouts](https://courses.osherove.com/courses/vim-hates-you/tabs-as-window-layouts/) [Next lesson NerdTree in Vim](https://courses.osherove.com/courses/vim-hates-you/nerdtree-in-vim/)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
