From owner-freebsd-questions Sun Feb 24 20:10:50 2002 Delivered-To: freebsd-questions@freebsd.org Received: from pianosa.catch22.org (pianosa.catch22.org [64.81.48.19]) by hub.freebsd.org (Postfix) with ESMTP id F403937B402 for ; Sun, 24 Feb 2002 20:10:44 -0800 (PST) Received: by pianosa.catch22.org (Postfix, from userid 1006) id 6BA7147E; Sun, 24 Feb 2002 20:10:44 -0800 (PST) Date: Sun, 24 Feb 2002 20:10:44 -0800 From: Danny Howard To: "David S. Jackson" Cc: freebsd-questions@freebsd.org Subject: Re: VIM and .vimrc Message-ID: <20020224201044.P6477@pianosa.catch22.org> References: <20020222205151.A23269@sylvester.dsj.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020222205151.A23269@sylvester.dsj.net>; from deepbsd@earthlink.net on Fri, Feb 22, 2002 at 08:51:51PM -0500 X-Loop: djhoward@uiuc.edu Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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