vim/bundle/peepopen/plugin/peepopen.vim @ 6bd31aa2672a

vim: yep, sure haven't committed in a while'
author Steve Losh <steve@stevelosh.com>
date Sun, 11 Jul 2010 01:35:46 -0400
parents vim/bundle/vim-peepopen/plugin/peepopen.vim@5a0b9ffa6b91
children ca0f40ced96c
" plugin/peepopen.vim
" Author:   Geoffrey Grosenbach <boss@topfunky.com>
" License:  MIT License

" Install this file as plugin/peepopen.vim.

" If you prefer Command-T, use this snippet in your .gvimrc:

" if has("gui_macvim")
"   macmenu &File.New\ Tab key=<nop>
"   map <D-t> <Plug>PeepOpen
" end

" ============================================================================

" Exit quickly when:
" - this plugin was already loaded (or disabled)
" - when 'compatible' is set
if &cp || exists("g:peepopen_loaded") && g:peepopen_loaded
  finish
endif
let g:peepopen_loaded = 1

let s:save_cpo = &cpo
set cpo&vim

function s:LaunchPeepOpenViaVim()
  let cwd = getcwd()
  silent exe "!open -a PeepOpen " . shellescape(cwd)
endfunction

command! PeepOpen :call <SID>LaunchPeepOpenViaVim()

noremap <unique> <script> <Plug>PeepOpen <SID>Launch
noremap <SID>Launch :call <SID>LaunchPeepOpenViaVim()<CR>

if !hasmapto('<Plug>PeepOpen')
  map <unique> <silent> <Leader>p <Plug>PeepOpen
endif

let &cpo = s:save_cpo
unlet s:save_cpo

" vim:set sw=2 sts=2: