Notes on the Vim text editor

In search of a calm editor with few distractions, I made a configuration for the Vim (and Vim Classic) text editor. While some don’t consider Vim to be an editor with low cognitive load, I humbly disagree with this. Yes it has a learning curve, but it’s well documented, and you can learn basic functionality very quickly. Also, the basic use of Vim does not change much, so everything you learn is knowledge you’ll be able to use for decades.

TLDR: You can get the configuration (.vimrc) at #Configuration

If you desire an even lighter weight text editor, take a look at my Notes on the nvi text editor.

Note: In march 2026, a new fork of Vim called Vim Classic was launched by Drew Devault. This fork does not and will not accept generative AI / LLM driven commits.

In the words of Drew:

“Vim Classic is a fork of Vim 8.x for long-term maintenance, providing a stable, dependable editor — maintained entirely by humans.”

Sounds perfect for my use. The current ‘official’ Vim is at 9.x, but my config below works fine with both Vim 9.x and Vim Classic 8.3, which is what I currently use.

Features

Keyboard shortcuts

Use these in ’normal’ mode. Press the ‘\’ (backslash) key before each key. This is the so-called ‘Leader’ key by default.

Key    Action
cClear search highlight
lToggle dark / light background
sToggle syntax highlighting
ddInsert date
dtInsert date and time
dTInsert more complete date and time
GToggle the Goyo plugin (center your text)
LToggle the Limelight plugin (highlight current paragraph, darken others)
wToggle listing of whitespace characters

A few tips on using Vim

Vim offers a lot of shortcuts for functionality to help you edit conveniently and fast. But you don’t need to remember them all. I don’t. Here are a few I do use regularly and which seem to stick in my mind.

Key      Action
{Move cursor to before current paragraph
}Move cursor to after current paragraph
/ForeMove cursor to next occurrence of 'Fore'
?BackMove cursor to previous occurrence of 'Back'
nMove cursor to next match of previous search term
ggMove cursor to beginning of file
GMove cursor to end of file
:42Move cursor to line 42
y4lYank (copy) the next 4 characters starting from the cursor
y4yYank (copy) 4 lines starting from the cursor
pPaste yanked contents after current line
PPaste yanked contents before current line
ciwReplace word (think Change In Word)
ci(Change next text between ()
ci<Change next text between < and > (think HTML tags)
dapDelete a (current) paragraph
uundo (multiple u for multiple undo)
Ctrl-rredo
~Change case of selection
.Repeat last modification action

Screenshots

Below are some screenshots of how this configuration of Vim looks. Click on them to see a larger version. I mostly have Limelight and syntax disabled, and use Vim full screen. So my screen usually looks like something resembling the first screenshot.

Configuration

vim uses a file called .vimrc in your home folder.

Download this file and save it as .vimrc in your home folder. Then customize it to your heart’s desire! :-)

=> vimrc.txt

Contents:

" vi compatibility
set nocompatible

" locale
language en_US.UTF-8

" Encoding
set encoding=utf-8

" true color support
set termguicolors

" Color scheme (terminal)
set t_Co=256

" Syntax highlighting
syntax off

" Blink cursor on error instead of beeping (grr)
set visualbell

" How many lines of command history to remember?
set history=1000

" Show status line
set laststatus=2

" Show menu for completion
set wildmenu

" Show cursor position
set ruler

" Reread file changed outside vim
set autoread

" Delete comment character when joining commented lines
set formatoptions+=j

" Wrapping
set wrap
" Wrap at word boundary
set lbr

" Whitespace
set textwidth=0
set formatoptions=tcqrn1
set tabstop=8
set shiftwidth=8
set softtabstop=8
set noexpandtab
set noshiftround
set smarttab

" How to indicate whitespace
set listchars=tab:⟶\ ,trail:▸,extends:⟶,precedes:⟵,nbsp:+

" Incremental search
set incsearch

" Highlight search
set hlsearch

" For plugins to load correctly
filetype plugin indent on

" limelight
let g:limelight_conceal_ctermfg = 'gray'
let g:limelight_conceal_ctermfg = 240

" toggle syntax on/off
nnoremap <expr> <Leader>s exists("syntax_on") ? ':syntax off<CR>' : ':syntax on<CR>'

" toggle background light/dark
nnoremap <expr> <Leader>l &background == 'light' ? ':set background=dark<CR>' : ':set background=light<CR>'

" toggle listing of whitespace
nnoremap <expr> <Leader>w ':set list!<CR>'

" clear search highlight
nnoremap <expr> <Leader>c ':noh<CR>'

" insert date
nnoremap <silent> <Leader>dd :put =strftime('%Y-%m-%d %a')<CR>

" insert date and time
nnoremap <silent> <Leader>dt :put =strftime('%Y-%m-%d %a, %H:%M')<CR>

" insert complete date and time
nnoremap <silent> <Leader>dT :put =strftime('%a, %d %b %Y %H:%M:%S %z')<CR>

" toggle Goyo plugin
nnoremap <expr> <Leader>G ':Goyo<CR>'

" toggle Limelight plugin
nnoremap <expr> <Leader>L ':Limelight!!<CR>'

" toggle listing of whitespace
nnoremap <silent> <expr> <Leader>w ':set list!<CR>'