Re: Conditional statement in .vimrc to check if gui or terminal version

690 views
Skip to first unread message

Kyle Lippincott

unread,
Oct 15, 2012, 8:16:49 PM10/15/12
to vim...@googlegroups.com
On linux, I believe it's:
if has("gui_running")

I haven't tested if that works in macvim, but if it doesn't, then that should be filed as a bug.

On Mon, Oct 15, 2012 at 8:32 AM, Aaron Cruz <pferde...@gmail.com> wrote:
I am having problems with the solarized dark colorscheme showing up correctly on my terminal version of MacVim because I don't want to use the solarized **terminal** theme as well.
I just found the `if has("gui_macvim")` statement but it is getting a true also for my terminal version of MacVim.
I would be happy solving this with a conditional statement in my .vimrc that looked something like this.
<code>
if has("terminal_macvim")
  set background=light
endif
</code>
(This would also have to not break linux vim builds)
Does such a thing exist?
Can anyone think of another way of solving this?
The use case is that I tend to use the terminal version for one off scripts and configs and the GUI version for projects that have some sort of file tree.
--
Thanks all,
aaron

--
You received this message from the "vim_mac" 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

Derek Ashley Thomas

unread,
Oct 16, 2012, 1:37:24 AM10/16/12
to vim...@googlegroups.com
Yep, it works on MacVim. 

Also, is there a reason you don't put solarized settings in gvimrc? It might simplify things for you.

Aaron Cruz

unread,
Oct 16, 2012, 5:25:21 AM10/16/12
to vim...@googlegroups.com
This is working. Fantastic. Thanks.

I just found it here https://github.com/altercation/vim-colors-solarized#modify-vimrc and was coming back to report it but you all beat me to it :P

Aaron Cruz

unread,
Oct 16, 2012, 5:28:44 AM10/16/12
to vim...@googlegroups.com
> Also, is there a reason you don't put solarized settings in gvimrc? It might simplify things for you.

I didn't know this was a thing.
My only issue of separation is that solarized on terminal mode doesn't work for me in dark mode. It even won't switch to light mode from dark mode, just brown turns pink or something. It will start in light mode though and I do like light mode. All of the other settings work in both terminal and gui macvim.

dacresni

unread,
Oct 16, 2012, 11:25:32 AM10/16/12
to vim...@googlegroups.com

I always forget about gvim

Reply all
Reply to author
Forward
0 new messages