Vim, which stands for Vi IMproved, was developed by Bram Moolenaar in 1991 as an extended and improved version of the vi editor that Bill Joy created for BSD Unix in 1976. It adds modern features like syntax highlighting, multiple undo, plugin support, and split windows while preserving vi’s core philosophy of modal editing, enabling extremely fast editing using only the keyboard. Vim comes pre-installed on nearly all Unix-like systems, making it essential for server management. It enables powerful editing without GUI editors in SSH environments, and its value is supported by nearly 50 years of accumulated community knowledge and a robust plugin ecosystem.

History of Vim

From Vi to Vim

Vi was an editor designed by Bill Joy in 1976 to work efficiently in the slow terminal environments of the era, introducing the concept of modal editing. Vim was developed by Bram Moolenaar in 1991 as an extension of vi. True to its name, Vi IMproved, it includes all of vi’s functionality while adding modern features.

Major Development Timeline

YearEventSignificance
1976vi born (Bill Joy)Text editor for BSD Unix introducing modal editing
1991Vim 1.0 released (Bram Moolenaar)Developed for Amiga, extended features while maintaining vi compatibility
1998Vim 5.0Syntax highlighting, scripting language support
2006Vim 7.0Tab pages, spell checking, omni completion added
2014Neovim project startedVim fork with async plugins, built-in LSP support
2016Vim 8.0Asynchronous operations, terminal window support
2023Bram Moolenaar passed awayTransition to community-driven development

Vim vs Neovim

Neovim is a project that began in 2014 by forking Vim’s codebase. It cleaned up Vim’s legacy code and redesigned it with modern architecture, supporting asynchronous plugins, built-in LSP client, and Lua scripting. Both editors are actively developed, and their basic usage is nearly identical.

CharacteristicVimNeovim
PhilosophyTraditional stability, backward compatibilityModern innovation, extensibility
ScriptingVimscriptVimscript + Lua
PluginsSynchronous execution focusNative async support
LSPPlugin required (coc.nvim, etc.)Built-in LSP client
Default SettingsMinimal defaultsSensible defaults
GUI SupportGVimVarious GUI frontends

Philosophy of Modal Editing

What is Modal Editing?

Modal editing separates editor operations into multiple modes where the same key performs different functions depending on the mode. In regular editors, pressing j inputs the character ‘j’. In Vim’s Normal mode, pressing j moves the cursor down.

Modal editing allows all character keys on the keyboard to be used as commands, enabling concise expression of hundreds of commands without modifier keys like Ctrl or Alt. It clearly separates text input from editing, preventing unintended text input, and allows combining commands (composability) to express complex editing tasks simply. The initial learning curve is steep, but learning just 20-30 basic commands enables everyday editing, and after a few months, you experience editing speeds far faster than conventional editors.

Why People Still Use Vim

ReasonExplanation
Server EnvironmentPre-installed on almost all Unix/Linux systems, immediately available via SSH
SpeedLighter than GUI editors, keyboard-centric is faster than mouse
VersatilityVim key bindings supported in VS Code, JetBrains, browsers, and more
CustomizationInfinite configuration possibilities, build your own workflow
Community50 years of accumulated knowledge, tutorials, plugins

Vim Mode Overview

Vim operates with four main modes, each designed for different purposes.

ModeEntry MethodPurposeExit Method
NormalEsc or when Vim startsMovement, editing commands-
Inserti, a, o, etc.Text inputEsc
Visualv, V, Ctrl+vText selectionEsc or command execution
Command:File operations, settings, search/replaceEnter or Esc

Normal Mode

Normal mode is Vim’s core mode. Vim starts in this mode by default, and you spend most of your time here.

Movement Commands

CommandActionDescription
h, j, k, lLeft, down, up, rightBasic cursor movement (use instead of arrow keys)
wNext word startShort for word
bPrevious word startShort for back
eCurrent/next word endShort for end
0Line startThe number 0
$Line endSame as regex end
^First non-blank characterSimilar to regex start
ggFirst line of fileShort for go
GLast line of fileCapital G
{n}GGo to line nExample: 10G goes to line 10
f{char}Move to character in current lineShort for find
t{char}Move to just before characterShort for till
%Jump to matching bracketNavigate between (), {}, []

Editing Commands

CommandActionDescription
xDelete character at cursordelete character
r{char}Replace character at cursorreplace
ddDelete current linedelete line
yyCopy current lineyank line
pPaste after cursorpaste after
PPaste before cursorpaste before
uUndoundo
Ctrl+rRedoredo
.Repeat last changeOne of the most powerful commands

Combining Operators and Motions

Vim’s true power lies in combining operators with motions. The format {operator}{motion} enables various editing operations.

CombinationMeaningDescription
dwdelete wordDelete from cursor to word end
d$delete to endDelete from cursor to line end
d0delete to startDelete to line start
diwdelete inner wordDelete entire word
dawdelete a wordDelete word and surrounding whitespace
ci"change inner quotesChange content inside quotes
ca(change a parenthesisChange content including parentheses
yiwyank inner wordCopy word
>}indent to paragraph endIndent to paragraph end

Insert Mode

Insert mode is where you actually input text. You can enter it in various ways, each starting at a different position.

CommandActionDescription
iInput at cursor positioninsert
aInput after cursor positionappend
IInput at line startInsert at line start
AInput at line endAppend at line end
oCreate new line below and inputopen line below
OCreate new line above and inputOpen line above
sDelete character then inputsubstitute character
SDelete line then inputSubstitute line
c{motion}Delete range then inputchange

Pressing Esc in Insert mode returns you to Normal mode. Many Vim users remap Caps Lock to Esc because the Esc key is far away, or use custom mappings like Ctrl+[ or jk.

Visual Mode

Visual mode allows you to visually select text for editing. There are three types.

CommandSelection TypeUse Case
vCharacter-wiseGeneral text selection
VLine-wiseSelect entire lines
Ctrl+vBlock-wiseRectangular region selection (like multiple cursors)

Key commands available after selecting in Visual mode include d (delete), y (copy), c (change), > (indent), < (unindent), ~ (toggle case), u (lowercase), and U (uppercase).

Command Mode

Command mode is where you enter commands starting with : to perform file operations, change settings, and execute search/replace operations.

File Operations

CommandAction
:wSave
:qQuit
:wq or :xSave and quit
:q!Force quit without saving
:e {file}Open file
:w {file}Save as

Setting Changes

CommandAction
:set numberDisplay line numbers
:set relativenumberDisplay relative line numbers
:set tabstop=4Set tab size
:set expandtabConvert tabs to spaces
:syntax onEnable syntax highlighting

Search and Substitution

Vim’s search supports regular expressions and is very powerful.

CommandAction
/patternSearch downward
?patternSearch upward
nNext result
NPrevious result
*Search word at cursor
#Reverse search word at cursor

Substitution

The substitution command uses :s (substitute) and can perform various substitutions by combining ranges and flags.

CommandAction
:s/old/new/Substitute first occurrence in current line
:s/old/new/gSubstitute all in current line
:%s/old/new/gSubstitute all in entire file
:%s/old/new/gcSubstitute with confirmation
:5,10s/old/new/gSubstitute in lines 5-10
:'<,'>s/old/new/gSubstitute in Visual selection

Plugin Ecosystem

Plugin Managers

The most popular Vim plugin manager is vim-plug, characterized by concise syntax and fast parallel installation. Plugins can be batch installed with the :PlugInstall command and updated with :PlugUpdate.

Essential Plugins

PluginFunctionDescription
NERDTreeFile explorerBrowse files in sidebar tree structure
fzf.vimFuzzy finderQuick search for files, buffers, commands
coc.nvimAutocompletion/LSPVSCode-level IntelliSense
vim-airlineStatus barDisplay mode, filename, Git status
vim-fugitiveGit integrationRun Git commands within Vim
vim-surroundSurround editingEasily change brackets, quotes, etc.
vim-commentaryComment toggleToggle comments with gc

vimrc Configuration

vimrc is Vim’s configuration file, located at ~/.vimrc (Unix) or ~/_vimrc (Windows), and is automatically loaded when Vim starts.

" Basic settings
set nocompatible            " Disable vi compatibility mode
set encoding=utf-8          " UTF-8 encoding
set number                  " Display line numbers
set relativenumber          " Relative line numbers
syntax on                   " Syntax highlighting
set tabstop=4               " Tab size 4
set shiftwidth=4            " Indent size 4
set expandtab               " Convert tabs to spaces
set autoindent              " Auto indent
set smartindent             " Smart indent
set hlsearch                " Highlight search results
set incsearch               " Incremental search
set ignorecase              " Case insensitive
set smartcase               " Case sensitive when uppercase used
set cursorline              " Highlight current line
set wildmenu                " Command completion menu
set clipboard=unnamedplus   " Use system clipboard

" Leader key setting
let mapleader = " "

" Common mappings
nnoremap <leader>w :w<CR>
nnoremap <leader>q :q<CR>
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

Practical Tips

Macros

Macros are a powerful feature for automating repetitive tasks. Start recording with q{register}, perform actions, end recording with q, then replay with @{register}. Use @@ to repeat the last macro.

Split Windows

CommandAction
:sp or :splitHorizontal split
:vs or :vsplitVertical split
Ctrl+w h/j/k/lMove between windows
Ctrl+w =Equalize window sizes
Ctrl+w _Maximize current window (horizontal)
Ctrl+w |Maximize current window (vertical)

Buffer Management

CommandAction
:lsList buffers
:bnNext buffer
:bpPrevious buffer
:b{n}Go to buffer n
:bdDelete buffer

Learning Methods

vimtutor is an interactive tutorial built into Vim. It runs by entering vimtutor in the terminal and takes about 30 minutes. A Korean version is also available (vimtutor ko). It is the best learning method for beginners as you can learn basic commands through hands-on practice. Learning one new command at a time while using Vim daily is effective. Vim key bindings are supported in many tools including VS Code (Vim extension), JetBrains IDE (IdeaVim), and browsers (Vimium), making it a high-value skill that can be used for a lifetime once learned.

Conclusion

Vim is a text editor with nearly 50 years of history since vi’s birth in 1976. Through the unique philosophy of modal editing, it enables extremely fast editing using only the keyboard. The initial learning curve is steep, but once familiar, it is more efficient than any other editor. It comes pre-installed on nearly all Unix/Linux systems, making it essential in server environments. Through plugins and configuration, it can achieve modern IDE-level functionality. Vim key bindings are supported in VS Code, JetBrains, browsers, and more, making it a skill you can use for a lifetime once learned.