PeepOpen-Issues icon indicating copy to clipboard operation
PeepOpen-Issues copied to clipboard

MacVim Configuration Alternate

Open topfunky opened this issue 15 years ago • 2 comments

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

topfunky avatar Jun 15 '10 00:06 topfunky

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

acoffman avatar Oct 30 '10 05:10 acoffman

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)

ghost avatar Sep 05 '11 19:09 ghost