Created
August 18, 2011 19:44
-
-
Save dbb/1154978 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ReloadConfigs() | |
:source ~/.vimrc | |
if has("gui_running") | |
:source ~/.gvimrc | |
endif | |
endfunction | |
command! Recfg call ReloadConfigs() | |
" error: function already exists, add ! to replace it | |
function! ReloadConfigs() | |
:source ~/.vimrc | |
if has("gui_running") | |
:source ~/.gvimrc | |
endif | |
endfunction | |
command! Recfg call ReloadConfigs() | |
" error: cannot replace function, it is in use |
The problem is that I have to source %
then source ~/.gvimrc
when I'm working in gvim.
I opened a SO thread about it: http://stackoverflow.com/questions/7114744/function-to-source-vimrc-and-gvimrc
It seems like using the if has("gui_running")
approach might be the simplest solution.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't off the top of my head, but it reminded me of this that I ran into a few months ago: http://dailyvim.blogspot.com/2008/11/reload-vimrc.html