LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-31-2010, 10:01 AM   #1
Morgandy
LQ Newbie
 
Registered: Dec 2009
Location: Cleveland
Posts: 16

Rep: Reputation: 0
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..
 
Old 01-31-2010, 10:16 AM   #2
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567

Rep: Reputation: 57
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.
 
Old 01-31-2010, 11:14 AM   #3
Morgandy
LQ Newbie
 
Registered: Dec 2009
Location: Cleveland
Posts: 16

Original Poster
Rep: Reputation: 0
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.

Last edited by Morgandy; 01-31-2010 at 11:30 AM.
 
Old 01-31-2010, 11:28 AM   #4
Morgandy
LQ Newbie
 
Registered: Dec 2009
Location: Cleveland
Posts: 16

Original Poster
Rep: Reputation: 0
Nevermind on the latter, VI scripting....didn't realize I need the ./filename instead of just typeing filename! Whew...made me crazy.
 
Old 01-31-2010, 06:35 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
If you really want to go nuts with colours in vim, http://www.cs.cmu.edu/~maverick/VimC.../index-pl.html
 
Old 01-31-2010, 06:56 PM   #6
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567

Rep: Reputation: 57
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.
 
Old 01-31-2010, 06:59 PM   #7
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Set color to RXVT bluesheet Linux - General 4 09-01-2007 05:19 PM
how to set the console font-color? minike Linux - Software 2 01-25-2007 12:21 AM
about set vi's color arcow Linux - Software 1 02-10-2006 05:14 AM
[bash] changing the color set MD3 Linux - Software 2 04-27-2005 12:38 PM
Cant set color or promt in bash outsider Linux - General 2 10-15-2001 12:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration