sponsor Vim development Vim logo Vim Book Ad

basic Tip #362: matchit.vim and coldfusion (and perhaps others)

 tip karma   Rating 10/4, Viewed by 885 

created:   November 7, 2002 2:19      complexity:   basic
author:   zzapper      as of Vim:   5.7

Hi VIMmites

I couldn't get any tags to match in Coldfusion files *.cfm either HTML Javascript or ColdFusion tags themselves <cfif ..> ... </cfif>

Much pain was gone thru before I realised that the Syntax File for ColdFusion
(/syntax/cf.vim) was called cf and not cfm

Therefore in matchit.cfm I need to add CF in following line and NOT CFM

au FileType html,jsp,php,cf if !exists("b:match_words") |

zzapper

 rate this tip  Life Changing Helpful Unfulfilling 

<<Use xdvi (or kdvi) in conjunction with gvim (or vim) and converse | Starting up Vim very fast expecially from a telnet session >>

Additional Notes

[email protected], November 7, 2002 6:18
I meant edit matchit.vim (not matchit.cfm)
[email protected], May 25, 2004 21:04
Ok, Where is this supposed to go exactly?  I'm a little confused.
Anonymous, October 18, 2004 14:43
this is a fairly complex topic and I can't outdo the included docs; It's not as quick to set up as really any other of vims powerful features that I have used before, but its very worthwhile though, if you ask me.  Note that it's still quite easy, but usually vim has all the work done for you already with a full install.

Start with
:h matchit-install

Then follow its instructions to install matchit and get the help loaded for it for the rest of the info.

That is a very general guide for dealing with just about any language, but if you're doing coldfusion, I will add one more shortcut for you.   You'll probably want to start with this, in ~/.vim/ftplugin/cf.vim (or vimfiles\ftplugin\cf.vim )
let b:match_words = '<cfif:<cfelse:<\/cfif,'
    \ . '<cfloop:<\/cfloop,'
    \ . '<cfquery:<\/cfquery,'
    \ . '<cfscript:<\/cfscript'

Don't forget
filetype plugin on
in your main vimrc, or that will not be processed.
Anonymous, October 18, 2004 14:57
For the benefit of googlers, I am going to mention that the point of this tip is to help people configure vim so that one can use the % (percent sign) to jump from word to word, using matched pairs like those mentioned above while writing coldfusion cfm files.
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
Sponsored by Web Concept Group Inc. SourceForge Logo