Tuesday, February 1, 2011

Re: Determining if Vim is running in text-console mode or X Windows

* Steve Laurie <mr.steven.laurie@gmail.com> [110201 06:57]:
> Thanks for your help. unfortunately, none of these suggestions work.

Hmm. You say in your original message that you have tried
has("gui_running"). This works for me (and has for a long time).

As a test, I put

let my_has_gui_running = has("gui_running")

early in my .vimrc. If I start vim from the command line and type

:echo my_has_gui_running

I get 0. If I do the same with gvim (or vim -g) I get 1. Using

if has("gui_running")
echo "has gui_running"
else
echo "does not have gui_running"
endif

in .vimrc prints (to the terminal before setting up the vim screen) the
correct string for both vim and gvim.

I am using vim 7.2.445 from Debian squeeze.

...Marvin

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: