讀取VIM可變我使用一個Perl(loader.vim)腳本加載VIM模塊:(的.vimrc)源/whatever/loader.vimVIM:Perl接口,傳遞一個變量以Perl和在Perl
loader.vim:
function! LoadBundles() perl HERE while(</root/.vim/bundle/*/plugin/*>) { my ($path, $fname) =($_ =~ m|^(.+/)(.+?)$|); #VIM::Msg("$path $fname\n"); VIM::DoCommand("set runtimepath=$path"); VIM::DoCommand("runtime! $fname"); } HERE endfunction call LoadBundles()
我想這樣做LoadBundles(「/路徑/要/ bundledir」),但要做到這一點,我需要能夠從Perl的例如內讀取一個變量:
function! LoadBundles(path) let var = a:path perl HERE print "$var\n";
我該怎麼做?
我也想在perl這裏保存runtimepath,然後恢復它。如何從perl這裏讀取runtimepath?
而(根/ vim的/包/ * /插件/ *>){<< >>被錯位 – Paleywiener 2011-02-15 04:37:33