Sections

  • Search Chrome Cow

Design a Day

Language: Lightwave 3D Lscript
Maintainer: Sean Hyde-Moyer
Contact
Last Change: Date: 2004/08/28
URL: www.chromecow.com
Version: $Id: lw_lscript.vim,v 1.0



A Few Words About Vim/gVim

Vim was originally a keyboard-only editor for hardcore programmers. When you download Vim, you get this version, and a version called gVim, which is a GUI version that will feel more familiar to most folks.

Unless you are totally enamored of keyboard shortcuts and moving through files with arrow keys instead of a mouse, I would reccomend using the gVim flavor.

Downloads

 gVim Support Files
Vim/gVim is available here: http://www.vim.org/download.php

Installing the Support Files

The installation directions assumes you are running Windows. They should be similar on the Mac, but I have no firsthand experience with a Mac installation.

First, install the editor from the above link, and be sure it’s working.

The archive contains 3 files:

  • ftdetect/lw_lscript.vim
  • lw_lscript.vim
  • smocha.vim

Installation is simple.

Extract the ftdetect folder, which contains a file called lw_lscript.vim, to your Vim install folder, which should be something like:

C:\Program Files\Vim\

You should now have:

C:\Program Files\Vim\ftdetect\lw_lscript.vim

This is the two-line vim file that tells Vim what the .ls extension is.

Next, copy the loose lw_lscript file to:

C:\Program Files\Vim\vim63\syntax\

Be sure to copy the stand-alone file called lw_lscript.vim, not the one from the ftdetect folder. They are different files.

The one you want is about 28k. This is the file that tells Vim how to highlight LScript syntax.

Finally, copy the smocha.vim to:

C:\Program Files\Vim\vim63\colors\

You might want to set your windows file associations so that .ls files are opened by gVim.

How to Use

Open an Lscript using gVim.

Now, under Edit>Color Scheme choose smocha.

That’s it! You should see a rainbow of color highlighting.

gVim Syntax Color Codes

gVim Syntax Color Codes

You can look at the lw_lscript.vim file in the syntax folder to see what keywords are associated to what groups, and you can look at the smocha.vim file to see what groups are associated with what colors.

Instructions for changing the color and syntax files are available in the gVim Help.

I’ve commented the syntax file to make it a little easier to edit.

Important: If you are going to change the colors, use the smocha.vim file as a starting point. I had to add a few non-standard color groups to cover the wide range of LScript syntax, and these do not exist in the standard Vim color files.

Using gVim Lscript: A Limitation

As of yet, I have been unable to figure out how to get Lscript to show up in the language list inside of gVim, so to use the syntax highlighting, you need to open a .ls file, which gVim will now auto-detect.

What this means is, if you are starting a new script, you need to save it and reopen it to activate the syntax highlighting.



Share This Post

del.icio.us:gVim Support Files digg:gVim Support Files wists:gVim Support Files magnolia:gVim Support Files segnalo:gVim Support Files Submit to Slashdot Submit to BoingBoing Submit to Make


Leave a Reply

Comment Preview




All comments are subject to the Rules.