" ek - vimrc "========================================================================= syntax on " tabs are used everywhere when tabstop=softtabstop and noexpandtab set tabstop=4 set shiftwidth=4 set noexpandtab set ruler set autoindent set textwidth=80 set history=50 set showcmd set shiftround map ,ht :set syntax=html set pastetoggle= " disable autoindent for pasting w/ " toggle paste / mouse mode map :call InvertPasteAndMouse() fun! InvertPasteAndMouse() if &mouse == '' set mouse=a | set nopaste echo "mouse mode on, paste mode off" else set mouse= | set paste echo "mouse mode off, paste mode on" endif endfunction " Handle ruby files - 2 space tabstop and syntax highlighting au BufNewFile,BufRead *.rhtml set syn=eruby | set softtabstop=2 | set ts=2 | set sw=2 " Two space tabstop for html and ruby au BufNewFile,BufRead *.rb,*.html,*.xhtml,*.xml,*.css set softtabstop=2 | set ts=2 | set sw=2 " map function keys for turning syntax highlighting on and off map :if exists("syntax_on") syntax off else syntax on endif " Only execute when compiled with support for autocommands if has("autocmd") " Enable file type detection, use defaults, load indent files filetype plugin indent on " set tw=80 for all text files autocmd FileType text setlocal textwidth=80 " When editing, jump to last known cursor position, unless invalid autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif autocmd BufEnter * :lcd %:p:h " ek - php autocmd FileType php set omnifunc=phpcomplete#CompletePHP autocmd FileType php noremap :w:!php % "autocmd FileType php noremap :w!:!phpunit % autocmd FileType php noremap :w:!phpunit --verbose --bootstrap=/home/ekingery/sittercity/sc-integration/www/docroot/index.php % autocmd FileType php noremap :w:!phpunit --verbose --group=current --bootstrap=/home/ekingery/sittercity/sc-integration/www/docroot/index.php % autocmd FileType php noremap :w:!php -l % autocmd FileType php noremap :w:!phpcs --tab-width=4 % " remove trailing whitespace autocmd BufWritePost *.php :%s/\s\+$//e endif " has("autocmd") " ek - php "========================================================================= let php_sql_query=1 let php_htmlInStrings=1 let php_noShortTags=1 let php_folding=1 set tags=~/.vim/ek_ctags/sc-integration " ek - stolen from Damian Conway "========================================================================= "=====[ Make Visual modes work better ]=========================== " Visual Block mode is far more common than Visual mode nnoremap v nnoremap v " Make BS/DEL work as expected in visual modes vmap x " Square up visual selections set virtualedit=block set title " Show filename in titlebar of window set titleold= set nomore " Don't page long listings set backspace=indent,eol,start "BS past autoindents, line boundaries, start " of insertion set background=dark " When guessing, guess bg is dark set fileformats=unix,mac,dos set wildmode=list:longest,full set updatecount=10 set incsearch set ignorecase set smartcase set hlsearch " Switch off highlighting until next search map H :nohlsearch " Forward/back one file map :next0 map :prev0 " Add new highlight combinations highlight YELLOW_ON_BLACK ctermfg=yellow ctermbg=black set scrolloff=2 " Scroll when 2 lines from top/bottom