Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to enable the color in my vi editor to easy capture words,etc. The problem is its not enabled. I tried to put .vimrc with "syntax enable" and tried to edit a text file but still doesn't work. I also edit /etc/vimrc and put "syntax enable".
I just realized that my centos 5 box doesnt have the syntax highlighting but my mandriva 2008 boxes has it by default. So far, the difference is in the arrangment of the directories. I'll get to bed and see if I can figure out more tomorrow.
The correct syntax is :syntax on (not the colon in front of the word syntax).
For color schemes,look in /opt/kde3/share/vim/vim62/colors/ for colorschemes. Add a line to .vimrc ;colorscheme murphy.vim (try each color scheme out to see which you like best).
/opt/kde3/share/vim/vim62/colors/? That's a weird place for vim color schemes and is obviously version dependent as well as distro dependent.
I wouldn't be surprised, running an 'enterprise distro' like centos, if you were running some 'vim.tiny' sort of thing and, if you're issuing the 'vi' command, who knows what you're running, but probably nvi which has no syntax highlighting. So I'd check the :version of my vim and make sure it had +syntax.
Another thing to think about is maybe a screwed up TERM setting.
I don't know for sure, but in Whitebox/Centos (ie RHEL) vi may very well be the real thing ie vi = vi (the orig Unix console monochrome only editor).
On most Linux distros, the cmd vi is symlinked to vim, which does have colour etc.
If someone has added vim as an extra, /opt is a reasonable place to put it.
/opt is the Suse default location for vim (as of Suse 9.3 Pro at any rate).
But /opt/kde3/? No big deal - if that's where it is, that's where it is. Just sounded strange.
-- Actually, I just remembered that there used to be a 'kvim' which was a sort of integration of vim and kde, turning it into a 'kpart', so that actually may make more sense than I was thinking.
Quote:
Originally Posted by chrism01
I don't know for sure, but in Whitebox/Centos (ie RHEL) vi may very well be the real thing ie vi = vi (the orig Unix console monochrome only editor).
On most Linux distros, the cmd vi is symlinked to vim, which does have colour etc.
If someone has added vim as an extra, /opt is a reasonable place to put it.
I already mentioned nvi. There isn't really a 'real thing' but nvi is about as close as you'll get.
Last edited by slakmagik; 02-27-2008 at 01:42 AM.
Reason: just remembered kvim
I don't know for sure, but in Whitebox/Centos (ie RHEL) vi may very well be the real thing ie vi = vi (the orig Unix console monochrome only editor).
On most Linux distros, the cmd vi is symlinked to vim, which does have colour etc.
If someone has added vim as an extra, /opt is a reasonable place to put it.
HaHA !
That helped me figure out why I didnt had syntax highlighting in my vi/vim on my CentOS 5 box. In fact, I didnt had the colors when I was root but had them on my user account.
The explanation follows :
Code:
[Phil@krumcrush ~]$ which vi
alias vi='vim'
/usr/bin/vim
[Phil@krumcrush ~]$ su root
Password:
[root@krumcrush Phil]# which vi
/bin/vi
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.