Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need to test something by changing vimrc

Tags:

vim

macvim

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.

like image 939
Nick Vanderbilt Avatar asked Mar 02 '10 20:03

Nick Vanderbilt


3 Answers

: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.

like image 125
Josh Lee Avatar answered Oct 13 '22 17:10

Josh Lee


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....
like image 35
asdfg Avatar answered Oct 13 '22 16:10

asdfg


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.

like image 43
Bill Odom Avatar answered Oct 13 '22 17:10

Bill Odom