10

However already opened mvim windows do not load changed done to vimrc until I close all mvim windows and start fresh.

Is there a way I can tell existing mvim windows to load new vimrc file without closing and opening all windows every time.

Nick Vanderbilt
  • 36,724
  • 29
  • 83
  • 106

3 Answers3

15

:source ~/.vimrc

But that won’t unset options that you got rid of, so if you want to test some behavior, opening a new Vim is the only way to be sure.

Josh Lee
  • 171,072
  • 38
  • 269
  • 275
6

A suggestion,
You can also map <F2> for reloading the vimrc file like this,

 map <F2> :source $MYVIMRC<CR>:echoe "Vimrc Reloaded!!!"<CR>
I cannot add comments, so posting as an answer....
asdfg
  • 2,541
  • 2
  • 26
  • 25
1

Check the MacVim Advanced Preferences dialog (MacVim -> Preferences... -> "Advanced" tab) to see if you have "Enable Quickstart" checked. Here's the explanation from the dialog box:

New windows open instantaneously with Quickstart enabled but they may not have the latest runtime files sourced. If you modify your runtime files (e.g. files inside the ~/.vim directory) then you may need to disable and re-enable Quickstart to ensure that the next window you open will pick up on those changes.

I leave Quickstart disabled, so new MacVim windows load the .vimrc, .gvimrc, etc., fresh each time.

Bill Odom
  • 4,143
  • 24
  • 20
  • I've disabled Quickstart but sourcing my `.vimrc` doesn't seem to work for the window in which it was sourced. – Will Nov 20 '12 at 08:21