Hi, How can I have vi with syntax hilghting for root ? Regular users have it, but not root's. I've seen the hidden files of a regular user home, but found nothing. Thanks in advance. Warm Regards, M?rio Gamito
On Fri, Mar 7, 2008 at 12:42 PM, M?rio Gamito <gamito at gmail.com> wrote:> > How can I have vi with syntax hilghting for root ? > Regular users have it, but not root's. > > I've seen the hidden files of a regular user home, but found nothing.Do "vim file" instead of "vi file". As root "vi" gets you a standard UNIX vi, "vim" gets you the enhanced vi with colors etc. Regards, Tim -- Tim Verhoeven - tim.verhoeven.be at gmail.com - 0479 / 88 11 83 Hoping the problem magically goes away by ignoring it is the "microsoft approach to programming" and should never be allowed. (Linus Torvalds)
M?rio Gamito wrote:> Hi, > > How can I have vi with syntax hilghting for root ? > Regular users have it, but not root's.:sy on also works for root, but the automatical stuff has been taken out of vim for the root user (too dangerous to automatically run stuff). Cheers, Ralph -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20080307/990e71d7/attachment-0002.sig>
M?rio Gamito wrote:> > How can I have vi with syntax hilghting for root ? > Regular users have it, but not root's. > > I've seen the hidden files of a regular user home, but found nothing.1. use vim instead of vi (vi is /bin/vi , which is usually a "tiny" vim with few features) 2. put into /root/.vim : set nocp filetype plugin on syn on Regards, Chip Campbell
do you have the vim-enhanced package installed? -------------- Original message from Charles E Campbell Jr <charles.e.campbell at nasa.gov>: --------------> M?rio Gamito wrote: > > > > How can I have vi with syntax hilghting for root ? > > Regular users have it, but not root's. > > > > I've seen the hidden files of a regular user home, but found nothing. > 1. use vim instead of vi (vi is /bin/vi , which is usually a "tiny" vim > with few features) > 2. put into /root/.vim : > set nocp > filetype plugin on > syn on > > Regards, > Chip Campbell > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20080307/92a3fe87/attachment-0002.html>
Mario Gamito <gamito at gmail.com> wrote:> Hi, > > How can I have vi with syntax hilghting for root ? > Regular users have it, but not root's. > > I've seen the hidden files of a regular user home, but found nothing. > > Thanks in advance. > > Warm Regards, > M?rio GamitoThis was discussed previously soon after CentOS 5.0 was released. The upstream distribution changed root from using vim (with syntax highlighting) to using vi. With the 4.X versions root was using vim. The 5.X configuration is: [root at bend ~]# which vi /bin/vi [dave at bend ~]# which vi vi: aliased to vim [dave at bend ~]# which vim /usr/bin/vim The idea is that vi is in /bin which should be available if the system can boot at all. Stuff under /usr may be in a different partition and, thus, may not be available for some reason. Cheers, Dave -- Politics, n. Strife of interests masquerading as a contest of principles. -- Ambrose Bierce
On Fri, Mar 7, 2008 at 6:42 AM, M?rio Gamito <gamito at gmail.com> wrote:> Hi, > > How can I have vi with syntax hilghting for root ? > Regular users have it, but not root's. > > I've seen the hidden files of a regular user home, but found nothing.yum install vim-common vim-enhanced -- -matt
On Fri, 7 Mar 2008, M?rio Gamito wrote:> Hi, > > How can I have vi with syntax hilghting for root ? > Regular users have it, but not root's. > > I've seen the hidden files of a regular user home, but found nothing.In /etc/profile.d/vim.sh, comment out the line which contains the following: [ `//usr/bin/id -u` -le 100 ] && return In my version, it is line 3. Logout and log back in and presto you have colors, assuming you have the proper packages installed. Make sure you understand the implications of doing this before you do this. Regards, -- Tom Diehl tdiehl at rogueind.com Spamtrap address mtd123 at rogueind.com
M?rio Gamito wrote:> Hi, > > How can I have vi with syntax hilghting for root ? > Regular users have it, but not root's. > > I've seen the hidden files of a regular user home, but found nothing. >And one last way if vim-enhanced is installed ... put this in the /root/.bashrc alias vi='vim' -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature URL: <http://lists.centos.org/pipermail/centos/attachments/20080309/4cd5e798/attachment-0002.sig>
Erek Dyskant <erek at blumenthals.com> wrote:> This was discussed previously soon after CentOS 5.0 was released. The > > upstream distribution changed root from using vim (with syntax > > highlighting) to using vi. With the 4.X versions root was using vim. > > The 5.X configuration is: > > > > [root at bend ~]# which vi > > /bin/vi > > > > [dave at bend ~]# which vi > > vi: aliased to vim > > [dave at bend ~]# which vim > > /usr/bin/vim > > In theory, programs in /bin are statically linked, so they work even > when you have library issues going on. Anyway, just use the vim command > explicitly or add alias vi=vim to your ~root/.profileThe static linking part is no longer true: [root at bend ~]# ls -l /bin/vi -rwxr-xr-x 1 root root 628808 May 9 2007 /bin/vi [root at bend ~]# file /bin/vi /bin/vi: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped I would guess that any shared libraries used by vi are in or under /lib. That way the required libraries should also always be available. Just for comparison, the executable for vim is quite a bit bigger: [root at bend ~]# ls -l /usr/bin/vim -rwxr-xr-x 1 root root 2817056 May 9 2007 /usr/bin/vim This is just another example of the upstream distribution being very conservative for possibly several different reasons. There are also a number of ways to override their choice. I just wanted to point out that the change from vim to vi for root was intentional. Someone changing it back should understand the implications of what they're doing. Cheers, Dave -- Politics, n. Strife of interests masquerading as a contest of principles. -- Ambrose Bierce