diff --git a/vimrc b/vimrc index ab20841..db4911b 100644 --- a/vimrc +++ b/vimrc @@ -1,5 +1,5 @@ " ~/.vimrc -" Eryn Wells +" Eryn Wells set nocompatible "use enhanced vim features @@ -31,8 +31,6 @@ set colorcolumn=80 " highlight 80th column set showmatch " show matching things: (), {}, [], etc set fo+=n " format numbered lists properly -set fo+=2 " format paragraphs with first line indent different - " from rest if has('gui_running') set list @@ -60,8 +58,10 @@ else set spellfile=~/.vim/spelling.en.add endif -set noswapfile " disable swap file -set nobackup " disable backup files +set noswapfile " don't keep swap files +set nobackup " don't keep backup files +set backupdir=~/.vim/backup + " save backup files here set undofile " save undo history set undodir=~/.vim/undo " save undo files here set history=1000 " remember 1000 commands in history @@ -129,7 +129,7 @@ if has('gui_running') if has('win32') || has('win64') set guifont=Inconsolata:h18 elseif has('mac') - set guifont=Menlo:h14 + set guifont=Menlo:h11 elseif has('linux') set guifont=Inconsolata\ 14 endif @@ -151,16 +151,12 @@ inoremap nnoremap vnoremap -" gonna give this a try... exit from insert mode with jj -inoremap jj - " make switching windows easier nnoremap h nnoremap j nnoremap k nnoremap l - function! StripTrailingWhitespace() " save last search let _s=@/ @@ -195,7 +191,8 @@ let g:CommandTAcceptSelectionTabMap='' if has('autocmd') filetype plugin indent on - autocmd BufAdd,BufEnter,BufFilePost *.md :set ft=markdown + " Markdown files can also have the .md extension + autocmd BufAdd,BufEnter,BufFilePost *.md :setlocal ft=markdown " Jump to last known cursor position unless it's the first line, or past the " end of the file @@ -204,10 +201,11 @@ if has('autocmd') \ exe "normal! g`\"" | \ endif - " Clean whitespace before saving - autocmd BufWritePre *.py,*.c,*.html :call StripTrailingWhitespace() + " Clean whitespace before saving: Python, C, HTML, and Objective-C + autocmd BufWritePre *.py,*.h,*.c,*.html,*.m + \ :call StripTrailingWhitespace() endif -if exists("~/.vimrc-local") - source ~/.vimrc-local +if exists("~/.vimrc.local") + source ~/.vimrc.local endif