vi () { if [ -z $DISPLAY ] ; then vim $* ; else gvim $* ; fi ; }
or
if [ $TERM = xterm ] ; then alias vi=vim ; else alias vi=gvim ; fi
or permutations thereof.
Of course, you don't need that for gvim, because it will automatically
check if $DISPLAY is set.
Arnd <><
On Sat, 10 Mar 2001, James, Rick wrote:
> Hello Cookers,
>
> Please forgive me if this is a newbie question but I know I'll get
> the right answer here. I want to add a few lines to .bashrc that go
> something like this:
>
> if [ current display=X11 ]; then
> alias vi='gvim'
> fi
>
> What's the correct syntax for inside the brackets?
>
> Cheers,
> Rick
>
>
> "If it ain't broke, don't fix it"
> -- My Daddy
>
>