Browse files

first commit

  • Loading branch information...
0 parents commit e5b7c4c446374da75fa6ef8768ed4d724d9ec6b1 @mrchrisadams committed Mar 26, 2011
Showing with 70 additions and 0 deletions.
  1. +47 −0 peepopen.vim
  2. +23 −0 readme.md
47 peepopen.vim
@@ -0,0 +1,47 @@
+" 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 g:peepopen_cwd = getcwd()
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function s:LaunchPeepOpenViaVim()
+ let cwd = g:peepopen_cwd
+ 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:
+
23 readme.md
@@ -0,0 +1,23 @@
+This isn't my plugin per se - I use [Janus][] flavoured [MacVim][] and [PeepOpen][] together, and
+whenever I'd rebuild Vim, I'd always have to remember after upgrading to
+open Peepopen independently of Vim, and then hit 'install MacVim
+Plugin'.
+
+When I found out that all Peepopen was doing was putting a plugin in
+`.vim/plugins`, the simplest thing to do seems to be create a repo
+somewhere, and pull in the Peepopen Plugin when running an upgrade, or
+building it.
+
+### How to use this
+
+Add the following line to your janus Rakefile, and it should be pulled
+in when building Vim's plugins:
+
+ vim_plugin_task "peepopen", "git://github.com/mrchrisadams/vim-peepopen.git"
+
+And PeepOpen should be available to you without having to explicitly click 'install plugin any more'
+
+<!-- links-->
+[MacVim]: 'http://code.google.com/p/macvim/'
+[Janus]: 'https://github.com/carlhuda/janus'
+[PeepOpen]: 'http://peepcode.com/products/peepopen'

0 comments on commit e5b7c4c

Please sign in to comment.