Coldfusion snippets file for vim.

Place the follwing in ${HOME}/.vim/after/ftplugin/cf_snippets.vim

if !exists('loaded_snippet') || &cp
    finish
endif

let st = g:snip_start_tag
let et = g:snip_end_tag
let cd = g:snip_elem_delim

exec "Snippet func <!-- ################### Function: ".st."name".et." ############# --><CR><cffunction name=\"".st."name".et."\" access=\"public\" output=\"yes\"><CR><!--".st.et."--><CR></cffunction>"
exec "Snippet funv <cffunction name=\"".st."name".et."\" access=\"public\" output=\"yes\"><CR><!--".st.et."--><CR></cffunction>"
exec "Snippet comp <cfcomponent><CR><!-- ".st.et."<CR>--><CR><Tab><cffunction  name=\"init\" access=\"public\" output=\"no\"><CR></cffunction><CR></cfcomponent>"
exec "Snippet scr <cfscript><CR>".st.et."<CR></cfscript>"
exec "Snippet out <cfoutput>".st.et."</cfoutput>"
exec "Snippet loop <cfloop collection=#".st."collection".et."# item=\"ds\"><CR>".st.et."<CR></cfloop>"
exec "Snippet set <cfset ".st."var".et."=\"".st."value".et."\">"
exec "Snippet case <cfswitch expression=#".st."of".et."#><CR><cfcase value='".st.et."'><CR><CR></cfcase><CR><cfcase value=''><CR><CR></cfcase><CR></cfswitch>"
blog comments powered by Disqus