A.J.Mechelynck wrote:
Robert Hicks wrote:
[...]
I only use a .vimrc and for the things that are gui specific I wrap in:
if has("gui_running")
" stuff for gvim
endif
Is there any reason NOT to do that if I only want to maintain one
config file?
Robert
I do that too. For the settings which must wait until the GUI starts
(like setting t_vb again) I use instead something like
if has("gui")
autocommand GUIEnter * set t_vb=
endif
which, however, does rely on +autocmd being compiled-in. This is not
really a problem for me, since in the rare cases when I use a "tiny"
version of Vim, it is not GUI-enabled.
With Unix versions of gvim, it is possible to start a GUI-enabled Vim in
console mode, do some editing (so has("gui_running") is off while
sourcing the vimrc) and later change one's mind and use the :gui command
to start the GUI. In practice I don't do that, however, so (in practice)
when has("gui_running") is false, I'm not going to go from console mode
to GUI mode in the course of the current session.
I think that what it comes to in the end is a question of personal
preference.
Er so it is safer to use:
if has("gui")
I didn't know you could do that with Vim myself. If I am on the console
I use vim and if I want the gui version I type gvim.
Robert