sponsor Vim development Vim logo Vim Book Ad

ASPRecolor.vim : In ASPVBS buffers, give JS, ASP, and HTML sections different guibg colors

 script karma  Rating 14/9, Downloaded by 1744  Comments, bugs, improvements  Vim wiki

created by
Ross Presser
 
script type
ftplugin
 
description
I edit ASP code a lot.  There's usually three different langauges in the same file: HTML, Vbscript, and Javascript.  The ASPVBS filetype plugin handles this well, including the syntaxes from all three types, but it gets hard for me to distinguish them on the screen.  I wanted to assign different background colors to the different regions - but they're all highlight links, so if I change, say, Comment, then all of HTMLComment, AspVBSComment, and javascriptComment will all change too.

This plugin changes that.  After an ASPVBS buffer is loaded, it recolors every ASP and javascript syntax item with a new background color - by retrieving the underlying linked highlight definition and redefining the specific highlight item.  ASP becomes dramatically easier to read. See the included file compare.asp.html (also here: http://member.newsguy.com/~rpresser/compare.asp.html).

Requires the MultVals plugin <http://www.vim.org/scripts/script.php?script_id=171>; for array handling.

This technique could be applicable to other kinds of files that have multiple languages in them, like HTML/CSS, or C++ with embedded SQL, or maybe even someday XML.
 
install details
Either source this from your vimrc, or just drop it in a sytem or user plugins/ folder.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
ASPRecolor.vim 0.95 2003-07-17 6.0 Ross Presser Vim 6.2 released different versions of the ASP/VBS and HTML/Javascript syntax files, and this broke the hard-coded Recolors in ASPRecolor 0.90.  This version introduces a function that walks the syntax clusters to determine what items to recolor.  It also tries a bit harder to avoid error messages.  **NOW REQUIRES MultVals.vim*** <http://www.vim.org/scripts/script.php?script_id=171>;
ASPRecolor.zip 0.90 2003-02-12 6.0 Ross Presser Initial upload
ip used for rating: 216.73.216.130

Questions about Vim should go to the maillist. Help Uganda.     Vim at Github