Where your config lives
Classic Vim reads ~/.vimrc at startup. Neovim reads ~/.config/nvim/init.vim if you want Vimscript, or ~/.config/nvim/init.lua if you want Lua (recommended for Neovim — Lua is a real programming language and the rest of the modern Neovim ecosystem is written in it).
The settings that change Vim from "weird editor" to "my editor"
You can have a comfortable, modern Vim with about 25 lines of configuration. The rest of this lesson is a walkthrough of what each essential setting does and why you want it on.
Line numbers — relative is the secret
set number shows the current line's absolute number. set relativenumber shows every other line's distance from the cursor. Combined, the cursor line shows the absolute number and everything else shows the count you'd type to get there. Want to delete down to that line marked "7"? 7dd. No mental math.
Tabs vs spaces — the eternal debate, settled per file
For most languages you want set expandtab (Tab key produces spaces), set tabstop=4 (a tab character displays as 4 spaces wide), set shiftwidth=4 (>> indents by 4), set softtabstop=4 (Tab in Insert mode acts like 4 spaces). Some languages (Go, Makefiles) want hard tabs — handle those per-filetype with autocommands.
Searching that doesn't fight you
set ignorecase + set smartcase means: lowercase searches are case-insensitive (/foo matches Foo, FOO, foo); uppercase searches are case-sensitive (/Foo matches only Foo). It's almost always what you want. Add incsearch (preview matches as you type) and hlsearch (highlight all matches).
The quality-of-life cluster
scrolloff=8 keeps 8 lines visible above and below the cursor — no more cursor sitting on the last line of the screen. signcolumn=yes reserves a column for git/LSP signs so the text doesn't jump when they appear. termguicolors enables true-color support. updatetime=250 makes CursorHold events (used by many plugins) feel instant. undofile persists your undo history across sessions.
.vimrc off the internet. Six months later it breaks, you don't know why, and you abandon Vim. Start small. Add a setting only when you've felt the absence of it. The 25-line config below is what you actually need to be productive on day one.