Glossary

.vimrc

.vimrc is Vim's configuration file, where users set options, define key mappings, load plugins, and customise behaviour. It lives at ~/.vimrc (or ~/.vim/vimrc in the more modern convention). It is written in Vimscript, Vim's built-in scripting language, and is loaded every time Vim starts.

A minimal sensible vimrc:

set nocompatible
syntax on
filetype plugin indent on
set number
set relativenumber
set expandtab shiftwidth=4 tabstop=4
set autoindent
set incsearch hlsearch ignorecase smartcase
set mouse=a
set clipboard=unnamedplus
nnoremap <leader>w :w<CR>

Thousands of people have shared their vimrcs on GitHub; "steal from the best" is a reasonable strategy for learning. Distributions like SpaceVim and frameworks like vim-plug provide a curated starting point. For Neovim users, init.vim or (more commonly today) init.lua plays the same role.

A well-tuned vimrc dramatically changes how the editor feels. Investing a few hours in building your own is one of the more rewarding rites of passage in the Linux ecosystem.

Related terms: Vim, vimscript

Discussed in:

Also defined in: Textbook of Linux