mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated all plugins that are non-forked. Added some new plugins.
Added update_plugins.py which can fetch new plugins from GitHub. New plugins added: zencoding, vim-indent-object, taglist, nginx.vim
This commit is contained in:
@ -0,0 +1 @@
|
||||
assert_redirected_to ${1::action => "${2:index}"}
|
@ -0,0 +1 @@
|
||||
assert_redirected_to <+<+parent+>_<+child+>_path(<+@<+parent+>+>, <+@<+child+>+>)+>
|
@ -0,0 +1 @@
|
||||
assert_redirected_to <+<+parent+>_<+child+>_path(<+@<+parent+>+>)+>
|
@ -0,0 +1 @@
|
||||
assert_redirected_to <+<+model+>_path(<+@<+model+>+>)+>
|
@ -0,0 +1 @@
|
||||
assert_redirected_to <+<+model+>s_path+>
|
@ -0,0 +1,3 @@
|
||||
assert_difference "${1:Model}.${2:count}", $1 do
|
||||
${3}
|
||||
end
|
@ -0,0 +1,3 @@
|
||||
assert_no_difference "${1:Model}.${2:count}" do
|
||||
${3}
|
||||
end
|
@ -0,0 +1 @@
|
||||
assert_response :${1:success}, @response.body${2}
|
@ -0,0 +1 @@
|
||||
assert_rjs :<+replace+>, <+"<+dom id+>"+>
|
@ -0,0 +1 @@
|
||||
assert_select '<+path+>'<+, :<+text+> => <+'<+inner_html+>'+>+> <+do<++>+>
|
@ -0,0 +1 @@
|
||||
before_filter :${1:method}
|
@ -0,0 +1 @@
|
||||
belongs_to :${1:association}
|
@ -0,0 +1 @@
|
||||
cattr_accessor :${1:attr_names}
|
@ -0,0 +1,14 @@
|
||||
def create
|
||||
@${1:model_class_name} = ${2:ModelClassName}.new(params[:$1])
|
||||
|
||||
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${3}
|
@ -0,0 +1,9 @@
|
||||
def destroy
|
||||
@${1:model_class_name} = ${2:ModelClassName}.find(params[:id])
|
||||
@$1.destroy
|
||||
|
||||
respond_to do |wants|
|
||||
wants.html { redirect_to($1s_url) }
|
||||
wants.xml { head :ok }
|
||||
end
|
||||
end${3}
|
@ -0,0 +1,3 @@
|
||||
def edit
|
||||
@${1:model_class_name} = ${2:ModelClassName}.find(params[:id])
|
||||
end
|
@ -0,0 +1,8 @@
|
||||
def index
|
||||
@${1:model_class_name} = ${2:ModelClassName}.all
|
||||
|
||||
respond_to do |wants|
|
||||
wants.html # index.html.erb
|
||||
wants.xml { render :xml => @$1s }
|
||||
end
|
||||
end${3}
|
@ -0,0 +1,8 @@
|
||||
def new
|
||||
@${1:model_class_name} = ${2:ModelClassName}.new
|
||||
|
||||
respond_to do |wants|
|
||||
wants.html # new.html.erb
|
||||
wants.xml { render :xml => @$1 }
|
||||
end
|
||||
end${3}
|
@ -0,0 +1,8 @@
|
||||
def show
|
||||
@${1:model_class_name} = ${2:ModelClassName}.find(params[:id])
|
||||
|
||||
respond_to do |wants|
|
||||
wants.html # show.html.erb
|
||||
wants.xml { render :xml => @$1 }
|
||||
end
|
||||
end${3}
|
@ -0,0 +1,14 @@
|
||||
def update
|
||||
@${1:model_class_name} = ${2:ModelClassName}.find(params[:id])
|
||||
|
||||
respond_to do |wants|
|
||||
if @$1.update_attributes(params[:$1])
|
||||
flash[:notice] = '$2 was successfully updated.'
|
||||
wants.html { redirect_to(@$1) }
|
||||
wants.xml { head :ok }
|
||||
else
|
||||
wants.html { render :action => "edit" }
|
||||
wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end${3}
|
@ -0,0 +1 @@
|
||||
find(:all<+, :conditions => ['<+<+field+> = ?+>', <+true+>]+>)
|
@ -0,0 +1 @@
|
||||
find(:first<+, :conditions => ['<+<+field+> = ?+>', <+true+>]+>)
|
@ -0,0 +1 @@
|
||||
find(<+id+>)
|
@ -0,0 +1 @@
|
||||
find(:last<+, :conditions => ['<+<+field+> = ?+>', <+true+>]+>)
|
@ -0,0 +1 @@
|
||||
flash[:${1:notice}] = "${2}"
|
@ -0,0 +1 @@
|
||||
has_and_belongs_to_many :${1:object}, :join_table => "${2:table_name}", :foreign_key => "${3}_id"${4}
|
@ -0,0 +1 @@
|
||||
has_many :${1:object}
|
@ -0,0 +1 @@
|
||||
has_many :<+object+>s<+, :class_name => "<+object+>", :foreign_key => "<+reference+>_id"+>, :dependent => :destroy<++>
|
@ -0,0 +1 @@
|
||||
has_many :${1:object}, :through => :${2:object}
|
@ -0,0 +1 @@
|
||||
has_one :${1:object}
|
@ -0,0 +1 @@
|
||||
I18n.t('${1:type.key}')${2}
|
@ -0,0 +1 @@
|
||||
<%= image_submit_tag("<+agree.png+>"<+<+, :id => "<+id+>"+><+, :name => "<+name+>"+><+, :class => "<+class+>"+><+, :disabled => <+false+>+>+>) %>
|
@ -0,0 +1 @@
|
||||
RAILS_DEFAULT_LOGGER.${1:debug} ${2}
|
@ -0,0 +1 @@
|
||||
logger.debug { "${1:message}" }${2}
|
@ -0,0 +1 @@
|
||||
logger.error { "${1:message}" }${2}
|
@ -0,0 +1 @@
|
||||
logger.fatal { "${1:message}" }${2}
|
@ -0,0 +1 @@
|
||||
logger.info { "${1:message}" }${2}
|
@ -0,0 +1 @@
|
||||
logger.warn { "${1:message}" }${2}
|
@ -0,0 +1 @@
|
||||
add_column :${1:table}, :${2:column}, :${3:type}
|
@ -0,0 +1 @@
|
||||
${1:map}.${2:connect} '${3:controller/:action/:id}'
|
@ -0,0 +1 @@
|
||||
${1:map}.catch_all "*${2:anything}", :controller => "${3:default}", :action => "${4:error}"${5}
|
@ -0,0 +1 @@
|
||||
${1:map}.resource :${2:resource}
|
@ -0,0 +1 @@
|
||||
${1:map}.resources :${2:resource}
|
@ -0,0 +1,3 @@
|
||||
${1:map}.with_options :${2:controller} => '${3:thing}' do |$3|
|
||||
${4}
|
||||
end
|
@ -0,0 +1 @@
|
||||
before_save :${1:method}
|
@ -0,0 +1 @@
|
||||
change_column :${1:table}, :${2:column}, :${3:type}
|
@ -0,0 +1 @@
|
||||
t.column :${1:title}, :${2:string}
|
@ -0,0 +1,3 @@
|
||||
change_table :${1:table_name} do |t|
|
||||
${2}
|
||||
end
|
@ -0,0 +1 @@
|
||||
remove_column :${1:table}, :${2:column}
|
@ -0,0 +1,3 @@
|
||||
create_table :${1:table_name} do |t|
|
||||
t.column :${2:name}, :${3:type}
|
||||
end
|
@ -0,0 +1,8 @@
|
||||
class ${1:`Snippet_MigrationNameFromFilename()`} < ActiveRecord::Migration
|
||||
def self.up
|
||||
${2}
|
||||
end
|
||||
|
||||
def self.down
|
||||
end
|
||||
end
|
@ -0,0 +1 @@
|
||||
map(&:${1:id})
|
@ -0,0 +1 @@
|
||||
remove_column :${1:column}
|
@ -0,0 +1 @@
|
||||
remove_column :${1:table}, :${2:column}
|
@ -0,0 +1 @@
|
||||
rename_column :${1:table}, :${2:old}, :${3:new}
|
@ -0,0 +1 @@
|
||||
mattr_accessor :${1:attr_names}
|
@ -0,0 +1 @@
|
||||
named_scope :<+name+><+, :joins => :<+table+>+>, :conditions => <+['<+<+field+> = ?+>', <+true+>]+>
|
@ -0,0 +1 @@
|
||||
named_scope :<+name+>, lambda { |<+param+>| { :conditions => <+['<+<+field+> = ?+>', <+param+>]+> } }
|
@ -0,0 +1 @@
|
||||
params[:${1:id}]${2}
|
@ -0,0 +1 @@
|
||||
render :action => "${1:action}"
|
@ -0,0 +1 @@
|
||||
render :action => "${1:action}", :layout => "${2:layoutname}"
|
@ -0,0 +1,3 @@
|
||||
respond_to do |wants|
|
||||
wants.${1:html} <+{ <++> }+>
|
||||
end
|
@ -0,0 +1 @@
|
||||
render :file => "${1:filepath}"
|
@ -0,0 +1 @@
|
||||
render :file => "${1:filepath}", :use_full_path => ${2:false}
|
@ -0,0 +1 @@
|
||||
render :inline => "<+<%= 'hello' %>+>"
|
@ -0,0 +1 @@
|
||||
render :inline => "${1:<%= 'hello' %>}", :locals => { ${2::name} => "${3:value}"${4} }
|
@ -0,0 +1 @@
|
||||
render :inline => "${1:<%= 'hello' %>}", :type => ${2::rxml}
|
@ -0,0 +1 @@
|
||||
render :json => ${1:text to render}
|
@ -0,0 +1 @@
|
||||
render :layout => "${1:layoutname}"
|
@ -0,0 +1 @@
|
||||
render :nothing => ${1:true}
|
@ -0,0 +1 @@
|
||||
render :nothing => ${1:true}, :status => ${2:401}
|
@ -0,0 +1 @@
|
||||
render :partial => "${1:item}"
|
@ -0,0 +1 @@
|
||||
render :partial => "<+item+>", :collection => <+@<+item+>s+>
|
@ -0,0 +1 @@
|
||||
render :partial => "<+item+>", :locals => { :<+item+> => <+@<+item+>+><++> }
|
@ -0,0 +1 @@
|
||||
render :partial => "<+item+>", :object => <+@<+item+>+>
|
@ -0,0 +1 @@
|
||||
render :partial => "${1:item}", :status => ${2:500}
|
@ -0,0 +1 @@
|
||||
render :text => "${1:text to render}"
|
@ -0,0 +1 @@
|
||||
render :text => "${1:text to render}", :layout => "${2:layoutname}"
|
@ -0,0 +1 @@
|
||||
render :text => "${1:text to render}", :layout => ${2:true}
|
@ -0,0 +1 @@
|
||||
render :text => "${1:text to render}", :status => ${2:401}
|
@ -0,0 +1,3 @@
|
||||
render :update do |${1:page}|
|
||||
$1.${2}
|
||||
end
|
@ -0,0 +1 @@
|
||||
render :xml => ${1:text to render}
|
@ -0,0 +1 @@
|
||||
Digest::SHA1.hexdigest(${1:string})
|
@ -0,0 +1,15 @@
|
||||
class ${1:ModelClassName}Sweeper < ActionController::Caching::Sweeper
|
||||
observe $1
|
||||
|
||||
def after_save(${2:model_class_name})
|
||||
expire_cache($2)
|
||||
end
|
||||
|
||||
def after_destroy($2)
|
||||
expire_cache($2)
|
||||
end
|
||||
|
||||
def expire_cache($2)
|
||||
expire_page
|
||||
end
|
||||
end
|
@ -0,0 +1,2 @@
|
||||
t.boolean :${1:title}
|
||||
${2}
|
@ -0,0 +1,2 @@
|
||||
t.binary :<+title+><+, :limit => <+2+>.megabytes+>
|
||||
<++>
|
@ -0,0 +1,2 @@
|
||||
t.decimal :<+title+><+<+, :precision => <+10+>+><+, :scale => <+2+>+>+>
|
||||
<++>
|
@ -0,0 +1,2 @@
|
||||
t.date :${1:title}
|
||||
${2}
|
@ -0,0 +1,2 @@
|
||||
t.datetime :${1:title}
|
||||
${2}
|
@ -0,0 +1,2 @@
|
||||
t.float :${1:title}
|
||||
${2}
|
@ -0,0 +1,2 @@
|
||||
t.change :<+name+><+, :<+string+><+, :<+limit+> => <+80+>+>+>
|
||||
<++>
|
@ -0,0 +1,2 @@
|
||||
t.integer :${1:title}
|
||||
${2}
|
@ -0,0 +1,2 @@
|
||||
t.integer :lock_version, :null => false, :default => 0
|
||||
${1}
|
@ -0,0 +1,2 @@
|
||||
t.references :<+taggable+><+, :polymorphic => <+{ :default => '<+Photo+>' }+>+>
|
||||
<++>
|
@ -0,0 +1,2 @@
|
||||
t.string :${1:title}
|
||||
${2}
|
@ -0,0 +1,2 @@
|
||||
t.text :${1:title}
|
||||
${2}
|
@ -0,0 +1,2 @@
|
||||
t.time :${1:title}
|
||||
${2}
|
@ -0,0 +1,2 @@
|
||||
t.timestamp :${1:title}
|
||||
${2}
|
@ -0,0 +1,2 @@
|
||||
t.timestamps
|
||||
${1}
|
@ -0,0 +1 @@
|
||||
t.remove :${1:column}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user