posts - 33,  comments - 70,  trackbacks - 0
MacVim takes vim and provides better integration with Apple’s OS X - I’ve only just started using it and I am already loving it. Provided along with the application is a wrapper-script written to handle calls from the command-line:

cd project
mvim project_file.php

MacVim supports tabs, but unfortunately calling mvim multiple times from the command-line results in multiple separate windows opening, instead of multiple tabs in one window. I made the following modifications to the mvim script to correct this.

Add the following line to the top of the file, below the commented section:

tabs=true

Replace the if structure at the bottom of the file with the following:

# Last step:  fire up vim.
if [ "$gui" ]; then
  
if $tabs && [[ `$binary --serverlist` = "VIM" ]]; then
    exec 
"$binary" -g $opts --remote-tab-silent ${1:+"$@"}
  
else
    exec 
"$binary" -g $opts ${1:+"$@"}
  fi
else
  exec 
"$binary" $opts ${1:+"$@"}
fi


from: http://webexpose.org/2008/10/13/open-macvim-tabs-from-command-line/

posted on 2010-11-17 15:32 地狱男爵(hellboys) 阅读(1045) 评论(0)  编辑  收藏 所属分类: vim

只有注册用户登录后才能发表评论。


网站导航:
 
<2010年11月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

随笔分类

随笔档案

文章档案

相册

连接

最新随笔

搜索

  •  

最新评论

阅读排行榜

评论排行榜