From 0b4a310fed23bf87d5a4655ae493e65a3064dd2c Mon Sep 17 00:00:00 2001 From: jimi Date: Sat, 23 Oct 2010 23:34:24 -0500 Subject: [PATCH] Updates to ease rails development... - (euby) let image_tag take an object as the path - (html) define many elements to alias attrTag - (ruby) modify :key => val snippet --- ftplugin/eruby/eruby.xpt.vim | 3 +-- ftplugin/html/html.xpt.vim | 35 ++++++++++++++++++++++++----------- ftplugin/ruby/ruby.xpt.vim | 4 ++++ 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/ftplugin/eruby/eruby.xpt.vim b/ftplugin/eruby/eruby.xpt.vim index fdd53e4..4220043 100644 --- a/ftplugin/eruby/eruby.xpt.vim +++ b/ftplugin/eruby/eruby.xpt.vim @@ -49,8 +49,7 @@ XSET cursor=Echo('') `:end:^ XPT it hidden " embed-able image tag -XSET image_path=$img_path/ -image_tag('`image_path^`image_file^'`, `opt?^) +image_tag(`image_path^`, `opt?^) XPT image_tag synonym=imt " <%= image_tag... <%= `:it:^ %> diff --git a/ftplugin/html/html.xpt.vim b/ftplugin/html/html.xpt.vim index 3342f1b..dbda115 100644 --- a/ftplugin/html/html.xpt.vim +++ b/ftplugin/html/html.xpt.vim @@ -90,8 +90,10 @@ XPT jscript synonym=js `cursor^ -XPT div wrap=content synonym=span " <$_xSnipName att?>.. +XPT tagAttr wrap=content hidden " <$_xSnipName att?>.. XSET content|ontype=html_cont_ontype() +XSET att?=Echo('') +XSET att?|post=Echo(V()=~'\V\^ \$\|att?' ? '' : V()) <`$_xSnipName^` `att?^>`content^^`content^html_cont_helper()^ XPT di wrap=cursor "
\n\n
\n -XPT blockTag wrap=content hidden " <$_xSnipName >\n .. \n -<`$_xSnipName^` `att?^> - `content^^ - +XPT span alias=tagAttr -XPT ul abbr alias=blockTag +XPT div alias=tagAttr -XPT ol abbr alias=blockTag +XPT tr abbr alias=tagAttr + +XPT td abbr alias=tagAttr + +XPT ul abbr alias=tagAttr + +XPT ol abbr alias=tagAttr + +XPT dl abbr alias=tagAttr + +XPT dt abbr alias=tagAttr + +XPT dd abbr alias=tagAttr + +XPT br abbr alias=_shorttag XPT li abbr "
  • ..
  • ... XSET content=Echo('') @@ -149,13 +162,13 @@ XSET content=Echo('') " HTML5 Snippets " -XPT header alias=blockTag +XPT header alias=tagAttr -XPT section alias=blockTag +XPT section alias=tagAttr -XPT aside alias=blockTag +XPT aside alias=tagAttr -XPT footer alias=blockTag +XPT footer alias=tagAttr XPT nav "