Vim Configuration
vimrc, runtime, plugins โ where settings live.
Vim reads ~/.vimrc (or ~/.config/nvim/init.vim for Neovim) on startup. Plugins go in plugin folders inside 'runtimepath'. Filetype plugins, syntax files, indent files all auto-load by name.
Vim is configured by a startup script and an extensible runtime path. Knowing where files live makes debugging much easier.
The startup file
| Editor | Config file |
|---|---|
| Vim (Unix) | ~/.vimrc or ~/.vim/vimrc |
| Vim (Windows) | %USERPROFILE%\_vimrc |
| Vim (Windows, alt.) | %USERPROFILE%\vimfiles\vimrc |
| Neovim | ~/.config/nvim/init.vim (or init.lua) |
The runtime path
'runtimepath' is a comma-separated list of directories Vim searches for plugins, syntax files, colorschemes, etc. By default it includes ~/.vim and $VIMRUNTIME.
| Subfolder | Auto-loads |
|---|---|
plugin/ |
Run on startup, every session |
autoload/ |
Loaded on demand by name |
syntax/<filetype>.vim |
Loaded when buffer's filetype matches |
ftplugin/<filetype>.vim |
Same โ for buffer-local settings |
indent/<filetype>.vim |
Same โ for indenting rules |
colors/<name>.vim |
Loaded by :colorscheme name |
doc/ |
Help files (run :helptags ALL after install) |
Watch
- ๐บ #0498 The vimrc / init.lua (not yet published)
- ๐บ #0500 What's Next? (not yet published)
See also: Setting Options ({key::set})