Support `gui_running`
It would be nice to be able to detect vimR running in the rc file, like gvim / MacVim support. For example:
if has('gui_running')
" set a special colorscheme
endif
A common alternative - hooking the GUIEnter event - also doesn't work:
autocmd GUIEnter * colorscheme elflord
There's gui_vimr flag as described in the wiki.
Awesome, missed it
FWIW, I'd like to see vimr support gui_running as well for consistency with other vim GUIs.
The goyo plugin uses has('gui_running') to detect which highlights it has to set to create its "distraction free" writing environment, cf. https://github.com/junegunn/goyo.vim/blob/057fe68e442e7d4ffa45a3c992389e19e64abc7c/autoload/goyo.vim#L36
As a result, Goyo inside VimR doesn't realize it's being run in a GUI, which causes problems like this: https://github.com/junegunn/goyo.vim/issues/71
In principle, that line in the goyo plugin could be modified to include has("gui_vimr"). However, while it's fine to have has("gui_vimr") to detect VimR specifically, I would strongly suggest that has('gui_running') should also be true: It's a standard flag, and plugins (goyo or others) depend on it. Plugins can't possibly anticipate a custom flag for every possible vim GUI program.
Incidentally, this problem seems to be a regression: goyo works fine with VimR Version 0.24.0 (282), but not VimR Version 0.26.8 (311).