Vim Documentation
- id: 1749811575
- Date: June 13, 2025, 10:46 a.m.
- Author: Donald F. Elger
This job of this lesson is to equip you to write your own help files.
Goals
- Describe Vim Documentation (nvim).
- Skillfully create your own documentation.
What
Vim documentation refers to plain text files
formatted in a specific way so they can be integrated into Vim’s
:help
system. This lets you:
- View your custom docs using
:help your-topic
- Jump between sections using tags like
|this|
and*this*
- Keep personal notes and command references inside Vim
Examples
:help
– Open the built-in Vim help:help :w
– Help on the:w
command:help mydocs
– Access your own help topicCtrl-]
– Jump to a tag
Ctrl-T
– Go back
Why
- Quickly find useful info without leaving Vim
- Keep track of:
- Key mappings
- Plugin usage
- Custom commands
- Workflows and tricks
- Key mappings
- Make your notes searchable and structured
How: Creating Your Own Vim Help File
Step 1: Create the file
mkdir -p ~/.config/nvim/doc
nvim ~/.config/nvim/doc/mydocs.txt
Step 2: Add help-formatted content
*mydocs.txt* Your personal Vim documentation Last Updated: 2025-06-13
==============================================================================
INTRODUCTION *mydocs*
This is my personal Vim help file. Use `:help mydocs` to view this.
==============================================================================
KEYBINDINGS *mykeys*
Here are my most important key mappings:
- <leader>ff → Telescope file finder
- <leader>gg → LazyGit
==============================================================================
COMMANDS *mycommands*
|:W| - My remapped save command
|:Bd| - Close buffer
|:Q| - Quit Vim
==============================================================================
TAGS *mytags*
|mykeys| - Keybinding reference |mycommands| - My custom commands
Note:
- Use mytag at the top of a section to define a help tag.
- Use |mytag| to reference it inline.
Step 3: Generate helptags
From the terminal:
helptags ~/.config/nvim/doc
Or from within Vim:
:helptags ~/.config/nvim/doc
Step 4: Use your help file
:help mydocs
:help mykeys
Tips
- Keep lines under 78 characters.
- Every tag must be unique across all help files.
- You can make multiple personal help files — just use distinct filenames and tag prefixes.