1

Is is worth moving gui-related options out of my vimrc and into a gvimrc if there's only a couple such options? I'm kind of inclined to keep everything in one place and house gui options inside if statements, but is there a compelling argument to do otherwise?

1 Answer 1

5

As long as you don't depend on the execution order (.vimrc is sourced first, .gvimrc last, after all plugins; most options have no such dependency), it's an arbitrary decision where to place the GUI-only settings.

You can just put those into ~/.vimrc, surrounded by

:if has('gui_running')
    ..
:endif

Caveat

Apparently, if you start terminal Vim and only later switch to GUI mode (via :gui; this works f.e. on Linux Vim), the .gvimrc file is belatedly sourced, so that's one special case where your consolidated approach wouldn't work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .