Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Feb 2002 20:10:44 -0800
From:      Danny Howard <dannyman@toldme.com>
To:        "David S. Jackson" <deepbsd@earthlink.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: VIM and .vimrc
Message-ID:  <20020224201044.P6477@pianosa.catch22.org>
In-Reply-To: <20020222205151.A23269@sylvester.dsj.net>; from deepbsd@earthlink.net on Fri, Feb 22, 2002 at 08:51:51PM -0500
References:  <20020222205151.A23269@sylvester.dsj.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Feb 22, 2002 at 08:51:51PM -0500, David S. Jackson wrote:
> Hi,
> 
> I'm still looking for the answer to this in :help and on vim.org,
> but no joy so far.
> 
> I want to dynamically set the term for vim in my .vimrc:  I want
> vim to detect whether it's being run in an xterm (or the like) or
> in a tty.  The logic would be something like:
> 
>   if "this is an xterm "
>      set term=xterm-color
>   else
>      set term=builtin_pcansi
>   fi   
> 
> How can I say this in my .vimrc?

You probably want your shell to be able to figure this out.

I used to have the following in my .cshrc:
if( $TERM == 'xterm' || $TERM == 'ansi' ) then
   setenv TERM xterm-color
endif

I did that so mutt would use the xterm-color termcap entry, or somesuch.

Vim just asks your login shell what the value of $TERM is.

-danny

-- 
http://dannyman.toldme.com/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020224201044.P6477>