You are not logged in Log in Join
You are here: Home » Members » pupq » Syntax Highlighting for Vi and Structured Text » howto_view

Log in
Name

Password

 

Syntax Highlighting for Vi and Structured Text

 

Created by pupq . Last modified 2003-10-02 03:18:33.

A simple StructuredText mode for Vim.

Using Casey Duncan's External Editor, or using WebDAV, you can edit your Zope site's objects using your favorite text editor directly.

I use ZWikis a lot for planning programming projects, and working with the web interface is annoying when editing a large, complex textbox -- I prefer to use vi for this. So, I wrote a vi syntax coloring/filetype mode for ZWiki structured texts. (It can work with any kind of structured text object you have, too)

To use:

1) Edit your External Editor configuration file. Add a section for structured text documents (use your meta type, for ZWikis, this is ZWiki Page). Set the extension to be ".stx" This way, vi will receive a document it can identify as structured text.

For example, for ZWiki pages, add:

     [meta-type:ZWiki Page]
     extension=.stx

2) Unzip the Vi/StructuredText File into your vimfiles directory. For Windows users, this will be c:\vim (or wherever the root of your VIM installation is); for Unix/Linux users, this will be ~/.vim. This archives contains:

  • the synax file for coloring
  • the filetype file for setting simple preferences
  • the filetype.vim file for recognizing that this is a stx file.

Features:

  • You can use the "Q" key to re-format a stx paragraph. This will clean up lines, etc.
  • There is simple color highlighting. I haven't added sophisticated highlighting for tables, etc. -- if anyone would like to do this, please do so and share with me.

Happy Vimming! Happy Zoping!

Comment

Discussion icon Files in DOS format

Posted by: scasagra at 2003-11-29

After untar the file (with the command tar -xzvf) I found that the format of the files were in DOS format.

In my Linux server I used the dos2unix utility to change the DOS EOF/new line to UNIX format.