Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
I recently installed vim on a server at work. When I edit a source code file with vim, I see various fonts (plain and bold) in various shades of grey. However, on my A2 Web Hosting shell account, when I vim a file, I see pretty colors.
What do I have to do to see pretty colors on a vim screen on my server at work? I have my bash shell showing pretty colors, so I know the problem is not with my terminal window (WRQ Reflections for Unix/Digital).
IIRC, you go into vim and type :syntax=on to enable syntax highlighting by file.
(I think... Mine just keeps telling me that "E319: Sorry, the command is not available in this version" so I can't check.)
Oh, and there should be a file in your $HOME called .vimrc (IIRC) that you can add this to, so that it's always on. /* Prays that he's got this right... */
Type 'runtime syntax/colortest.vim' to make sure you do in fact have the ability to display color from the server. (I know you said it did, but just to be sure! )
If the above worked, try editing the .vimrc file in your home directory to include the following lines:
Code:
" Set syntax highlighting to always on
syntax enable
" Set the background to dark and the colorscheme to murphy
set background=dark
colorscheme murphy
" Set automatic filetype detection to on
filetype on
That should at least get you some color. You certainly don't have to keep the murphy colorscheme...I just included that bit so you'd have a color scheme to start with.
I will warn you that the page may take a long time to load on a slow connection since there are almost 300 pictures showing the various colorscheme/background combos!
i'm okay with my colorscheme, but i was just trying this out of curiosity, and i get this error message:
Code:
jeff@bart:~ $ vim .vimrc
Error detected while processing /home/jeff/.vimrc:
line 6:
E518: Unknown option: colorscheme
Press ENTER or type command to continue
it works when i issue the command from within vim, though. any idea what might be wrong?
Thanks for catching that. I mistakenly put the 'set' in front of 'colorscheme' in my code above. I have since removed the 'set'...the correct option in your .vimrc should be:
After I corrected that "set colorscheme" defect, I start vi on an html file, and I see a lot of formatting, but no color. It's underlining angle brackets and changing the weight of the font for paragraph, title etc. elements in the html, but its not showing it in color.
What do I have to do to see pretty colors on a vim screen on my server at work? I have my bash shell showing pretty colors, so I know the problem is not with my terminal window (WRQ Reflections for Unix/Digital).
Although your terminal window might be capable of displaying text in colors, it still has to tell vim that it can. For example, different term windows (xterm vs rxvt) may have slightly different color capabilities. Within vim, do ":h color-xterm" and see if one of the settings in there will work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.