[CentOS] Where are my VIM colors?

David G. Miller dave at davenjudy.org
Sat Dec 8 16:10:29 UTC 2007


Rainer Traut <tr.ml at gmx.de> wrote:

> israel.garcia at cimex.com.cu schrieb:
>   
>> > Maybe, it's stupid question but I've just installed CentOS5 and when I'm
>> > going to edit some of my conf files I see no colors as it did in old
>> > CentOS4x...
>> > I'm using:
>> > 
>> > [root at domian:~]$ echo $TERM
>> > xterm
>>     
>
> Take a look at:
>
> # cat /etc/profile.d/vim.sh
> if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ]; then
>    [ -x /usr/bin/id ] || return
>    [ `/usr/bin/id -u` -le 100 ] && return
>    # for bash and zsh, only if no alias is already set
>    alias vi >/dev/null 2>&1 || alias vi=vim
> fi
>
> So you do not get vim for root...
>
> Hth
> Rainer
Right answer.  I just checked on my CentOS 4.5 box and:

[root at fraud default]# which vi
alias vi='vim'
        /usr/bin/vim

but on my CentOS 5.1 box root gets:

[root at bend etc]# which vi
/bin/vi

while users get:

[dave at bend ~]# which vi
vi:      aliased to vim

So vim is probably correctly installed on the 5.1 box but root no longer 
gets an alias to it.  This is actually correct since root should be able 
to log in and have full functionality with just the programs in /bin, 
/sbin, etc.  In particular, root shouldn't be dependent on anything 
under /usr.

Cheers,
Dave

-- 
Politics, n. Strife of interests masquerading as a contest of principles.
-- Ambrose Bierce




More information about the CentOS mailing list