theCAT
  
Report a Problem:
Email: support@cat.pdx.edu
Phone: 503-725-5420
  USERS PLATFORMS SYSTEM RESOURCES    
Home Students Fac/Staff CS Tutors Guidelines Windows Linux Unix Mac Mail Network Software Web TheCAT Sitemap
arrowHome arrow CS Tutors arrow Tips & Tricks arrow Vi Tips Archive Thursday, 09 February 2012  
Tips & Tricks
Vi Tips Archive Print
Tuesday, 25 April 2006

 

Archived Tip Title
Submitted by
Color Syntax Highlighting with VIM
Ki Yung Ahn
Some VI Dotfile Settings
Larry Leach


 

Color Syntax Highlighting With Vim

Submitted by: Ki Yung Ahn 

Vim can display colors to highlight your code when your terminal is properly set. Many terminal programs can show colors.

In csh shell or tcsh shell, try this:

$> set term=xterm-color

$> vim ~/.vimrc

In bash shell, try this:

$> export term=xterm-color

$> vim ~/.vimrc

You may see syntax highlighting with colors. Vim automatically highlights syntax by filename suffixes. Vim distrution has syntax highlighting support for many languages including c, c++, java, html, and many others. This helps you to view your source code more easily.

If syntax highlight doesn't start you can use the command:

:syntax on

if you want to turn of the syntax highlighting use the following command:

:syntax off 

You can also save terminal settings in the shell configureation file. Ask the tutors for help with this if you want to make your terminal show colors by default. 

 

Some Vi Dotfile Settings

Submitted by Larry Leach 

Vi is the visual frontend for the old ex editor. So the config file is.exrc

I set it up with the following lines...

set number
set noerrorbells
set showmode


Set number gives me line numbers on one side of the screen

Set noerrorbells
shuts up the bell

Set showmode puts up a little "insert' tag at the bottom of the screenwhen I'm in VI's insert mode.

 

Last Updated ( Tuesday, 09 May 2006 )
relics - Intel Hypercube
relics - Intel Hypercube
Upcoming Events
There are no upcoming events currently scheduled.
View Full Calendar

©1999 - 2012 TheCAT