Skip to main content

A vimrc starter

A starter .vimrc assembled from recommendations in Use Vim Like a Pro, with practical defaults for syntax, modes, completion, indentation, searching, and editing.
Published

October 16, 2025

Here is a .vimrc file built from the recommendations in my Vim book, “Use Vim Like A Pro” (available on LeanPub).

 " ===================================================================
" Basic .vimrc Configuration
" Based on recommendations from "Use Vim Like a Pro"
" Copy this to ~/.vimrc to use
" ===================================================================

" Turn on all the magic, including Explorer and syntax highlighting
syntax enable

" Show me when I'm in insert/overtype mode
set showmode

" When a command is in progress, show it in the status bar
set showcmd

" Magic for completion at the : command line
set wildmenu

" Turn on the "ruler" (status info) at the bottom of the screen
set ruler

" Turn on man pages (type :Man )
runtime ftplugin/man.vim

" Indent in a smart way, instead of returning to the left margin all the time
set autoindent

" Expand tabs to spaces
set expandtab

" Don't wrap text (makes windows ugly)
set nowrap

" Highlight all matches in text when you search
set hlsearch

" Show matches for braces, parens, etc.
set showmatch

" Do case-insensitive searching
set ignorecase

" When a search phrase has uppercase, don't be case insensitive
set smartcase

" Tell the editor where to search for files
set path=.,..,/usr/include/**,/usr/share/**

" When I want spell-checking, I want it to be english
set spelllang=en_us

" Use industry standard 8-char tabs
set tabstop=8

" Use standard 4-char indentation
set shiftwidth=4

" Indent/Dedent to nearest 4-char boundary
set shiftround

" Show line numbers (recommended for programming)
set number