small pixel drawing of a pufferfish dotfiles

.vimrc

syntax on
colors patine

" weird defaults
set tabstop=4
set shiftwidth=4
set scrolloff=10
set hlsearch
set smartcase
set timeoutlen=1000 ttimeoutlen=0 " esc is immediate
set t_Co=256 " it's 2019 ffs
set backspace=indent,eol,start
set wildmode=longest,list,full
map <F1> <Esc>
imap <F1> <Esc>

" Protect changes between writes. Default values of
" updatecount (200 keystrokes) and updatetime
" (4 seconds) are fine
set swapfile
set directory^=~/.vim/swap//

" protect against crash-during-write
set writebackup
" but do not persist backup after successful write
set nobackup
" use rename-and-write-new method whenever safe
set backupcopy=auto
" patch required to honor double slash at end
set backupdir^=~/.vim/backup//

" persist the undo tree for each file
set undofile
set undodir^=~/.vim/undo//

" quickfix shortcuts
nmap ]q :cnext<cr>
nmap ]Q :clast<cr>
nmap [q :cprev<cr>
nmap [Q :cfirst<cr>

" shortcutz
nnoremap <CR> :nohlsearch<CR><CR> " enter clears hl
map <silent> <F4> :make<cr><cr><cr> " make all the things
set pastetoggle=<C-p> " control+p to toggle pasting

" mail
autocmd FileType mail setlocal tw=72 spell spelllang=en

" markdown
autocmd FileType markdown setlocal noruler spell spelllang=en

" ruby
autocmd FileType ruby setlocal sw=2 sts=2 expandtab

" yaml
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab