set nocompatible " Vim settings, not vi call pathogen#infect() call pathogen#helptags() filetype plugin on filetype indent on syntax enable set t_Co=256 "set t_Co=16 "let g:solarized_termtrans=1 "set background=dark "colorscheme solarized colorscheme zenburn set tabstop=2 softtabstop=2 shiftwidth=2 expandtab set backspace=indent,eol,start set hidden " Hide buffers when switching rather than closing them set autoindent " Automatically indent set copyindent " Copy the previous line's indenting "set nowrap " Don't wrap lines set cursorline " highlight current line "set cursorcolumn " highlight current column set showmatch " Show matching parenthesis set hlsearch " Highlight search terms set incsearch " Show search matches incrementally set ic " Ignore case when searching set list set history=1000 " Commands and search history set undolevels=1000 " Lots of undo levels set nobackup set nowritebackup set noswapfile set modeline set spell set number set laststatus=2 set statusline=%f%m%r%h%w\ %=%y\ [%{&ff}]\ [%{&fenc}]\ \ \ %-8.(%l/%L,%c%V%)\ %P set shell=bash\ --login set guioptions-=ebFghlLrRtTv set guioptions=aciMp noremap :set hlsearch! noremap :set hlsearch /\%>80v.\+ noremap k gk noremap j gj noremap gk noremap gj noremap g noremap g inoremap gk inoremap gj inoremap g inoremap g let mapleader = "," nmap v :tabedit $MYVIMRC " session stuff nmap s call LoadSession() nmap ms call SaveSession() nmap rs call RemoveSession() " Shortcut to rapidly toggle 'set list' nmap l :set list! " OS X copy/paste vmap y:call system("pbcopy", getreg("\"")) nmap :call setreg("\"",system("pbpaste"))p " Use the same symbols as TextMate for tabstops and EOLs set listchars=tab:▸\ ,eol:¬ " Invisible character colors highlight NonText guifg=#4a4a59 highlight SpecialKey guifg=#4a4a59 "Use TAB to complete when typing words, else inserts TABs as usual. "Uses dictionary and source files to find matching words to complete. "See help completion for source, "Note: usual completion is on but more trouble to press all the time. "Never type the same word twice and maybe learn a new spellings! "Use the Linux dictionary when spelling is in doubt. "Window users can copy the file to their machine. function! Tab_Or_Complete() if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w' return "\" else return "\" endif endfunction inoremap =Tab_Or_Complete() set dictionary=/usr/dict/words function! StripTrailingWhitespaces() " Preparation: save last search, and cursor position. let _s=@/ let l = line('.') let c = col('.') " Do the business: %s/\s\+$//e " Clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction function! LoadSession() if argc() == 0 if filereadable( g:session_name ) execute 'source '.g:session_name endif endif endfunction function! NameSession( session_dir ) return a:session_dir.substitute( pathshorten(getcwd()), '/', '', 'g' ).'.vim' endfunction function! RemoveSession() let g:save_session = 'false' if filereadable( g:session_name ) execute '!rm '.g:session_name endif endfunction function! SaveSession() if g:save_session == 'true' if !isdirectory( g:session_dir ) call system('mkdir -p '.g:session_dir) endif execute 'mksession! '.g:session_name endif endfunction let session_dir = $HOME.'/.vim/sessions/' let session_name = NameSession( session_dir ) if has('autocmd') " Source the vimrc file after saving it autocmd BufWritePost .vimrc source $MYVIMRC " Eliminate trailing whitespace when saving files autocmd BufWritePre * call StripTrailingWhitespaces() let g:save_session = 'true' autocmd VimEnter * call LoadSession() autocmd VimLeave * call SaveSession() endif " --- Abbreviations --- iabbrev eml From: Trevor Bramble To: Cc: Bcc: Subject: Reply-To: iabbrev cheers, Cheers,Trevor iabbrev best, Best regards,Trevor BrambleBlue Box Group206.607.0660 x818 iabbrev bbcopy # Copyright (c) 2012 Blue Box Group, LLC. All Rights Reserved. iabbrev bbmodeline # vi:sw=2:ts=2:et