I have installed CentOS 4.5 and 5 on 2 separate machines, and both have default installs of vim-enhanced on each of them. I noticed that I can get syntax highlighting as a regular user, sudo and as root in C4.5. In C5 I only get highlighting as a regular user. I diff'ed my /etc/vimrc files between each install there is no changes and neither root ~ has a .vimrc file. I had put "# vim: filetype=apache ts=4 sw=4 et" at the bottom of the apache conf file and it works great except when I 'sudo vim' or use root in c5. I tried :syntax on, as root and it didn't make a difference either. CentOS 5: $ rpm -qa vim* vim-common-7.0.109-3.el5.3 vim-minimal-7.0.109-3.el5.3 vim-enhanced-7.0.109-3.el5.3 CentOS 4: $ rpm -qa vim* vim-minimal-6.3.046-0.40E.7 vim-common-6.3.046-0.40E.7 vim-enhanced-6.3.046-0.40E.7 Is there something I am missing? Thanks, Rick
On 6/28/07, Rick Barnes <linux at sitevision.com> wrote:> I have installed CentOS 4.5 and 5 on 2 separate machines, and both have > default installs of vim-enhanced on each of them. > > I noticed that I can get syntax highlighting as a regular user, sudo and > as root in C4.5. In C5 I only get highlighting as a regular user. > > I diff'ed my /etc/vimrc files between each install there is no changes > and neither root ~ has a .vimrc file. > > I had put "# vim: filetype=apache ts=4 sw=4 et" at the bottom of the > apache conf file and it works great except when I 'sudo vim' or use > root in c5. > > I tried :syntax on, as root and it didn't make a difference either. > > CentOS 5: > $ rpm -qa vim* > vim-common-7.0.109-3.el5.3 > vim-minimal-7.0.109-3.el5.3 > vim-enhanced-7.0.109-3.el5.3 > > CentOS 4: > $ rpm -qa vim* > vim-minimal-6.3.046-0.40E.7 > vim-common-6.3.046-0.40E.7 > vim-enhanced-6.3.046-0.40E.7 > > Is there something I am missing? >The hearsay answer (heard from a friend of a friend of a friend who uses vi). vim changed how much stuff they did by default for the root user to bypass possible attacks.. The other story was that if you need that kind of stuff when you are root.. you might as well be using emacs like the other sissy boys do. But this was from someone who thinks that vi should fit under 50k. -- Stephen J Smoogen. -- CSIRT/Linux System Administrator How far that little candle throws his beams! So shines a good deed in a naughty world. = Shakespeare. "The Merchant of Venice"
Rick Barnes wrote:>I have installed CentOS 4.5 and 5 on 2 separate machines, and both have >default installs of vim-enhanced on each of them. > >I noticed that I can get syntax highlighting as a regular user, sudo and >as root in C4.5. In C5 I only get highlighting as a regular user. > >* Check that your /etc/vimrc is actually being loaded: vim -V should produce verbose details on what is being sourced by vim. * Another check: do vim --version and make sure that +syntax shows up. I usually use /root/.vimrc to do root-specific vim stuff, myself. Regards, Chip Campbell
On 28/06/07, Rick Barnes <linux at sitevision.com> wrote:> I have installed CentOS 4.5 and 5 on 2 separate machines, and both have > default installs of vim-enhanced on each of them. > > I noticed that I can get syntax highlighting as a regular user, sudo and > as root in C4.5. In C5 I only get highlighting as a regular user.Check to see if there's an alias for vi -> vim as a normal user where root doesn't. Will.