LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 11: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, 11: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, 12:14 PM   #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 12:30 PM.
 
Old 01-31-2010, 12:28 PM   #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, 07:35 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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, 07: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, 07:59 PM   #7
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
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 06:19 PM
how to set the console font-color? minike Linux - Software 2 01-25-2007 01:21 AM
about set vi's color arcow Linux - Software 1 02-10-2006 06:14 AM
[bash] changing the color set MD3 Linux - Software 2 04-27-2005 01:38 PM
Cant set color or promt in bash outsider Linux - General 2 10-15-2001 01:26 AM


All times are GMT -5. The time now is 06:19 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration