execute pathogen#infect() "Turn on syntax highlighting syntax on " Colors set background=dark colorscheme sahara hi Search cterm=NONE ctermfg=white ctermbg=red "Disable vi-compatible backspace behavior set backspace=indent,eol,start "Disable vi compatibility (may be redundant with above) set nocompatible "Default character encoding set encoding=utf-8 set fileencoding=utf-8 " All unix, all the time set ffs=unix set ff=unix " Indentation stuff " 2-space everything set tabstop=2 set softtabstop=2 set shiftwidth=2 set expandtab " Old school set textwidth=80 " Auto wrap long lines set formatoptions+=t set autoindent set smartindent set smarttab " Look and feel set encoding=utf-8 set number set relativenumber set wildmenu set showmatch " Silence is golden set noerrorbells set novisualbell " Searching things set incsearch set hlsearch set ignorecase set smartcase " Visually display whitespace (this prevents slowness from match command) set list set listchars=tab:>>,trail:-,nbsp:+ "Display each keystroke in the status line set showcmd "Always show the status line set laststatus=2 set hidden " Remapping things let mapleader="," nnoremap :nohlsearch " Making my life hard on purpose so it is easier later... nnoremap nnoremap nnoremap nnoremap nnoremap nnoremap nnoremap nnoremap nnoremap vnoremap vnoremap vnoremap vnoremap vnoremap vnoremap vnoremap vnoremap vnoremap inoremap inoremap inoremap inoremap inoremap inoremap inoremap inoremap inoremap " Because the shift key is a lot of work nnoremap ; : inoremap ; "Toggle line numbering nmap l :setlocal number! "Toggle paste mode nmap p :set paste! map :bnext map :bprev map :tabn map :tabp "Delete single characters without updating the default register noremap x "_x "Paste in visual mode without updating the default register vnoremap p "_dP " Backups set backup set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp set backupskip=/tmp/*,/private/tmp/* set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp set writebackup "Enable 256-color mode set t_Co=256 "Tell vim to remember certain things when we exit " '10 marks will be remembered for up to 10 previously edited files " "100 will save up to 100 lines for each register " :20 up to 20 lines of command-line history will be remembered " % saves and restores the buffer list " n... where to save the viminfo files set viminfo='10,\"100,:20,%,n~/.vim/viminfo "Function to save the cursor position of the previously opened file function! ResCur() if line("'\"") <= line("$") normal! g`" return 1 endif endfunction augroup resCur autocmd! autocmd BufWinEnter * call ResCur() augroup END "Jump five lines when scrolling at edge of screen set scrolljump=1 "Cause screen to scroll when within three lines of the edge set scrolloff=5 set sidescrolloff=5 "Enable persistent undo set undofile "Save undo history when a file is closed set undodir=$HOME/.vim/undo "Where to save undo histories (must create this dir manually) set undolevels=1000 "How many undos to save set undoreload=10000 "Number of lines to save for undo "Folding set foldmethod=indent set nofoldenable "Tell vim to interpret our .vim/after/ftplugin files filetype plugin on "Highlight .md files as markdown rather than Modula-2 autocmd BufRead,BufNewFile *.md set filetype=markdown let loaded_matchparen = 1