An Always Available Vimrc

Posted: May 08, 2020


While I have Emacs set up to my liking on any computer I use reguarly, I occasionally find myself on strange systems with a need to do a bunch of editing (often a coworker with poor taste in editor configuration, or some remote system).

Vim is more likely to already be available on a given system, and even a much older release is sufficient for my simple configuration. But while some colleagues will use a completely unconfigured Vim, I like a couple creature comforts to help make editing more consistent.

So, I host a vimrc on this website to pull down as necessary.

curl https://clintonliddick.com/vimrc -o .vimrc

Or if I don't want to mess up an existing setup:

curl https://clintonliddick.com/vimrc -o .vimrc-clint
alias cvim='vim -u .vimrc-clint'

The vimrc

set nocompatible  " All the power of Vim
set nobackup      " Don't pollute with ~ files
set mouse=a       " Allow mouse cursor placement
set ignorecase    " Case insensitive matching

" Indentation
set tabstop=4      " Max width of tab in spaces
set shiftwidth=4   " Size of an indent
set expandtab      " Tab and :retab inserts spaces
set smarttab       " Tab goes to next indent block
set softtabstop=0  " No combo of tabs and spaces
set autoindent     " Start next line at previous indent
set smartindent    " Indent after brackets and known keywords

" Display
syntax on      " Do syntax highlighting
filetype on    " Detect filetype
set ruler      " Show column and row number in bottom bar
set number     " Show line numbers
set ttyfast    " Assume fast connection for drawing
set wildmenu   " Command completion list
set showmatch  " Show matching brackets 

" Safety
set modelines=0  " Do NOT read or execute modelines,
set nomodeline   " manually use set ft=<type> instead



Note: This blog post is part of #100DaysToOffload.