Personal tools
You are here: Home Documentation How-tos vi/Vim Mapfile Syntax File Instructions

vi/Vim Mapfile Syntax File Instructions

Document Actions
A brief guide to implement the vi/Vim syntax file for mapfiles on Suse 9.0. Other Linux distributions should work in a similar way.
Author: Andreas Hirner
Contact: andreas.hirner(at)dlr.de
Last Updated:2005/12/21

1   General remarks

vi (vim) resides in: /usr/share/vim/current (vim_root).

Syntax definitions are in vim_root/syntax/*.vim files. Linking file types to extensions is done in vim_root/ftdetect/*.vim. (The the star denotes the extension and would be replaced with map to define highlighting of Mapserver config files).

2   Installation

The installation process requires two steps:

  1. Copy the map.vim syntax file to the syntax directory

    Copy map.vim to the vim syntax directory (on Suse: /usr/share/vim/current/syntax)

  2. Register the syntax file in the custom filetype directory

    If absent, create a new directory called ftdetect in vim_root (on Suse Linux: /usr/share/vim/current). Create a new file called map.vim in ftdetect according to the example shown below:

    " Mapserver config file
    au BufNewFile,BufRead *.map         setf map
    

Now restart vim and open a map file ....

3   Closing Remarks

The keywords are based on the TextPad Symbol Map_40.syn file contributed by Christopher Thorne, which can also be found on the Mapserver utility page. I hope the file is somehow useful to anybody out there. If there are any questions or suggestions, please feel free to contact me.

This How-to applies to: Any version.

by Andreas Hirner last modified 2006-01-10 06:21
Contributors: Dr. Andreas Hirner

Vim for Mapserver map files syntax

Posted by Andreas Ritterbusch at 2006-03-24 17:39

Thanks for the effort to put together this syntax file for VIM. However, instinctively, I searched www.vim.org (Scripts section) for this. Apparently it is not to be found there (search came up empty). Naturally, it would be great to have a copy on www.vim.org. Just a thought.


Powered by Plone