Browse Source

Update eruby, html, and ruby snippets

- eruby: cross-site request forgery meta tag
  - html: HTML5 content_type is now simply charset, <a> tag for links
  - ruby: update snippet comments, define def..end snippet, add some
    rspec snippets
master
jimi 15 years ago
parent
commit
c96261994e
  1. 3
      ftplugin/eruby/eruby.xpt.vim
  2. 8
      ftplugin/html/html.xpt.vim
  3. 37
      ftplugin/ruby/ruby.xpt.vim

3
ftplugin/eruby/eruby.xpt.vim

@ -98,3 +98,6 @@ XPT stylesheet_link_tag synonym=slt " <%= stylesheet_link_tag...
XPT javascript_include_tag synonym=jit " <%= javascript_include_tag...
<%= javascript_include_tag `^ %>
XPT csrf_meta " <%= scrf_meta_tag %>
<%= csrf_meta_tag %>

8
ftplugin/html/html.xpt.vim

@ -35,7 +35,7 @@ XPT doctype " <!DOCTYPE...
XPT doctype5 " <!DOCTYPE html>
<!DOCTYPE html>
XPT content5 " <meta charset...
XPT charset " <meta charset...
<meta charset="utf-8" />
XPT skel abbr synonym=html|xhtml " xhtml skeleton
@ -43,7 +43,7 @@ XPT skel abbr synonym=html|xhtml " xhtml skeleton
<html>
<head>
`:title:^
`:content5:^`
`:charset:^`
`author^
</head>
<body>
@ -122,3 +122,7 @@ XSET nav=$_xSnipName
`...^
</ul>
XPT a wrap=content " <a href...
XSET href=#
XSET content=Echo('')
<a href="`href^">`content^</a>

37
ftplugin/ruby/ruby.xpt.vim

@ -2,23 +2,50 @@
"
XPTemplate priority=personal+
XPT key hidden " :key => val
XPT def " def .. end
XSET action=Echo(' ')
def `method^`
`action^
end
" eRuby attribute snippets
XPT key hidden " $_xSnipName => val
XSET val=Echo('')
`$_xSnipName^ => `val^
XPT :cols synonym=:rows|:size|:maxsize|:null|:url
XPT :cols synonym=:rows|:size|:maxsize|:null|:url " $_xSnipName => val
`:key:^
XPT :object synonym=:collection|:locals|:layout|:method
XPT :object synonym=:collection|:locals|:layout|:method " $_xSnipName => val
`:key:^
XPT :id synonym=:class|:alt|:title|:action|:controller
XPT :id synonym=:class|:alt|:title|:action|:controller " $_xSnipName => 'val'
XSET str='`val^'
`:key({ 'val' : 'str' }):^
XPT :selected synonym=:multipart
XPT :selected synonym=:multipart " $_xSnipName => true
XSET bool=true`^
`:key({ 'val' : 'bool' }):^
XPT :html alias=key
XSET val={ `html^ }
" RSpec snippets
XPT loop " loop do .. end
`loop^` `arg^ do
`cursor^
end
XPT describe " describe .. do
XSET name=describe
`:loop({ 'loop' : 'name' }):^
XPT it " it .. do
XSET name=it
`:loop({ 'loop' : 'name' }):^
XPT :content " $_xSnipName => "val"
XSET val="`str^"
`:key:^