Building a Modern VIM Configuration from Scratch – Part 2: Essential Plugins

In Part 1, we built a solid ~150 line VIM configuration. No plugins, just core settings we understand.

Now? We add superpowers.

By the end of this article, you’ll have fuzzy finding, Git integration, beautiful colors, smart editing helpers, and a status line that actually looks good.

All tested on z/OS. All explained. All yours to customize.

Who is this for?

This guide is for you if:

  • You followed Part 1 and have the foundation config
  • You want to add plugins but don’t know which ones
  • You’re tired of copying random plugin lists from the internet
  • You want to understand what each plugin actually does

Important: Like Part 1, these are my preferences. I’ll explain why I chose each plugin so you can make informed decisions.

Series overview:

  • Part 1: Core configuration (done!)
  • Part 2 (this article): Essential plugins
  • Part 3: LSP with CoC and clangd for IDE features

Prerequisites

You’ll need:

  • The configuration from Part 1
  • Internet access (for downloading plugins)
  • Git installed (should have it from our Unix setup article)

That’s it. Let’s go.

Plugin management: vim-plug

Before we install plugins, we need a plugin manager.

There are several options (Vundle, Pathogen, vim-plug, native packages), but vim-plug is my choice:

  • Simple to use
  • Fast (parallel installation)
  • Lazy loading support
  • Works great on z/OS

Installing vim-plug

# Backup - just in case
mv .vim .vim.bak

# Install
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

# Verify
ls -la ~/.vim/autoload/plug.vim

That’s it. One file, one command.

Using vim-plug

In your ~/.vimrc, plugins go in a call plug#begin() / call plug#end() block:

" ============================================
" Plugin Management
" ============================================
call plug#begin('~/.vim/plugged')
  " Plugins go here
  Plug 'author/plugin-name'
call plug#end()

Basic commands:

  • :PlugInstall – Install plugins
  • :PlugUpdate – Update plugins
  • :PlugClean – Remove unused plugins
  • :PlugStatus – Check plugin status

Where to put this in your .vimrc? Right at the top, before your settings.

The plugin list: What we’re installing

Here’s what we’ll add today:

call plug#begin('~/.vim/plugged')
  " Color scheme
  Plug 'sainnhe/gruvbox-material'
  
  " Status line
  Plug 'vim-airline/vim-airline'
  Plug 'vim-airline/vim-airline-themes'
  
  " Fuzzy finder
  Plug 'junegunn/fzf', { 'dir': '~/.fzf' }
  Plug 'junegunn/fzf.vim'
  
  " Editing enhancements
  Plug 'tpope/vim-surround'
  Plug 'jiangmiao/auto-pairs'
  Plug 'tpope/vim-commentary'
  Plug 'tpope/vim-repeat'
  
  " Git integration
  Plug 'tpope/vim-fugitive'
  Plug 'airblade/vim-gitgutter'
call plug#end()

Let’s go through each one and see what it does.

Color scheme: gruvbox-material

Plug 'sainnhe/gruvbox-material'

What it does: A beautiful, eye-friendly color scheme.

The built-in blue scheme is… okay. gruvbox-material is professional, carefully designed, and easy on the eyes during long coding sessions.

Configuration:

" After call plug#end(), before other settings:
set background=dark

" gruvbox-material settings (BEFORE colorscheme!)
let g:gruvbox_material_background = 'medium'  " 'hard', 'medium', 'soft'
let g:gruvbox_material_better_performance = 1

colorscheme gruvbox-material

Options:

  • 'hard' – High contrast, sharp
  • 'medium' – Balanced (my choice)
  • 'soft' – Lower contrast, very gentle

Try all three, see what you like!

Alternatives: If you don’t like gruvbox-material, try:

  • morhetz/gruvbox – Original gruvbox
  • folke/tokyonight.nvim – Modern, vibrant
  • catppuccin/vim – Pastel, soothing

Status line: vim-airline

Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'

What it does: Replaces the boring status line with something beautiful and informative.

Shows:

  • Current mode (NORMAL, INSERT, VISUAL)
  • Git branch (if in a repo)
  • File name and path
  • File type
  • Line/column position
  • Percentage through file

Configuration:

" ============================================
" Airline Configuration
" ============================================
let g:airline_theme = 'gruvbox_material'
let g:airline_powerline_fonts = 0
let g:airline#extensions#tabline#enabled = 1

" Symbols (if you don't have powerline fonts)
if !exists('g:airline_symbols')
  let g:airline_symbols = {}
endif
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.readonly = 'RO'
let g:airline_symbols.linenr = '☰'
let g:airline_symbols.maxlinenr = ''

About powerline fonts: Special fonts with fancy symbols (arrows, branches, etc.). Look great but require:

  1. Installing a patched font on your local machine
  2. Configuring your terminal to use it

(Hint: If you do install powerline fonts, set let g:airline_powerline_fonts = 1)

Fuzzy finder: fzf

Plug 'junegunn/fzf', { 'dir': '~/.fzf' }
Plug 'junegunn/fzf.vim'

What it does: The game-changer. Fast, fuzzy file finding.

Instead of typing exact paths, type partial matches and let fzf find them.

Nnote: We use { 'dir': '~/.fzf' } to use the fzf binary from zopen:

# Install fzf via zopen first:
zopen install fzf -y

This uses the precompiled z/OS binary instead of trying to compile from source.

Using fzf

Commands:

  • :Files – Fuzzy find files in current directory
  • :GFiles – Fuzzy find Git tracked files
  • :Buffers – Fuzzy find open buffers
  • :History – Fuzzy find recent files
  • :Commands – Fuzzy find VIM commands

Workflow example:

:Files
# Type: main
# See: main.c, mainloop.h, domain.c
# Arrow keys to navigate, Enter to open

Pro tip: Add keybindings for faster access:

" After your existing keybindings:
nnoremap <leader>f :Files<CR>
nnoremap <leader>b :Buffers<CR>
nnoremap <leader>h :History<CR>

Now Space f opens file finder. Much faster!

Bug Fix: Disable preview:

  " ============================================
  " FZF Configuration
  " ============================================
  " Disable preview (z/OS 'file' command incompatible)
  let g:fzf_preview_window = []

Alternative: NERDTree

Some people prefer a file tree sidebar (like VSCode’s explorer):

Plug 'preservim/nerdtree'

" Toggle with F2:
nnoremap <F2> :NERDTreeToggle<CR>

My opinion: fzf is faster and more keyboard-driven. But if you love file trees, NERDTree is solid.

Choose one.** Don’t need both.

Editing enhancements

These plugins make editing smoother and faster.

vim-commentary

Plug 'tpope/vim-commentary'

What it does: Toggle comments with gcc.

Usage:

" Normal mode:
gcc           " Toggle comment on current line
gc3j          " Comment 3 lines down
gcap          " Comment around paragraph

" Visual mode:
V             " Visual line
3j            " Select 3 lines
gc            " Toggle comment

Works with any language – knows C’s /* */, Python’s #, shell’s #, etc.

vim-surround

Plug 'tpope/vim-surround'

What it does: Change/add/delete surrounding characters (quotes, brackets, tags).

Usage:

" Cursor on: hello
ysiw"         " Add quotes: "hello"
cs"'          " Change quotes: 'hello'
ds'           " Delete quotes: hello
ysiw(         " Add parens: (hello)

Breakdown:

  • ys = you surround
  • cs = change surrounding
  • ds = delete surrounding
  • iw = inner word

Takes practice to build muscle memory, but becomes second nature.

auto-pairs

Plug 'jiangmiao/auto-pairs'

What it does: Automatically closes brackets, quotes, etc.

Usage:

" Type: (
" Get: (|)   ← cursor in middle

" Type: "
" Get: "|"

" Type: {
" Get: {|}

Just works. No configuration needed.

vim-repeat

Plug 'tpope/vim-repeat'

What it does: Makes . (repeat) work with plugin commands.

Without vim-repeat:

" Add quotes to word: ysiw"
" Move to next word, press .
" Does nothing (or something wrong)

With vim-repeat:

" Add quotes to word: ysiw"
" Move to next word, press .
" Adds quotes again! Perfect!

Subtle but powerful. Makes vim-surround and vim-commentary much more useful.

Git integration

Essential if you use Git (and you should).

vim-fugitive

Plug 'tpope/vim-fugitive'

What it does: Git commands from within VIM.

Commands:

  • :Git status or :G status – Git status
  • :Git diff – See diffs
  • :Git blame – Who changed what
  • :Git log – Commit history
  • :Git commit – Commit changes
  • :Git push – Push to remote

Pro feature: In diff/status view, use - to stage/unstage files. Much faster than command line.

vim-gitgutter

Plug 'airblade/vim-gitgutter'

What it does: Shows Git changes in the sign column (that column we reserved in Part 1!).

Symbols:

  • + – New lines
  • ~ – Modified lines
  • - – Deleted lines

Updates in real-time as you edit. See exactly what you’ve changed since last commit.

Commands:

  • ]c – Jump to next change
  • [c – Jump to previous change
  • :GitGutterToggle – Toggle on/off

The complete plugin configuration

Here’s your updated ~/.vimrc with all plugins:

" ============================================
" Plugin Management
" ============================================
call plug#begin('~/.vim/plugged')
  " Color scheme
  Plug 'sainnhe/gruvbox-material'

  " Status line
  Plug 'vim-airline/vim-airline'
  Plug 'vim-airline/vim-airline-themes'

  " Fuzzy finder
  Plug 'junegunn/fzf', { 'dir': '~/.fzf' }
  Plug 'junegunn/fzf.vim'

  " Editing enhancements
  Plug 'tpope/vim-surround'
  Plug 'jiangmiao/auto-pairs'
  Plug 'tpope/vim-commentary'
  Plug 'tpope/vim-repeat'

  " Git integration
  Plug 'tpope/vim-fugitive'
  Plug 'airblade/vim-gitgutter'
call plug#end()

" ============================================
" Basic Settings
" ============================================
set nocompatible
syntax on
filetype plugin indent on

" ============================================
" Colors & Scheme
" ============================================
set t_Co=256
set background=dark

" gruvbox-material settings (BEFORE colorscheme!)
let g:gruvbox_material_background = 'medium'
let g:gruvbox_material_better_performance = 1

colorscheme gruvbox-material

" ============================================
" Airline Configuration
" ============================================
let g:airline_theme = 'gruvbox_material'
let g:airline_powerline_fonts = 0
let g:airline#extensions#tabline#enabled = 1

if !exists('g:airline_symbols')
  let g:airline_symbols = {}
endif
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.readonly = 'RO'
let g:airline_symbols.linenr = '☰'
let g:airline_symbols.maxlinenr = ''

" ============================================
" FZF Configuration
" ============================================
" Disable preview (z/OS 'file' command incompatible)
let g:fzf_preview_window = []


" ... (all your settings from Part 1, till key mappings) ...

" ============================================
" Key Mappings
" ============================================
let mapleader = " "          " Space as leader key

" ... (all your key mappings from Part1) ...

" FZF Key mappings for quick access
nnoremap <leader>f :Files<CR>
nnoremap <leader>b :Buffers<CR>
nnoremap <leader>h :History<CR>

" ... (all your settings from Part 1) ...

(Keep all your settings from Part 1 – UI, indentation, search, behavior, keymappings, auto commands, etc.)

Installation & testing

Step 1: Install fzf via zopen

zopen install fzf -y

Step 2: Update your .vimrc

Add the plugin section at the top, before your existing settings.

Step 3: Install plugins

# Open VIM
vim

# In VIM, install plugins:
:PlugInstall

# Wait for all plugins to install
# Should see green "Finished" messages

Step 4: Reload and test

" Reload config:
:source ~/.vimrc

" Test fzf:
:Files

" Test commentary (in a code file):
gcc          " Toggle comment

" Test fugitive (in a git repo):
:Git status

" Check airline:
" Look at bottom status line - should be colorful!

Common issues

Plugins not installing

Check network access:

curl -I https://github.com
# Should return 200 OK

If behind firewall, you might need proxy settings.

fzf not found

# Make sure fzf is in PATH:
which fzf
# Should show: /path/to/zopen/.../fzf

# If not:
. $HOME/zopen/etc/zopen-config

Airline doesn’t show

Make sure laststatus=2 is set (should be from Part 1):

:set laststatus?
" Should show: laststatus=2

gitgutter not updating

Check if you’re in a Git repository:

git status
# Should work

Optional plugins worth mentioning

Didn’t make the essential list, but you might want them:

vim-matchup

Plug 'andymass/vim-matchup'

Better % matching. Understands if/endif, do/end, not just brackets.

NERDTree

Plug 'preservim/nerdtree'
nnoremap <F2> :NERDTreeToggle<CR>

File tree sidebar. Use if you prefer visual file navigation over fzf’s fuzzy finding.

Plugin organization tips

Group plugins logically:

call plug#begin('~/.vim/plugged')
  " Appearance
  Plug 'sainnhe/gruvbox-material'
  Plug 'vim-airline/vim-airline'

  " Navigation
  Plug 'junegunn/fzf'
  Plug 'junegunn/fzf.vim'

  " Editing
  Plug 'tpope/vim-surround'
  Plug 'jiangmiao/auto-pairs'

  " Git
  Plug 'tpope/vim-fugitive'
  Plug 'airblade/vim-gitgutter'
call plug#end()

Comment out plugins to test:

" Disable temporarily:
" Plug 'some/plugin'

" Then :PlugClean to remove

Keep plugin configs together:

" ============================================
" Plugin Configurations
" ============================================

" gruvbox-material
let g:gruvbox_material_background = 'medium'

" airline
let g:airline_theme = 'gruvbox_material'

" fzf
nnoremap <leader>f :Files<CR>

What’s next

You now have a VIM setup that rivals many modern editors:

  • ✅ Beautiful color scheme
  • ✅ Informative status line
  • ✅ Lightning-fast fuzzy finding
  • ✅ Smart editing helpers
  • ✅ Git integration
  • ✅ ~200 lines total (still manageable!)

In Part 3, we’ll add the final piece: LSP (Language Server Protocol) with CoC.

This brings IDE-level features:

  • Intelligent auto-completion
  • Go-to-definition
  • Real-time error checking
  • Code actions and refactoring

Key takeaways

What we learned:

  • vim-plug makes plugin management simple
  • fzf is the killer feature (fuzzy finding everything)
  • tpope’s plugins (surround, commentary, repeat, fugitive) are essential
  • Color schemes matter for long coding sessions
  • Organization keeps configs maintainable

Core principles:

  • Start with essentials, add more later if needed
  • Understand what each plugin does
  • Test plugins individually
  • Keep your config organized

You’ve transformed VIM from a basic editor into a powerful development environment.

And you still understand every piece of it.

Related:

Questions or feedback? Drop a comment below!

What plugins do you find essential? Let me know what I missed!

2 thoughts on “Building a Modern VIM Configuration from Scratch – Part 2: Essential Plugins”

Leave a Comment