tags:

views:

202

answers:

2

Is there a way to set up MacVim to open a new file in the current window in a running MacVim instance? I currently have the MacVim preference "Open new files in a new tab in the current window" set, but ideally I'd just like to open new files the way ":e new_file" works, without the tabs.

My main motivation is that I currently use NERDTree and Bufexplorer for my workflow and don't need the tabs at all. I'm also using PeepOpen, which is awesome except it always opens files based on MacVim's preferences, so the best I can do is get it to open in the current MacVim window with a new tab.

A: 

This is how I accomplished this:

In VIM, there's a command "tabo", which makes the current tab the only tab. I added the following to my ~/.vimrc:

autocmd BufWinEnter,BufNewFile * silent tabo

This makes it so that any time I create a new buffer or enter a new buffer, the current tab becomes the only tab automatically. This command doesn't affect my buffers, so the effect is exactly what I want: open a file in the current instance of MacVim and don't add any new tabs.

davertron
A: 
  1. Update to MacVim 7.3
  2. Go into the General Preferences
  3. Under "Open files from applications:" choose "in the current window"
  4. In the pull down menu below this option select "and set the arglist"
Björn Winckler