Thank you, this is very helpful. Is there a way to apply the same behavior also to a new tab? I would like it to start with a new buffer in the current directory. The best I came up with is :tabe %:p:e but this does not do what I want, as it edits the directory. I guess doing a cd after opening the tab would work, but don't know how to do that, and how to specify the directory of the previous tab..
Y On Jun 29, 11:07 am, björn <[email protected]> wrote: > On 29 June 2010 09:26, yoavg wrote: > > > Hi, > > Is there a way to make new windows (opened using cmd-N) to open in the > > same directory of the current window (where I pressed cmd-N from)? > > You can re-assign the menu item for "New Window" to whatever you want. > This turned out to be a bit more complicated than I thought, but I > found that the following three lines in my ~/.gvimrc did the trick: > > aun File.New\ Window > an <silent> 10.290 File.New\ Window :sil !mvim<CR> > macm File.New\ Window key=<D-n> > > Here's what they do: first unbind the current "File -> New Window" > item, then re-add the item but make it call :!mvim instead (without > the "sil" you get an annoying "Hit ENTER" message every time you hit > cmd-n, and the "<silent>" also avoids a [less obnoxious] message), and > finally bind cmd-n to the menu item. > > Check out ":e $VIMRUNTIME/menu.vim" to see how the menus are set up, > and read up on ":h macvim-menus" for more MacVim-specific menu-related > information. > > Björn -- You received this message from the "vim_mac" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
