LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Set VI environment - color and format (https://www.linuxquestions.org/questions/linux-newbie-8/set-vi-environment-color-and-format-785993/)

Morgandy 01-31-2010 10:01 AM

Set VI environment - color and format
 
All,

wondering what I need to do to make my VI scripts better formatted. The colorized commands, etc.., and the indents where necessary. Hope this question makes sense.

I am running Fedora and Redhate Ent 5.

thx much..

worm5252 01-31-2010 10:16 AM

I use nano for scripting so I don't have to worry about all that. It doesn't show colors but it does format nicely.

Morgandy 01-31-2010 11:14 AM

I got my line numbering to work in VI, but still not the coloring. I understand I will have to at somepoint edit a file to make this default for VI.

Morgandy 01-31-2010 11:28 AM

Nevermind on the latter, VI scripting....didn't realize I need the ./filename instead of just typeing filename! Whew...made me crazy.

chrism01 01-31-2010 06:35 PM

If you really want to go nuts with colours in vim, http://www.cs.cmu.edu/~maverick/VimC.../index-pl.html

worm5252 01-31-2010 06:56 PM

Thanks to your thread I got to thinking about syntax highlighting and sorted out for nano.

it is much easier in vi/vim. Edit ~/.vimrc and just add syntax on and save the file. Thats it.

bigrigdriver 01-31-2010 06:59 PM

If you look in /usr/share/vim/vim72 (or whichever version you have installed), there is a subdirectory named colors. In that directory are several colorschemes.

In you /home/<username>/.vimrc, you add an entry:
:colorscheme blue

and save the file.

Thereafter, when you start vim, that colorscheme will be used to colorize your text files.


All times are GMT -5. The time now is 12:54 AM.