I run Vim using both gVim and in terminal.
Basically, I want to enable a certain colorscheme in my vimrc but only when in gVim, as the theme looks terrible in terminal.
How do I accomplish this?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
You can check if your vim runs in gui:
if has("gui_running") colo koehler else colo darkblue endif
You can also use
gvimrc file (
:h gvimrc) instead.
The drawback is that you would have colorscheme run twice (one in vimrc, another in gvimrc) for gVim unless you guard it in vimrc, again, with
if !has("gui_running") colo darkblue endif