In the Vim Basics series, we covered vanilla vim and how powerful it is right out of the box. And honestly, vanilla vim can handle 90% of your daily work as a sysadmin. But sometimes you want that extra 10% - better syntax highlighting, file navigation, or quality of life improvements that make your workflow even smoother.
The key is not to go overboard. I've seen people install 30+ plugins and end up with a slow, bloated vim that defeats the purpose of using a lightweight editor in the first place. As a system admin who jumps between servers constantly, I keep my plugin setup minimal and portable.
As of right now, I have been using Pathogen as my vim plugin manager for a few years now. It took a little setup but is massively trivial to add new plugins or "bundles" as Pathogen calls them.
There are newer plugin managers out there (vim-plug, Vundle, etc.), but Pathogen has proven itself over the years. It's simple, reliable, and doesn't require any special commands - it just works. Plus, it's easy to version control your entire vim setup with git.
My current .vimrc and vim files can be found at my github dotfiles repo.
The installation is straightforward. We need to create a couple directories and download the Pathogen script:
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
This creates:
~/.vim/autoload/ - Where Pathogen itself lives~/.vim/bundle/ - Where all your plugins will be installedNow we need to tell vim to use Pathogen. If you don't have a .vimrc yet, create one:
$ vim ~/.vimrc
At the minimum, you need these lines:
" Load Pathogen
execute pathogen#infect()
" Enable syntax highlighting
syntax on
" Enable filetype detection
filetype plugin indent on
The execute pathogen#infect() line is the magic that makes everything work. It tells vim to load all plugins from the ~/.vim/bundle/ directory. That's it - pathogen is now installed and ready to manage plugins.
My .vimrc file is currently sitting at 182 lines, but most of those are comments and tweaks I've accumulated over the years. The core Pathogen setup is just that one line.
Let's install what is arguably the best color scheme for vim - vividchalk. This theme provides excellent syntax highlighting with colors that are easy on the eyes during long config editing sessions.
Navigate to your bundle directory and clone the plugin:
cd ~/.vim/bundle
git clone https://github.com/tpope/vim-vividchalk.git
That's it! The plugin is installed. Now we just need to activate it in our .vimrc:
" Set colorscheme to vividchalk
colorscheme vividchalk
Add that line anywhere in your .vimrc after the execute pathogen#infect() line, save the file, and restart vim (or run :source ~/.vimrc).
You should immediately see better syntax highlighting when you open any file. The difference is especially noticeable when editing shell scripts, Python, or configuration files.
Here's the beauty of Pathogen: each plugin lives in its own directory under ~/.vim/bundle/. This keeps everything organized and makes it easy to:
git clone it into the bundle directorycd into its directory and git pullFor example, my bundle directory looks like this:
$ ls ~/.vim/bundle/
vim-vividchalk
nerdtree
vim-fugitive
vim-commentary
Each plugin is its own git repository. When I set up vim on a new server, I just clone my dotfiles repo and I'm good to go.
Over the years, I've narrowed down my plugin list to a handful that I actually use every day. Remember, as a sysadmin working across multiple systems, you can't always have your full plugin setup available. These are the ones worth installing on your main workstation:
When working with multiple config files or exploring directory structures:
cd ~/.vim/bundle
git clone https://github.com/preservim/nerdtree.git
Add to your .vimrc:
" Toggle NERDTree with Ctrl+n
map <C-n> :NERDTreeToggle<CR>
" Show hidden files
let NERDTreeShowHidden=1
" Close vim if NERDTree is the only window left
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
Now press Ctrl+n to open a file explorer sidebar. Use the same key combo to close it. Navigate with hjkl keys and press Enter to open files.
If you're managing infrastructure as code or maintaining dotfiles:
cd ~/.vim/bundle
git clone https://github.com/tpope/vim-fugitive.git
This gives you git commands right inside vim:
:Git status - Check repo status:Git diff - See changes:Git commit - Commit changes:Git push - Push to remoteNo need to exit vim to run git commands anymore.
Essential for commenting out blocks of code or config lines:
cd ~/.vim/bundle
git clone https://github.com/tpope/vim-commentary.git
Use gcc to comment/uncomment a line, or select multiple lines in visual mode and use gc. Works with most file types automatically (shell scripts, Python, vim scripts, etc.).
Makes your status line actually useful:
cd ~/.vim/bundle
git clone https://github.com/vim-airline/vim-airline.git
Add to .vimrc:
" Always show status line
set laststatus=2
" Show buffer numbers
let g:airline#extensions#tabline#buffer_nr_show = 1
Now you get a nice status line showing your current mode, file type, line/column, and more.
Here's my philosophy on vim plugins as a sysadmin: only install plugins that save you time or improve readability. Don't install a plugin just because it's popular or looks cool in a screenshot.
I deliberately keep my plugin count low because:
On remote servers, I usually just use vanilla vim with a basic .vimrc. The muscle memory from using vim daily means I'm still productive even without plugins.
Updating all plugins:
cd ~/.vim/bundle
for dir in */; do
cd "$dir"
git pull
cd ..
done
I have this as an alias in my .bashrc:
alias vim-update='cd ~/.vim/bundle && for dir in */; do cd "$dir"; git pull; cd ..; done'
Removing a plugin:
rm -rf ~/.vim/bundle/plugin-name
That's it. No special uninstall process needed.
I highly recommend putting your entire .vim directory in git. Here's how I do it:
cd ~/.vim
git init
git add .
git commit -m "Initial vim configuration"
git remote add origin [your-repo-url]
git push -u origin master
Now your .vimrc and all your plugins are version controlled. When setting up a new machine:
cd ~
git clone [your-repo-url] .vim
ln -s ~/.vim/.vimrc ~/.vimrc
This is exactly what I do with my dotfiles repo. Everything is version controlled, and I can set up my complete vim environment in under a minute on any system.
Here's a condensed version of my plugin-related .vimrc configuration:
" Pathogen Plugin Manager
execute pathogen#infect()
syntax on
filetype plugin indent on
" Colorscheme
colorscheme vividchalk
" NERDTree Configuration
map <C-n> :NERDTreeToggle<CR>
let NERDTreeShowHidden=1
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" Airline Configuration
set laststatus=2
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1
" Git Fugitive
" (no special config needed, just use :Git commands)
" Commentary
" (works out of the box with gcc)
Let's verify everything works:
vim test.shCtrl+n to toggle NERDTree (if installed)gcc to toggle comment (if vim-commentary installed)If something doesn't work:
~/.vim/bundle/execute pathogen#infect() is in your .vimrc:source ~/.vimrc to reload your config:scriptnames to see what vim has loadedWhile I use Pathogen, here are other popular plugin managers if you're curious:
vim-plug:
Vundle:
Native Vim 8+ packages:
I stick with Pathogen because it's simple and I know it works. The "best" plugin manager is the one you understand and can troubleshoot when things break at 2 AM on a production server.
Here's the thing - you don't always need plugins. I've worked with sysadmins who have 50+ plugins installed and their vim takes 3 seconds to start. That defeats the entire purpose.
Skip plugins for:
Your vanilla vim skills should be strong enough that plugins are a nice-to-have, not a requirement. That's why the Vim Basics series focused entirely on vanilla vim - those skills will serve you everywhere.
Here's how I actually use vim day-to-day:
On my workstation:
On production servers:
.vimrc if I'll be there a whileOn customer systems:
This approach means I'm productive everywhere, but comfortable on my main machine.
Plugins can enhance your vim experience, but they're not mandatory. Start with the basics from the Vim Basics series, get comfortable with vanilla vim, then add plugins one at a time as you identify actual needs.
Don't install a plugin just because someone online said it's essential. Install it because you have a specific problem it solves. My plugin list has stayed at 4-5 plugins for years because those solve my actual problems:
That's it. No bloat, no nonsense, just tools that make me faster at my job.
Install Pathogen:
mkdir -p ~/.vim/autoload ~/.vim/bundle
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Add to .vimrc:
execute pathogen#infect()
syntax on
filetype plugin indent on
Install a plugin:
cd ~/.vim/bundle
git clone [plugin-repo-url]
Update plugins:
cd ~/.vim/bundle && for dir in */; do cd "$dir"; git pull; cd ..; done
Remove a plugin:
rm -rf ~/.vim/bundle/[plugin-name]
Now go forth and enhance your vim setup! Just remember to keep it simple, keep it portable, and always maintain your vanilla vim skills.
For more vim content, check out the Vim Basics series covering everything from opening files to advanced text objects and .vimrc configuration.