Should I bother moving stuff from vimrc to gvimrc?

1

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?

ivan

Posted 2013-12-22T14:26:42.537

Reputation: 855

Answers

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.

Ingo Karkat

Posted 2013-12-22T14:26:42.537

Reputation: 19 513