topfunky / PeepOpen-Issues

Bug reports and feature requests for the PeepOpen application
http://peepcode.com/products/peepopen
41 stars 1 forks source link

MacVim Configuration Alternate #87

Open topfunky opened 14 years ago

topfunky commented 14 years ago

This was contributed by a user and may work better for maintaining the current directory in MacVim:

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
acoffman commented 13 years ago

Thank you! This works much better. The default handling of current directory made it almost unusable.

ghost commented 12 years ago

I typically let MacVim be long-lived, and the directory from which I launched it isn't necessarily germane to PeepOpen.

I'd rather have PeepOpen's root be set to the root of whatever git repo I'm currently working under ... fortunately with Fugitive.vim this is pretty easy:

map <unique> <silent> <leader>t :Gcd<CR> <Plug>PeepOpen

Note this actually won't work with the above alternate configuration, which caches the cwd at MacVim launch, but does work with the default PeepOpen configuration which calls cwd() each time PeepOpen is called.

(Background explanation - :Gcd executes a "cd" relative to the current file's git repo, so ":Gcd" with no arguments cd's into the root dir of the repo)