Configs Editors

Minimal vim and nano configs for servers, explained line by line

A sane minimal ~/.vimrc

Line numbers, 2-space indents that expand tabs (adjust to taste), incremental search highlighting, and a backspace that behaves like every other program’s. Case-sensitive search unless you type all lowercase, then it’s case-insensitive — smartcase is one of those defaults vim should ship with.

syntax on
set number
set tabstop=2 shiftwidth=2 expandtab
set hlsearch incsearch
set ignorecase smartcase
set backspace=indent,eol,start

WHERE: ~/.vimrc — takes effect on the next vim launch.

A usable ~/.nanorc

Nano is the "it’s already installed" editor, which makes it worth 60 seconds of setup. Line numbers, 4-space tabs, a constantly visible cursor position, and mouse clicks that actually move the cursor. If a program on your machine launches pico instead of nano, same directives, same file.

set linenumbers
set tabsize 4
set tabstospaces
set constantshow
set mouse

WHERE: ~/.nanorc — takes effect on the next nano launch.