Commits

Ches Martin committed 1ff3e96

vim: Update snippets, some merged upstream. Add some for Scala

  • Participants
  • Parent commits ab0e6e1

Comments (0)

Files changed (5)

File .vim/UltiSnips/coffee.snippets

-# From the TextMate bundle
+# Most merged upstream, a few additions/overrides:
 
-snippet fun "Function" b
-${1:name} = (${2:args}) ->
+snippet meth "Method" b
+${1:name}: ->
 	${0:# body...}
 endsnippet
 
-snippet bfun "Function (bound)" b
-${1:(${2:args}) }=>
+# TODO: could just use a nested group with above snippet if it works
+snippet methp "Method with params" b
+${1:name}: (${2:params}) ->
 	${0:# body...}
 endsnippet
 
-snippet if "If" b
-if ${1:condition}
-	${0:# body...}
+snippet req "Require" b
+`!p snip.rv = t[1].split('/')[-1].lower().strip("'")` = require(${1:'${2:sys}'})
 endsnippet
 
-snippet ife "If .. Else" b
-if ${1:condition}
-	${2:# body...}
-else
-	${3:# body...}
-endsnippet
-
-snippet elif "Else if" b
-else if ${1:condition}
-	${0:# body...}
-endsnippet
-
-snippet ifte "Ternary if" b
-if ${1:condition} then ${2:value} else ${3:other}
-endsnippet
-
-snippet unl "Unless" b
-${1:action} unless ${2:condition}
-endsnippet
-
-snippet fora "Array Comprehension" b
-for ${1:name} in ${2:array}
-	${0:# body...}
-endsnippet
-
-snippet foro "Object Comprehension" b
-for ${1:key}, ${2:value} of ${3:Object}
-	${0:# body...}
-endsnippet
-
-snippet forr "Range Comprehension (inclusive)" b
-for ${1:name} in [${2:start}..${3:finish}]${4: by ${5:step}}
-	${0:# body...}
-endsnippet
-
-snippet forrex "Range Comprehension (exclusive)" b
-for ${1:name} in [${2:start}...${3:finish}]${4: by ${5:step}}
-	${0:# body...}
-endsnippet
-
-snippet swi "Switch" b
-switch ${1:object}
-	when ${2:value}
-		${0:# body...}
-endsnippet
-
-snippet cla "Class" b
-class ${1:ClassName}${2: extends ${3:Ancestor}}
-
-	${4:constructor: (${5:args}) ->
-		${6:# body...}}
-	$7
-endsnippet
-
-snippet try "Try .. Catch" b
-try
-	$1
-catch ${2:error}
-	$3
-endsnippet
-
-# TODO: match group when between quotes gets last char cut off -- doesn't happen
-# in TextMate
-# TODO: would like to take part after last slash, but can't figure out how to
-# get UltiSnips regex syntax to accept [^/]
-snippet req "Require" b
-${1/^'?(\w+)'?$/\L$1\E/} = require(${1:'${2:sys}'})
-endsnippet
-
-snippet # "Interpolated Code"
-#{$1}$0
-endsnippet
-
-snippet log "Log" b
-console.log ${1:"${2:msg}"}
-endsnippet
-

File .vim/UltiSnips/rails.snippets

-###########################################################################
-#                    GENERATED FROM get_tm_snippets.py                    #
-###########################################################################
-
-snippet anaf "accepts_nested_attributes_for"
-accepts_nested_attributes_for :${1:association_name}${2:${3:, :allow_destroy => true}${4:, :reject_if => proc { |obj| ${5:obj.blank?} \}}}
-
-endsnippet
-
-snippet tcbi "Create binary column"
-t.binary :${1:title}${2:, :limit => ${3:2}.megabytes}
-$0
-endsnippet
-
-snippet tcb "Create boolean column"
-t.boolean :${1:title}
-$0
-endsnippet
-
-snippet cla "Create controller class"
-class ${1:Model}Controller < ApplicationController
-	before_filter :find_${2:model}
-
-	$0
-
-	private
-	def find_${2}
-		@$2 = ${3:$1}.find(params[:id]) if params[:id]
-	end
-end
-endsnippet
-
-snippet tcda "Create date column"
-t.date :${1:title}
-$0
-endsnippet
-
-snippet tcdt "Create datetime column"
-t.datetime :${1:title}
-$0
-endsnippet
-
-snippet tcd "Create decimal column"
-t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}}
-$0
-endsnippet
-
-snippet tcf "Create float column"
-t.float :${1:title}
-$0
-endsnippet
-
-snippet cla "Create functional test class"
-require 'test_helper'
-
-class ${1:Model}ControllerTest < ActionController::TestCase
-	test$0
-end
-
-endsnippet
-
-snippet tci "Create integer column"
-t.integer :${1:title}
-$0
-endsnippet
-
-snippet tcl "Create lock_version column"
-t.integer :lock_version, :null => false, :default => 0
-$0
-endsnippet
-
-# FIXME: handling literal bracket pair inside of nested tab groups?
-snippet tcr "Create references column"
-t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}}
-$0
-endsnippet
-
-snippet resources "Create resources controller class"
-class ${1:Model}sController < ApplicationController
-  before_filter :find_${1/./\l$0/}, :only => [:show, :edit, :update, :destroy]
-
-  # GET /${1/./\l$0/}s
-  # GET /${1/./\l$0/}s.xml
-  def index
-    @${1/./\l$0/}s = ${1:Model}.all
-
-    respond_to do |wants|
-      wants.html # index.html.erb
-      wants.xml  { render :xml => @${1/./\l$0/}s }
-    end
-  end
-
-  # GET /${1/./\l$0/}s/1
-  # GET /${1/./\l$0/}s/1.xml
-  def show
-    respond_to do |wants|
-      wants.html # show.html.erb
-      wants.xml  { render :xml => @${1/./\l$0/} }
-    end
-  end
-
-  # GET /${1/./\l$0/}s/new
-  # GET /${1/./\l$0/}s/new.xml
-  def new
-    @${1/./\l$0/} = ${1:Model}.new
-
-    respond_to do |wants|
-      wants.html # new.html.erb
-      wants.xml  { render :xml => @${1/./\l$0/} }
-    end
-  end
-
-  # GET /${1/./\l$0/}s/1/edit
-  def edit
-  end
-
-  # POST /${1/./\l$0/}s
-  # POST /${1/./\l$0/}s.xml
-  def create
-    @${1/./\l$0/} = ${1:Model}.new(params[:${1/./\l$0/}])
-
-    respond_to do |wants|
-      if @${1/./\l$0/}.save
-        flash[:notice] = '${1:Model} was successfully created.'
-        wants.html { redirect_to(@${1/./\l$0/}) }
-        wants.xml  { render :xml => @${1/./\l$0/}, :status => :created, :location => @${1/./\l$0/} }
-      else
-        wants.html { render :action => "new" }
-        wants.xml  { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity }
-      end
-    end
-  end
-
-  # PUT /${1/./\l$0/}s/1
-  # PUT /${1/./\l$0/}s/1.xml
-  def update
-    respond_to do |wants|
-      if @${1/./\l$0/}.update_attributes(params[:${1/./\l$0/}])
-        flash[:notice] = '${1:Model} was successfully updated.'
-        wants.html { redirect_to(@${1/./\l$0/}) }
-        wants.xml  { head :ok }
-      else
-        wants.html { render :action => "edit" }
-        wants.xml  { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity }
-      end
-    end
-  end
-
-  # DELETE /${1/./\l$0/}s/1
-  # DELETE /${1/./\l$0/}s/1.xml
-  def destroy
-    @${1/./\l$0/}.destroy
-
-    respond_to do |wants|
-      wants.html { redirect_to(${1/./\l$0/}s_url) }
-      wants.xml  { head :ok }
-    end
-  end
-
-  private
-    def find_${1/./\l$0/}
-      @${1/./\l$0/} = ${1:Model}.find(params[:id])
-    end
-
-end
-
-endsnippet
-
-snippet tcs "Create string column"
-t.string :${1:title}
-$0
-endsnippet
-
-snippet tct "Create text column"
-t.text :${1:title}
-$0
-endsnippet
-
-snippet tcti "Create time column"
-t.time :${1:title}
-$0
-endsnippet
-
-snippet tcts "Create timestamp column"
-t.timestamp :${1:title}
-$0
-endsnippet
-
-snippet tctss "Create timestamps columns"
-t.timestamps
-$0
-endsnippet
-
-snippet mcol "Migration Create Column (mcc)"
-t.column ${1:title}, :${2:string}
-$0
-endsnippet
-
-snippet mccc "Migration Create Column Continue (mccc)"
-t.column ${1:title}, :${2:string}
-mccc$0
-endsnippet
-
-snippet mtab "Migration Drop Create Table (mdct)"
-drop_table :${1:table}${2: [press tab twice to generate create_table]}
-endsnippet
-
-snippet mcol "Migration Remove and Add Column (mrac)"
-remove_column :${1:table}, :${2:column}${3: [press tab twice to generate add_column]}
-endsnippet
-
-snippet rdb "RAILS_DEFAULT_LOGGER.debug (rdb)"
-RAILS_DEFAULT_LOGGER.debug "${1:message}"$0
-endsnippet
-
-snippet tre "Table column(s) rename"
-t.rename(:${1:old_column_name}, :${2:new_column_name})
-$0
-endsnippet
-
-snippet art "Test Assert Redirected To (art)"
-assert_redirected_to ${2::action => "${1:index}"}
-endsnippet
-
-snippet asre "Test Assert Response (are)"
-assert_response :${1:success}, @response.body$0
-endsnippet
-
-snippet aftc "after_create"
-after_create 
-endsnippet
-
-snippet aftd "after_destroy"
-after_destroy 
-endsnippet
-
-snippet afts "after_save"
-after_save 
-endsnippet
-
-snippet aftu "after_update"
-after_update 
-endsnippet
-
-snippet aftv "after_validation"
-after_validation 
-endsnippet
-
-snippet aftvoc "after_validation_on_create"
-after_validation_on_create 
-endsnippet
-
-snippet aftvou "after_validation_on_update"
-after_validation_on_update 
-endsnippet
-
-snippet asg "assert(var = assigns(:var))"
-assert(${1:var} = assigns(:${1}), "Cannot find @${1}")
-$0
-endsnippet
-
-snippet asd "assert_difference"
-assert_difference "${1:Model}.${2:count}", ${3:1} do
-  $0
-end
-endsnippet
-
-snippet asnd "assert_no_difference"
-assert_no_difference "${1:Model}.${2:count}" do
-  $0
-end
-endsnippet
-
-snippet artnpp "assert_redirected_to (nested path plural)"
-assert_redirected_to ${10:${2:parent}_${3:child}_path(${4:@}${5:${2}})}
-endsnippet
-
-snippet artnp "assert_redirected_to (nested path)"
-assert_redirected_to ${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})}
-endsnippet
-
-snippet artpp "assert_redirected_to (path plural)"
-assert_redirected_to ${10:${2:model}s_path}
-endsnippet
-
-snippet artp "assert_redirected_to (path)"
-assert_redirected_to ${2:${12:model}_path(${13:@}${14:${12}})}
-endsnippet
-
-snippet asrj "assert_rjs"
-assert_rjs :${1:replace}, ${2:"${3:dom id}"}
-endsnippet
-
-snippet ass "assert_select"
-assert_select '${1:path}'${2:, :${3:text} => ${4:'${5:inner_html}'}}${6: do
-	$0
-end}
-endsnippet
-
-snippet befc "before_create"
-before_create 
-endsnippet
-
-snippet befd "before_destroy"
-before_destroy 
-endsnippet
-
-snippet befs "before_save"
-before_save 
-endsnippet
-
-snippet befu "before_update"
-before_update 
-endsnippet
-
-snippet befv "before_validation"
-before_validation 
-endsnippet
-
-snippet befvoc "before_validation_on_create"
-before_validation_on_create 
-endsnippet
-
-snippet befvou "before_validation_on_update"
-before_validation_on_update
-endsnippet
-
-snippet bt "belongs_to (bt)"
-belongs_to :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"}
-endsnippet
-
-snippet crw "cattr_accessor"
-cattr_accessor :${0:attr_names}
-endsnippet
-
-snippet defcreate "def create - resource"
-def create
-	@${1:model} = ${2:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}.new(params[:$1])
-	$0
-	respond_to do |wants|
-		if @$1.save
-			flash[:notice] = '$2 was successfully created.'
-			wants.html { redirect_to(@$1) }
-			wants.xml { render :xml => @$1, :status => :created, :location => @$1 }
-		else
-			wants.html { render :action => "new" }
-			wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity }
-		end
-	end
-end
-
-endsnippet
-
-snippet test "test do..end"
-test "${1:something interesting}" do
-	$0
-end
-endsnippet
-
-snippet deftg "def get request"
-def test_should_get_${1:action}
-	${2:@${3:model} = ${4:$3s}(:${5:fixture_name})
-	}get :${1}${6:, :id => @$3.to_param}
-	assert_response :success
-	$0
-end
-endsnippet
-
-snippet deftp "def post request"
-def test_should_post_${1:action}
-	${3:@$2 = ${4:$2s}(:${5:fixture_name})
-	}post :${1}${6:, :id => @$2.to_param}, :${2:model} => { $0 }
-	assert_response :redirect
-
-end
-endsnippet
-
-snippet fina "find(:all)"
-find(:all${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]})
-endsnippet
-
-snippet finf "find(:first)"
-find(:first${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]})
-endsnippet
-
-snippet fini "find(id)"
-find(${1:id})
-endsnippet
-
-snippet fine "find_each"
-find_each(${1::conditions => {:${2:field} => ${3:true}\}}) do |${4:${TM_CURRENT_WORD/(\w+)\./\L$1/g}}|
-	$0
-end
-endsnippet
-
-snippet finb "find_in_batches"
-find_in_batches(${1::conditions => {:${2:field} => ${3:true}\}}) do |${4:${TM_CURRENT_WORD/(\w+)\./\L$1/g}}s|
-	$4s.each do |$4|
-		$0
-	end
-end
-endsnippet
-
-snippet habtm "has_and_belongs_to_many (habtm)"
-has_and_belongs_to_many :${1:object}${2:, :join_table => "${3:table_name}", :foreign_key => "${4:${1}_id}"}
-endsnippet
-
-snippet hm "has_many (hm)"
-has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"}
-endsnippet
-
-snippet hmt "has_many (through)"
-has_many :${1:objects}, :through => :${2:join_association}${3:, :source => :${4:${2}_table_foreign_key_to_${1}_table}}
-endsnippet
-
-snippet hmd "has_many :dependent => :destroy"
-has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"}, :dependent => :destroy$0
-endsnippet
-
-snippet ho "has_one (ho)"
-has_one :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"}
-endsnippet
-
-snippet logd "logger.debug"
-${1:Rails.}logger.debug { "${1:message}" }$0
-endsnippet
-
-snippet loge "logger.error"
-logger.error { "${1:message}" }$0
-endsnippet
-
-snippet logf "logger.fatal"
-logger.fatal { "${1:message}" }$0
-endsnippet
-
-snippet logi "logger.info"
-logger.info { "${1:message}" }$0
-endsnippet
-
-snippet logw "logger.warn"
-logger.warn { "${1:message}" }$0
-endsnippet
-
-snippet mp "map(&:sym_proc)"
-map(&:${1:id})
-endsnippet
-
-snippet mapca "map.catch_all"
-${1:map}.catch_all "*${2:anything}", :controller => "${3:default}", :action => "${4:error}"
-
-endsnippet
-
-snippet map "map.named_route"
-${1:map}.${2:connect} '${3::controller/:action/:id}'
-endsnippet
-
-snippet mapr "map.resource"
-${1:map}.resource :${2:resource}${10: do |${11:$2}|
-  $0
-end}
-endsnippet
-
-snippet maprs "map.resources"
-${1:map}.resources :${2:resource}${10: do |${11:$2}|
-  $0
-end}
-endsnippet
-
-snippet mapwo "map.with_options"
-${1:map}.with_options :${2:controller} => '${3:thing}' do |${4:$3}|
-	$0
-end
-
-endsnippet
-
-snippet mrw "mattr_accessor"
-mattr_accessor :${0:attr_names}
-endsnippet
-
-snippet ncl "named_scope lambda"
-named_scope :name, lambda { |${1:param}| { :conditions => ${3:['${4:${5:field} = ?}', ${6:$1}]} } }
-
-endsnippet
-
-snippet nc "named_scope"
-named_scope :name${1:, :joins => :${2:table}}, :conditions => ${3:['${4:${5:field} = ?}', ${6:true}]}
-
-endsnippet
-
-snippet dscope "default_scope"
-default_scope ${1:order(${2:'${3:created_at DESC}'})}
-endsnippet
-
-snippet flash "flash[...]"
-flash[:${1:notice}] = "${2:Successfully created...}"$0
-endsnippet
-
-snippet rea "redirect_to (action)"
-redirect_to :action => "${1:index}"
-endsnippet
-
-snippet reai "redirect_to (action, id)"
-redirect_to :action => "${1:show}", :id => ${0:@item}
-endsnippet
-
-snippet rec "redirect_to (controller)"
-redirect_to :controller => "${1:items}"
-endsnippet
-
-snippet reca "redirect_to (controller, action)"
-redirect_to :controller => "${1:items}", :action => "${2:list}"
-endsnippet
-
-snippet recai "redirect_to (controller, action, id)"
-redirect_to :controller => "${1:items}", :action => "${2:show}", :id => ${0:@item}
-endsnippet
-
-snippet renpp "redirect_to (nested path plural)"
-redirect_to(${2:${10:parent}_${11:child}_path(${12:@}${13:${10}})})
-endsnippet
-
-snippet renp "redirect_to (nested path)"
-redirect_to(${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})})
-endsnippet
-
-snippet repp "redirect_to (path plural)"
-redirect_to(${2:${10:model}s_path})
-endsnippet
-
-snippet rep "redirect_to (path)"
-redirect_to(${2:${12:model}_path(${13:@}${14:${12}})})
-endsnippet
-
-snippet reb "redirect_to :back"
-redirect_to :back
-endsnippet
-
-snippet ra "render (action)... (ra)"
-render :action => "${1:action}"
-endsnippet
-
-snippet ral "render (action,layout) (ral)"
-render :action => "${1:action}", :layout => "${2:layoutname}"
-endsnippet
-
-snippet rf "render (file) (rf)"
-render :file => "${1:filepath}"
-endsnippet
-
-snippet rfu "render (file,use_full_path) (rfu)"
-render :file => "${1:filepath}", :use_full_path => ${2:false}
-endsnippet
-
-snippet ri "render (inline) (ri)"
-render :inline => "${1:<%= 'hello' %>}"
-endsnippet
-
-snippet ril "render (inline,locals) (ril)"
-render :inline => "${1:<%= 'hello' %>}", :locals => { ${2::name} => "${3:value}"$4 }
-endsnippet
-
-snippet rit "render (inline,type) (rit)"
-render :inline => "${1:<%= 'hello' %>}", :type => ${2::rxml}
-endsnippet
-
-snippet rl "render (layout) (rl)"
-render :layout => "${1:layoutname}"
-endsnippet
-
-snippet rn "render (nothing) (rn)"
-render :nothing => ${1:true}
-endsnippet
-
-snippet rns "render (nothing,status) (rns)"
-render :nothing => ${1:true}, :status => ${2:401}
-endsnippet
-
-snippet rt "render (text) (rt)"
-render :text => "${1:text to render...}"
-endsnippet
-
-snippet rtl "render (text,layout) (rtl)"
-render :text => "${1:text to render...}", :layout => "${2:layoutname}"
-endsnippet
-
-snippet rtlt "render (text,layout => true) (rtlt)"
-render :text => "${1:text to render...}", :layout => ${2:true}
-endsnippet
-
-snippet rts "render (text,status) (rts)"
-render :text => "${1:text to render...}", :status => ${2:401}
-endsnippet
-
-snippet ru "render (update)"
-render :update do |${2:page}|
-	$2.$0
-end
-endsnippet
-
-snippet rest "respond_to"
-respond_to do |wants|
-	wants.${1:html}${2: { $0 \}}
-end
-endsnippet
-
-snippet resw "respond_with"
-respond_with(${1:@${2:model}})${3: do |format|
-  format.${4:html} { $0 \}
-end}
-endsnippet
-
-# FIXME
-snippet returning "returning do |variable| ... end"
-returning ${1:variable} do${2/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1: |)/}${2:v}${2/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}
-	$0
-end
-endsnippet
-
-snippet t. "t.binary (tcbi)"
-t.binary :${1:title}${2:, :limit => ${3:2}.megabytes}
-t.$0
-endsnippet
-
-snippet t. "t.boolean (tcb)"
-t.boolean :${1:title}
-t.$0
-endsnippet
-
-snippet t. "t.date (tcda)"
-t.date :${1:title}
-t.$0
-endsnippet
-
-snippet t. "t.datetime (tcdt)"
-t.datetime :${1:title}
-t.$0
-endsnippet
-
-snippet t. "t.decimal (tcd)"
-t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}}
-t.$0
-endsnippet
-
-snippet t. "t.float (tcf)"
-t.float :${1:title}
-t.$0
-endsnippet
-
-snippet t. "t.integer (tci)"
-t.integer :${1:title}
-t.$0
-endsnippet
-
-snippet t. "t.lock_version (tcl)"
-t.integer :lock_version, :null => false, :default => 0
-t.$0
-endsnippet
-
-snippet t. "t.references (tcr)"
-t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}}
-t.$0
-endsnippet
-
-snippet t. "t.rename (tre)"
-t.rename(:${1:old_column_name}, :${2:new_column_name})
-t.$0
-endsnippet
-
-snippet t. "t.string (tcs)"
-t.string :${1:title}
-t.$0
-endsnippet
-
-snippet t. "t.text (tct)"
-t.text :${1:title}
-t.$0
-endsnippet
-
-snippet t. "t.time (tcti)"
-t.time :${1:title}
-t.$0
-endsnippet
-
-snippet t. "t.timestamp (tcts)"
-t.timestamp :${1:title}
-t.$0
-endsnippet
-
-snippet t. "t.timestamps (tctss)"
-t.timestamps
-t.$0
-endsnippet
-
-snippet vaoif "validates_acceptance_of if"
-validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}}, :if => proc { |obj| ${7:obj.condition?} }}
-endsnippet
-
-snippet vao "validates_acceptance_of"
-validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}}
-endsnippet
-
-snippet va "validates_associated (va)"
-validates_associated :${1:attribute}${2:, :on => :${3:create}}
-endsnippet
-
-snippet vaif "validates_associated if (vaif)"
-validates_associated :${1:attribute}${2:, :on => :${3:create}, :if => proc { |obj| ${5:obj.condition?} }}
-endsnippet
-
-snippet vc "validates_confirmation_of (vc)"
-validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}"}
-endsnippet
-
-snippet vcif "validates_confirmation_of if (vcif)"
-validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}", :if => proc { |obj| ${5:obj.condition?} }}
-endsnippet
-
-snippet ve "validates_exclusion_of (ve)"
-validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"}
-endsnippet
-
-snippet veif "validates_exclusion_of if (veif)"
-validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"}, :if => proc { |obj| ${7:obj.condition?} }}
-endsnippet
-
-snippet vfif "validates_format_of if"
-validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"}, :if => proc { |obj| ${7:obj.condition?} }}
-endsnippet
-
-snippet vf "validates_format_of"
-validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"}
-endsnippet
-
-snippet viif "validates_inclusion_of if"
-validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"}, :if => proc { |obj| ${7:obj.condition?} }}
-endsnippet
-
-snippet vi "validates_inclusion_of"
-validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"}
-endsnippet
-
-snippet vl "validates_length_of (vl)"
-validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"}
-endsnippet
-
-snippet vlif "validates_length_of if"
-validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"}, :if => proc { |obj| ${6:obj.condition?} }}
-endsnippet
-
-snippet vnif "validates_numericality_of if"
-validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"}, :if => proc { |obj| ${5:obj.condition?} }}
-endsnippet
-
-snippet vn "validates_numericality_of"
-validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"}
-endsnippet
-
-snippet vp "validates_presence_of (vp)"
-validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"}
-endsnippet
-
-snippet vpif "validates_presence_of if (vpif) 2"
-validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"}, :if => proc { |obj| ${5:obj.condition?} }}
-endsnippet
-
-snippet vu "validates_uniqueness_of (vu)"
-validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}"}
-endsnippet
-
-snippet vuif "validates_uniqueness_of if (vuif)"
-validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}", :if => proc { |obj| ${6:obj.condition?} }}
-endsnippet
-
-snippet verify "verify -- render"
-verify :only => [:$1], :method => :post, :render => {:status => 500, :text => "use HTTP-POST"}
-
-endsnippet
-
-snippet verify "verify -- redirect"
-verify :only => [:$1], :session => :user, :params => :id, :redirect_to => {:action => '${2:index}'}
-
-endsnippet
-
-snippet wants "wants_format"
-wants.${1:js|xml|html}${2: { $0 \}}
-endsnippet
-
-snippet xdelete "xhr delete"
-xhr :delete, :${1:destroy}, :id => ${2:1}$0
-endsnippet
-
-snippet xget "xhr get"
-xhr :get, :${1:show}${2:, :id => ${3:1}}$0
-endsnippet
-
-snippet xpost "xhr post"
-xhr :post, :${1:create}, :${2:object} => { $3 }
-endsnippet
-
-snippet xput "xhr put"
-xhr :put, :${1:update}, :id => ${2:1}, :${3:object} => { $4 }$0
-endsnippet
-
-snippet finl "find(:last)"
-find(:last${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]})
-endsnippet
-
-snippet sweeper "Create sweeper class"
-class ${1:Model}Sweeper < ActionController::Caching::Sweeper
-  observe ${1:Model}
-
-  def after_save(${1/./\l$0/})
-    expire_cache(${1/./\l$0/})
-  end
-
-  def after_destroy(${1/./\l$0/})
-    expire_cache(${1/./\l$0/})
-  end
-
-  private
-
-    def expire_cache(${1/./\l$0/})
-      ${0:expire_page ${1/./\l$0/}s_path 
-      expire_page ${1/./\l$0/}_path(${1/./\l$0/})}
-    end
-
-end
-endsnippet
-
-snippet col "collection routes"
-collection do
-  ${1:get :${2:action}}
-  ${3:put :${4:action}}
-  ${5:post :${6:action}}
-  ${7:delete :${8:action}}
-end
-endsnippet
-
-snippet format "format (respond_with)"
-format.${1:html|xml|json|js|any} { $0 }
-endsnippet
-
-snippet gem "gem"
-gem '${1:name}'${2:${3:, "${4:1.0}"}${5:${6:, :require => ${7:"${8:$1}"}}${9:, :group => :${10:test}}}}
-endsnippet
-
-snippet gemg "gem :git"
-gem '${1:paperclip}', :git => "${2:git://github.com/thoughtbot/paperclip.git}"${3:, :branch => "${4:rails3}"}
-endsnippet
-
-snippet match "match"
-match '${1:${2::controller}${3:/${4::action}${5:/${6::id}${7:(.:format)}}}}'${8: => '${9:$2}#${10:$4}'${11:, :as => :${12:$10}}}
-endsnippet
-
-snippet member "member routes"
-member do
-  ${1:get :${2:action}}
-  ${3:put :${4:action}}
-  ${5:post :${6:action}}
-  ${7:delete :${8:action}}
-end
-endsnippet
-
-snippet res "resources"
-resources :${1:posts}${2: do
-  $3
-end}
-endsnippet
-
-snippet scope "scope"
-scope :${1:name}, ${2:joins(:${3:table}).}where(${4:'${5:$3.${6:field}} = ?', ${7:'${8:value}'}})
-endsnippet
-
-snippet scopel "scope lambda"
-scope :${1:name}, lambda { |${2:param}| ${3:where(${4::${5:field} => ${6:"${7:value}"}})} }
-endsnippet
-
-snippet scopee "scope with extension"
-scope :${1:name}, ${2:where(${3::${4:field} => ${5:'${6:value}'}})} do
-  def ${7:method_name}
-    $0
-  end
-end
-endsnippet
-
-snippet sb "scoped_by"
-scoped_by_${1:attribute}(${2:id})
-endsnippet
-
-snippet setup "setup do..end"
-setup do
-	$0
-end
-endsnippet
-

File .vim/UltiSnips/rspec.snippets

 snippet anr "and_raise" w
-and_raise(${1:exception})
+and_raise${1:(${2:exception})}
 endsnippet
 
-snippet anrb "and_return_block" w
+snippet andra "and_return" w
+and_return${1:(${2:value})}
+endsnippet
+
+snippet anrb "and_return block" w
 and_return { $1 }
 endsnippet
 
-snippet andra "and_return_value" w
-and_return(${1:value})
-endsnippet
-
 snippet ant "and_throw" w
-and_throw(${1:sym})
+and_throw${1:(${2:sym})}
 endsnippet
 
 snippet any "and_yield" w
-and_yield(${1:values})
+and_yield${1:(${2:values})}
 endsnippet
 
 snippet annot "any_number_of_times" w
 endsnippet
 
 snippet con "context"
-context "${1:context}" do
+context '${1:context}' do
   $0
 end
 endsnippet
 endsnippet
 
 snippet des "Describe"
-describe "${1:subject}" do
+describe '${1:subject}' do
   $0
 end
 endsnippet
 
-snippet dest "Describe_type"
+snippet dest "Describe Type"
 describe ${1:Type} do
   $0
 end
 endsnippet
 
-snippet dests "Describe_type_string"
+snippet dests "Describe Type string"
 describe ${1:Type}, "${2:description}" do
   $0
 end
 exactly(${1:n}).times
 endsnippet
 
-# TODO: the middle tabstop on these next two should be $0, but UltiSnips
-# doesn't handle this correctly yet
 snippet its "it should"
-it "should ${1:do something}"${2: do
-  $3
+it 'should ${1:do something}'${2: do
+	$3
 end}
 endsnippet
 
 snippet it "It"
-it "${1:does something}"${2: do
-  $3
+it '${1:does something}'${2: do
+	$3
 end}
 endsnippet
 
 
 endsnippet
 
-snippet moc "mock"
+snippet moc "mock" b
 ${1:var} = mock("${2:mock_name}"${3:, :null_object => true})
-$0
 endsnippet
 
 snippet mm "mock_model"
-mock_model(${1:model})$0
+mock_model${1:(${2:model})}
 endsnippet
 
-snippet mocw "mock_with"
-RSpec::Runner.configure do |config|
+snippet mocw "mock_with" b
+RSpec.configure do |config|
 	config.mock_with :${0:mocha|flexmock|rr}
 end
 endsnippet
 once
 endsnippet
 
-snippet reqs "Require spec_helper"
+snippet reqs "Require spec_helper" b
 require 'spec_helper'
 
 
 endsnippet
 
-snippet shbs "response_should_be_success"
+snippet shbs "response.should be_success"
 response.should be_success
-$0
 endsnippet
 
-snippet shnbs "response_should_not_be_success"
+snippet shnbs "response.should_not be_success"
 response.should_not be_success
-$0
 endsnippet
 
 snippet conn "Set Controller for Spec"
 controller_name :${1:controller}
 endsnippet
 
-snippet bef "setup"
+snippet bef "before block" b
 before(${1::each}) do
   $0
 end
 endsnippet
 
-snippet sh= "should =="
-${1:target}.should == ${2:value}
-$0
+snippet sh= "should ==" w
+should == ${1:value}
 endsnippet
 
-snippet shm "should =~"
-${1:target}.should =~ /${2:regexp}/
-$0
+snippet sh= "should ==" !b
+${1:subject}.should == ${2:value}
 endsnippet
 
-snippet she "should eql"
-${1:target}.should eql(${2:value})
-$0
+snippet shm "should =~" w
+should =~ /${1:regexp}/
 endsnippet
 
-snippet shb "should_be"
-${1:target}.should be(${2:result})
-$0
+snippet shm "should =~" !b
+${1:subject}.should =~ /${2:regexp}/
 endsnippet
 
-snippet shbko "should_be_a_kind_of"
-${1:target}.should be_a_kind_of(${2:klass})
-$0
+snippet she "should eql" w
+should eql(${1:value})
 endsnippet
 
-snippet shbio "should_be_an_instance_of"
-${1:target}.should be_instance_of(${2:klass})
-$0
+snippet she "should eql" !b
+${1:subject}.should eql${2:(${3:value})}
 endsnippet
 
-snippet shbc "should_be_close"
-${1:target}.should be_close(${2:result}, ${3:tolerance})
-$0
+snippet shb "should be" w
+should be${1:(${2:result})}
 endsnippet
 
-snippet shbr "should_be_redirect"
-response.should be_redirect
-$0
+snippet shb "should be" !b
+${1:subject}.should be${2:(${3:result})}
 endsnippet
 
-snippet she "should_equal"
-${1:target}.should equal(${2:value})
-$0
+snippet shbko "should be_a_kind_of" !b
+${1:subject}.should be_a_kind_of${2:(${3:klass})}
 endsnippet
 
-snippet shh "should_have"
-${1:target}.should have(${2:num}).${3:things}
-$0
+snippet shbio "should be_instance_of" !b
+${1:subject}.should be_instance_of${2:(${3:klass})}
 endsnippet
 
-snippet shhal "should_have_at_least"
-${1:target}.should have_at_least(${2:num}).${3:things}
-$0
+snippet shbc "should be_close" !b
+${1:subject}.should be_close(${2:result}, ${3:tolerance})
 endsnippet
 
-snippet shham "should_have_at_most"
-${1:target}.should have_at_most(${2:num}).${3:things}
-$0
+snippet shin "should include" !b
+${1:subject}.should include(${2:object}${3:, ${4:object2}})
 endsnippet
 
-snippet shhr "should_have_records"
-${1:target}.should have(${2:x}).records
-$0
+snippet shbr "should be_redirect"
+response.should be_redirect
 endsnippet
 
-snippet shm "should_match"
-${1:target}.should match(/${2:regexp}/)
-$0
+snippet she "should equal" !b
+${1:subject}.should equal${2:(${3:value})}
 endsnippet
 
-snippet shn= "should_not =="
-${1:target}.should_not == ${2:value}
-$0
+snippet shh "should have" !b
+${1:subject}.should have(${2:num}).${3:things}
 endsnippet
 
-snippet shnm "should_not =~"
-${1:target}.should_not =~ /${2:regexp}/
-$0
+snippet shhal "should have_at_least" !b
+${1:subject}.should have_at_least(${2:num}).${3:things}
 endsnippet
 
-snippet shne "should_not eql"
-${1:target}.should_not eql(${2:value})
-$0
+snippet shham "should have_at_most" !b
+${1:subject}.should have_at_most(${2:num}).${3:things}
 endsnippet
 
-snippet shnb "should_not_be"
-${1:target}.should_not be(${2:result})
-$0
+snippet shhr "should have_records" !b
+${1:subject}.should have(${2:x}).records
 endsnippet
 
-snippet shkof "should_not_be_a_kind_of"
-${1:target}.should_not be_a_kind_of(${2:klass})
-$0
+snippet shm "should_match" !b
+${1:subject}.should match(/${2:regexp}/)
 endsnippet
 
-snippet shbio "should_not_be_an_instance_of"
-${1:target}.should_not be_instance_of(${2:klass})
-$0
+snippet shn= "should_not ==" !b
+${1:subject}.should_not == ${2:value}
 endsnippet
 
-snippet shnbc "should_not_be_close"
-${1:target}.should_not be_close(${2:result}, ${3:tolerance})
-$0
+snippet shnm "should_not =~" !b
+${1:subject}.should_not =~ /${2:regexp}/
 endsnippet
 
-snippet shnbr "should_not_be_redirect"
-response.should_not be_redirect
-$0
+snippet shne "should_not eql" !b
+${1:subject}.should_not eql${2:(${3:value})}
 endsnippet
 
-snippet shne "should_not_equal"
-${1:target}.should_not equal(${2:value})
-$0
+snippet shnb "should_not be(predicate)" !b
+${1:subject}.should_not be${2:(${3:predicate})}
 endsnippet
 
-snippet shnm "should_not_match"
-${1:target}.should_not match(/${2:regexp}/)
-$0
+snippet shkof "should_not be_a_kind_of" !b
+${1:subject}.should_not be_a_kind_of${2:(${3:klass})}
 endsnippet
 
-snippet shnp "should_not_predicate"
-${1:target}.should_not ${2:be_${3:predicate}} $4
-$0
+snippet shbio "should_not be_instance_of" !b
+${1:subject}.should_not be_instance_of${2:(${3:klass})}
 endsnippet
 
-snippet shnre "should_not_raise"
-lambda { $1 }.should_not raise_error(${2:error})
-$0
+snippet shnbc "should_not be_close" !b
+${1:subject}.should_not be_close(${2:result}, ${3:tolerance})
 endsnippet
 
-snippet shnr "should_not_receive"
-${1:mock}.should_not_receive(:${2:message})$3
-$0
-
+snippet shnin "should not_include" !b
+${1:subject}.should_not include(${2:object}${3:, ${4:object2}})
 endsnippet
 
-snippet shnrt "should_not_respond_to"
-${1:target}.should_not respond_to(:${2:sym})
-$0
+snippet shnbr "should_not be_redirect"
+response.should_not be_redirect
 endsnippet
 
-snippet shns "should_not_satisfy"
-${1:target}.should_not satisfy { |obj| $2 }
-$0
+snippet shne "should_not equal" !b
+${1:subject}.should_not equal${2:(${3:value})}
 endsnippet
 
-snippet shnt "should_not_throw"
-lambda { $1 }.should_not throw_symbol(:${2:symbol})
-$0
+snippet shnm "should_not match" !b
+${1:subject}.should_not match${2:(/${3:regexp}/)}
 endsnippet
 
-snippet shp "should_predicate"
-${1:target}.should ${2:be_${3:predicate}} $4
-$0
+snippet shnp "should_not be_{predicate}" !b
+${1:subject}.should_not ${2:be_${3:predicate}}
 endsnippet
 
-snippet shre "should_raise"
-lambda { $1 }.should raise_error(${2:error})
-$0
+snippet shnre "should_not raise" !b
+expect { $1 }.not_to raise_error${2:(${3:error})}
 endsnippet
 
-snippet shr "should_receive"
-${1:mock}.should_receive(:${2:message})$3
+snippet shnr "should_not_receive" !b
+${1:mock}.should_not_receive${2:(:${3:message})}
 endsnippet
 
-snippet wia "should_receive_with_args"
-with(${1})$2
+snippet shnrt "should_not respond_to" !b
+${1:subject}.should_not respond_to${2:(:${3:sym})}
 endsnippet
 
-snippet shrt "should_redirect_to"
-response.should redirect_to(${1:url})
-$0
+snippet shns "should_not satisfy" !b
+${1:subject}.should_not satisfy { |obj| $2 }
 endsnippet
 
-snippet shrt "should_render"
-response.should render_template(:${1:template})
-$0
+snippet shnt "should_not throw" !b
+expect { $1 }.should_not throw_symbol${2:(:${3:symbol})}
 endsnippet
 
-snippet shrt "should_respond_to"
-${1:target}.should respond_to(:${2:sym})
-$0
+snippet shp "should be_{predicate}" !b
+${1:subject}.should ${2:be_${3:predicate}}
 endsnippet
 
-snippet shs "should_satisfy"
-${1:target}.should satisfy { |obj| $2 }
-$0
+snippet shre "should raise" !b
+expect { $1 }.to raise_error${2:(${3:error})}
 endsnippet
 
-snippet sht "should_throw"
-lambda { $1 }.should throw_symbol(:${2:symbol})
-$0
+snippet shr "should_receive" !b
+${1:mock}.should_receive${2:(:${3:message})}
 endsnippet
 
-snippet stu "stub"
-${1:double}.stub(:${2:message})$3
+snippet wia "with(args)"
+with(${1})
 endsnippet
 
-snippet aft "teardown"
+snippet shrt "should redirect_to"
+response.should redirect_to${1:(${2:url})}
+endsnippet
+
+snippet shrt "should render_template"
+response.should render_template${1:(:${2:template})}
+endsnippet
+
+snippet shrt "should respond_to" !b
+${1:subject}.should respond_to${2:(:${3:sym})}
+endsnippet
+
+snippet shs "should satisfy" !b
+${1:subject}.should satisfy { |obj| $2 }
+endsnippet
+
+snippet sht "should throw" !b
+expect { $1 }.should throw_symbol${2:(:${3:symbol})}
+endsnippet
+
+snippet stu "stub" w
+stub(:${1:message})
+endsnippet
+
+snippet stu "stub" !b
+${1:double}.stub(:${2:message})
+endsnippet
+
+snippet aft "teardown after block" b
 after(${1::each}) do
   $0
 end
 twice
 endsnippet
 
-snippet let "let"
+snippet let "let" b
 let(:${1:symbol}) { $2 }
 endsnippet
 
-snippet letb "let block"
+snippet letb "let block" b
 let :${1:symbol} do
   $2
 end
-$0
 endsnippet
 
-snippet subj "subject"
+snippet subj "subject" b
 subject { $1 }
 endsnippet
 
-snippet exp "expect to"
+snippet exp "expect to" b
 expect do
   $1
 end.to ${2:change {${3:subject}}.${4:from($5).to($6)}}
 endsnippet
 
+snippet sef "shared_examples_for" b
+shared_examples_for '${1:group description}' do
+  $2
+end
+endsnippet
+
+snippet shbl "it_behaves_like" b
+it_behaves_like '${1:shared example group}'
+endsnippet
+
+#
+# Capybara magic predicate matchers
+#
+# These now wait for Ajax so that `should_not have_xpath` is equivalent to
+# `should have_no_xpath`, etc.
+#
+# Unfortunately also have placeholder issues currently
+snippet shhs "should have_selector" !b
+${1:subject}.should have_selector(${2::xpath, }${3:selector})
+endsnippet
+
+snippet shnhs "should_not have_selector" !b
+${1:subject}.should_not have_selector(${2::xpath, }${3:selector})
+endsnippet
+
+snippet shhxp "should have_xpath" !b
+${1:subject}.should have_xpath${2:(${3:selector})}
+endsnippet
+
+snippet shnhxp "should_not have_xpath" !b
+${1:subject}.should_not have_xpath${2:(${3:selector})}
+endsnippet
+
+snippet shhcss "should have_css" !b
+${1:subject}.should have_css${2:(${3:selector})}
+endsnippet
+
+snippet shnhcss "should_not have_css" !b
+${1:subject}.should_not have_css${2:(${3:selector})}
+endsnippet
+
+snippet shhc "should have_content" !b
+${1:subject}.should have_content${2:('$3')}
+endsnippet
+
+snippet shnhc "should_not have_content" !b
+${1:subject}.should_not have_content${2:('$3')}
+endsnippet
+

File .vim/UltiSnips/ruby.snippets

-snippet rb "#!;usr;local;bin;ruby -w"
-#!/usr/bin/env ruby${TM_RUBY_SWITCHES: -wKU}
+# TODO: move TM variable global functions to all.snippets?
+global !p
+def tm_filename(snip):
+    snip.rv = snip.fn
+    return snip
+endglobal
+
+global !p
+def file_basename(snip):
+    snip.rv = snip.basename
+    return snip
+endglobal
+
+snippet rb "#!/usr/bin/env ruby -w" b
+#!/usr/bin/env ruby${1: -${2:wKU}}
 
 endsnippet
 
-snippet ife "060 ruby if else"
-if ${1:condition}
-	$2
-else
-	$3
-end
+# shamelessly borrowed from the python snippets
+# TODO: exclude after bracket chars too
+snippet /(^|(?<=\W))\./ "self." r
+self.
 endsnippet
 
-snippet if "070 ruby if"
-if ${1:condition}
-	$0
-end
-endsnippet
-
-snippet case "080 ruby case"
-case ${1:object}
-when ${2:condition}
-	$0
-end
+snippet elsif "elsif ___"
+elsif ${1:condition}
+	${2:# TODO}
 endsnippet
 
 snippet y ":yields: RDoc comment"
 # => 
 endsnippet
 
-snippet Array "Array.new(10) { |i| .. }  (Arr)"
+snippet Array "Array.new(10) { |i| .. }  (Array)"
 Array.new(${1:10}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:i}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }
 endsnippet
 
 File.read(${1:"${2:path/to/file}"})
 endsnippet
 
-snippet Hash "Hash.new { |hash, key| hash[key] = .. }  (Has)"
-Hash.new { |${1:hash}, ${2:key}| ${1:hash}[${2:key}] = $0 }
+snippet Hash "Hash.new { |hash, key| hash[key] = .. }  (Hash)"
+Hash.new { |${1:hash}, ${2:key}| $1[$2] = $3 }
 endsnippet
 
 snippet Md "Marshal.dump(obj, file)  (Md)"
-File.open(${1:"${2:path/to/file}.dump"}, "wb") { |${3:file}| Marshal.dump(${4:obj}, ${3:file}) }
+File.open(${1:"${2:path/to/file}.dump"}, "wb") { |${3:file}| Marshal.dump(${4:obj}, $3) }
 endsnippet
 
 snippet Ml "Marshal.load(obj)  (Ml)"
-File.open(${1:"${2:path/to/file}.dump"}, "rb") { |${3:file}| Marshal.load(${3:file}) }
+File.open(${1:"${2:path/to/file}.dump"}, "rb") { |${3:file}| Marshal.load($3) }
 endsnippet
 
 snippet Pn- "PStore_new( __ )"
 PStore.new(${1:"${2:file_name.pstore}"})
 endsnippet
 
+# TODO
 snippet =b "RDoc documentation block"
 `[[ $TM_LINE_INDEX != 0 ]] && echo; echo`=begin rdoc
 	$0
 =end
 endsnippet
 
+# TODO - intended to have a key shortcut trigger for wrapping text
 snippet begin "Wrap in Begin … Rescue … End"
 ${TM_SELECTED_TEXT/([\t ]*).*/$1/m}begin
 	${3:${TM_SELECTED_TEXT/(\A.*)|(.+)|\n\z/(?1:$0:(?2:\t$0))/g}}
 endsnippet
 
 snippet Yd- "YAML.dump(.., file)  (Yd-)"
-File.open(${1:"${2:path/to/file}.yaml"}, "w") { |${3:file}| YAML.dump(${4:obj}, ${3:file}) }
+File.open(${1:"${2:path/to/file}.yaml"}, "w") { |${3:file}| YAML.dump(${4:obj}, $3) }
 endsnippet
 
 snippet Yl- "YAML.load(file)  (Yl-)"
-File.open(${1:"${2:path/to/file}.yaml"}) { |${3:file}| YAML.load(${3:file}) }
+File.open(${1:"${2:path/to/file}.yaml"}) { |${3:file}| YAML.load($3) }
 endsnippet
 
 snippet end "__END__"
 alias_method :${1:new_name}, :${0:old_name}
 endsnippet
 
-snippet all "all? { |e| .. }  (all)"
+snippet all "all? { |e| .. }  (all)" w
 all? { |${1:e}| $0 }
 endsnippet
 
-snippet any "any? { |e| .. }  (any)"
+snippet any "any? { |e| .. }  (any)" w
 any? { |${1:e}| $0 }
 endsnippet
 
-snippet app "application_code ..  (app)"
+snippet app "application { .. } (app)"
 if __FILE__ == \$PROGRAM_NAME
 	$0
 end
 endsnippet
 
+# TODO
 snippet as "assert(..)  (as)"
 assert`snippet_paren.rb`${1:test}, "${0:Failure message.}"`snippet_paren.rb end`
 endsnippet
 assert_throws(:${1:expected}) { $0 }
 endsnippet
 
-snippet rw "attr_accessor ..  (rw)"
-attr_accessor :${0:attr_names}
-endsnippet
-
-snippet r "attr_reader ..  (r)"
-attr_reader :${0:attr_names}
-endsnippet
-
-snippet w "attr_writer ..  (w)"
-attr_writer :${0:attr_names}
-endsnippet
-
-snippet cla- "class .. &lt; DelegateClass .. initialize .. end  (class)"
-class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} < DelegateClass(${2:ParentClass})
+# TODO
+# class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} < DelegateClass(${2:ParentClass})
+#class ${1:`!p tm_filename(snip)`}${1/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} < DelegateClass(${2:ParentClass})
+snippet cla- "class .. > DelegateClass .. initialize .. end  (class)"
+class ${1:`!p file_basename(snip)`}${1/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} < DelegateClass(${2:ParentClass})
 	def initialize${3/(^.*?\S.*)|.*/(?1:\()/}${3:args}${3/(^.*?\S.*)|.*/(?1:\))/}
 		super(${4:del_obj})
-		
+
 		$0
 	end
-	
-	
+
+
 end
 endsnippet
 
-snippet cla "class .. &lt; ParentClass .. initialize .. end"
+snippet cla "class .. < ParentClass .. initialize .. end"
 class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} < ${2:ParentClass}
 	def initialize${3/(^.*?\S.*)|.*/(?1:\()/}${3:args}${3/(^.*?\S.*)|.*/(?1:\))/}
 		$0
 	end
-	
-	
+
+
 end
 endsnippet
 
-snippet cla "class .. &lt; Struct .. initialize .. end"
+snippet cla "class .. < Struct .. initialize .. end"
 ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} = Struct.new(:${2:attr_names}) do
 	def ${3:method_name}
 		$0
 	end
-	
-	
+
+
 end
 endsnippet
 
-snippet tc "class .. &lt; Test;;Unit;;TestCase .. end  (tc)"
-require "test/unit"
+snippet tc "class .. < Test::Unit::TestCase .. end  (tc)"
+require 'test/unit'
 
-require "${1:library_file_name}"
+require '${1:library_file_name}'
 
 class Test${2:${1/([\w&&[^_]]+)|./\u$1/g}} < Test::Unit::TestCase
 	def test_${3:case_name}
 	def initialize${2/(^.*?\S.*)|.*/(?1:\()/}${2:args}${2/(^.*?\S.*)|.*/(?1:\))/}
 		$0
 	end
-	
-	
+
+
 end
 endsnippet
 
 snippet cla "class .. instance_methods .. undef .. initialize .. end  (class)"
 class ${1:BlankSlate}
 	instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ }
-	
+
 	def initialize${2/(^.*?\S.*)|.*/(?1:\()/}${2:args}${2/(^.*?\S.*)|.*/(?1:\))/}
 		@${3:delegate} = ${4:delegate_object}
-		
+
 		$0
 	end
-	
+
 	def method_missing(meth, *args, &block)
 		@${3:delegate}.send(meth, *args, &block)
 	end
-	
-	
+
+
 end
 endsnippet
 
-snippet cla "class &lt;&lt; self __ end"
+snippet cla "class << self __ end"
 class << ${1:self}
 	$0
 end
 Marshal.load(Marshal.dump(${0:obj_to_copy}))
 endsnippet
 
-snippet def "def end"
-def ${1:method_name}
+snippet defo "def(*args, opts={}) ... end"
+def ${1:method_name}(${2:*args}${3:, opts=\{\}})
+	$0
+end
+endsnippet
+
+# FIXME: compliance test for UltiSnips transformations? :-)
+snippet defm "define_method ... end"
+define_method :${1:method_name} do${2/.+/ |/}${2:args}${2/.+/|/}
 	$0
 end
 endsnippet
 end
 endsnippet
 
-snippet deft "def test_ .. end  (t)"
+snippet deft "def test_ .. end  (deft)"
 def test_${1:case_name}
 	$0
 end
 detect { |${1:e}| $0 }
 endsnippet
 
-snippet dir "directory()"
+snippet dir "File.dirname(__FILE__)"
 File.dirname(__FILE__)
 endsnippet
 
-snippet do "do |obj| .. end (doo)"
+# TODO
+snippet do "do |obj| .. end (doo)" w
 do${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1: |)/}${1:variable}${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}
 	$0
 end
 each_with_index { |${1:e}, ${2:i}| $0 }
 endsnippet
 
-snippet elsif "elsif ___"
-elsif ${1:condition}
-	$0
-endsnippet
-
-snippet Forw- "extend Forwardable  (Forw)"
+snippet Forw- "extend Forwardable  (Forw-)"
 extend Forwardable
 endsnippet
 
+# TODO
 snippet fet "fetch(name) { |key| .. }  (fet)"
 fetch(${1:name}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:key}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }
 endsnippet
 gsub(/${1:pattern}/) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:match}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }
 endsnippet
 
-snippet : "hash pair (:)"
+snippet : ":key => value (:)" i
 :${1:key} => ${2:"${3:value}"}${4:, }
 endsnippet
 
 loop { $0 }
 endsnippet
 
-snippet map "map { |e| .. }  (map)" w
-map { |${1:e}| $0 }
-endsnippet
-
 snippet mapwi- "map_with_index { |e, i| .. }  (mapwi)" w
 enum_with_index.map { |${1:e}, ${2:i}| $0 }
 endsnippet
 	module ClassMethods
 		$0
 	end
-	
+
 	module InstanceMethods
-		
+
 	end
-	
+
 	def self.included(receiver)
 		receiver.extend         ClassMethods
 		receiver.send :include, InstanceMethods
 snippet mod "module .. module_function .. end"
 module ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}}
 	module_function
-	
+
 	$0
 end
 endsnippet
 endsnippet
 
 snippet optp "option_parse { .. }  (optp)"
-require "optparse"
+require 'optparse'
 
 options = {${1::default => "args"}}
 
 ARGV.options do |opts|
 	opts.banner = "Usage:  #{File.basename(\$PROGRAM_NAME)} [OPTIONS]${2/^\s*$|(.*\S.*)/(?1: )/}${2:OTHER_ARGS}"
-	
+
 	opts.separator ""
 	opts.separator "Specific Options:"
-	
+
 	$0
-	
+
 	opts.separator "Common Options:"
-	
+
 	opts.on( "-h", "--help",
 	         "Show this message." ) do
 		puts opts
 		exit
 	end
-	
+
 	begin
 		opts.parse!
 	rescue
 
 endsnippet
 
-snippet par "partition { |e| .. }  (par)"
+snippet par "partition { |e| .. }  (par)" w
 partition { |${1:e}| $0 }
 endsnippet
 
 sort_by { rand }
 endsnippet
 
-snippet rej "reject { |e| .. }  (rej)"
-reject { |${1:e}| $0 }
-endsnippet
-
 snippet req "require '..'  (req)"
-require "$0"
+require '$0'
 endsnippet
 
 snippet ts "require 'tc_..' ..  (ts)"
-require "test/unit"
+require 'test/unit'
 
-require "tc_${1:test_case_file}"
-require "tc_${2:test_case_file}"
+require 'tc_${1:test_case_file}'
+require 'tc_${2:test_case_file}'
 
 endsnippet
 
 snippet reqg- "require_gem '__'"
-require "$0"
+require_gem '$0'
 endsnippet
 
 snippet rep "results_report(__) { __ }"
 results.report("${1:name}:") { TESTS.times { $0 } }
 endsnippet
 
-snippet reve "reverse_each { |e| .. }  (rea)"
+snippet reve "reverse_each { |e| .. }  (rea)" w
 reverse_each { |${1:e}| $0 }
 endsnippet
 
-snippet sca "scan(;..;) { |match| .. }  (sca)"
+snippet sca "scan(;..;) { |match| .. }  (sca)" w
 scan(/${1:pattern}/) { |${2:match}| $0 }
 endsnippet
 
-snippet sel "select { |e| .. }  (sel)"
-select { |${1:e}| $0 }
-endsnippet
-
 snippet sinc "singleton_class()"
 class << self; self end
 endsnippet
 
-snippet sor "sort { |a, b| .. }  (sor)"
+snippet sor "sort { |a, b| .. }  (sor)" w
 sort { |a, b| $0 }
 endsnippet
 
-snippet sorb "sort_by { |e| .. }  (sorb)"
+snippet sorb "sort_by { |e| .. }  (sorb)" w
 sort_by { |${1:e}| $0 }
 endsnippet
 
-snippet ste "step(2) { |e| .. }  (ste)"
+snippet ste "step(2) { |e| .. }  (ste)" w
 step(${1:2}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:n}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }
 endsnippet
 
-snippet sub "sub(;..;) { |match| .. }  (sub)"
+snippet sub "sub(;..;) { |match| .. }  (sub)" w
 sub(/${1:pattern}/) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:match}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }
 endsnippet
 
 end
 endsnippet
 
-snippet tim "times { |n| .. }  (tim)"
+snippet tim "times { |n| .. }  (tim)" w
 times { ${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${1:n}${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }
 endsnippet
 
 end
 endsnippet
 
-snippet opt "untitled"
+snippet opt "opts.on(...)"
 opts.on( "-${1:o}", "--${2:long-option-name}"${3/^\s*$|(.*\S.*)/(?1:, )/}${3:String},
          "${4:Option description.}" ) do |${6:opt}|
 	$0
 upto(${1:1.0/0.0}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:n}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }
 endsnippet
 
-snippet usai "usage_if()  (usai)"
+snippet usai "usage if()  (usai)"
 if ARGV.$1
 	abort "Usage:  #{\$PROGRAM_NAME} ${2:ARGS_GO_HERE}"
 end
 endsnippet
 
-snippet usau "usage_unless()  (usau)"
+snippet usau "usage unless()  (usau)"
 unless ARGV.$1
 	abort "Usage:  #{\$PROGRAM_NAME} ${2:ARGS_GO_HERE}"
 end
 end
 endsnippet
 
-snippet zip "zip(enums) { |row| .. }  (zip)"
+snippet zip "zip(enums) { |row| .. }  (zip)" w
 zip(${1:enums}) { |${2:row}| $0 }
 endsnippet
 
 ###########################################################################
 
 extends rails
-extends rspec
+#extends rspec
 

File .vim/UltiSnips/scala.snippets

+# Refer to the Scala style guide at:
+#   http://docs.scala-lang.org/style/
+
+# See http://www.scala-lang.org/node/166
+snippet '^#!' "Scala shell script shebang" r
+#!/bin/sh
+exec scala "\$0" "\$@"
+!#
+
+endsnippet
+
+
+snippet im "Import, with optional enumerations" b
+import ${1:packag