My minimal .vimrc

“How to generate a random string? Put a first year computer science student in Vim and ask them to save and exit.”

Here's my minimal settings with comments:

set nocompatible                                 " disable Vi compatibility
set autoread                                     " reload on external file changes
set backspace=indent,eol,start                   " backspace behaviour
set clipboard=unnamed,unnamedplus                " enable clipboard
set encoding=utf8                                " enable utf8 support
set fileformats=unix,dos,mac                     " EOL type to be detected  
set hidden                                       " hide buffers, don't close
set nowrap                                       " disable wrapping
set number                                       " show line numbers
set cursorline                                   " find the current line quickly
set ruler                                        " show cursor position in status bar
set term=xterm-256color                          " terminal type
set wildmenu wildmode=longest:full,full          " wildmode settings
set listchars=eol:¶,trail:•,tab:▸\               " whitespace characters
set scrolloff=999                                " center cursor position vertically
set showbreak=¬\                                 " Wrapping character
set showmatch                                    " show matching brackets
set autoindent expandtab                         " autoindentation & tabbing
set shiftwidth=2 softtabstop=2 tabstop=2         " 1 tab = 2 spaces
set hlsearch ignorecase incsearch smartcase      " search options
set nobackup noswapfile nowritebackup            " disable backup/swap files
set undofile undodir=~/.vim/undo undolevels=9999 " undo options
set lazyredraw                                   " enable lazyredraw
set nocursorline                                 " disable cursorline
set ttyfast                                      " enable fast terminal connection
let mapleader=','                                " leader key
syntax on                                        " enable syntax highlighting
filetype plugin indent on                        " enable filetype detection
autocmd BufNewFile,BufRead *.tt setf tt2html     " enable TT2 filetype detect
autocmd ColorScheme * highlight Normal ctermbg=NONE
colorscheme onedark