mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -62,6 +62,12 @@ so that all users can benefit from them. People can list their snippet reposito
|
||||
|
||||
Installation using VAM: "github:rbonvall/snipmate-snippets-bib"
|
||||
|
||||
|
||||
## If you believe in the success of vim-snipmate
|
||||
then you may also want to have a look at [vim-git-wiki](http://github.com/MarcWeber/vim-git-wiki).
|
||||
If you contribute to this git based wiki editable by Vim we have a chance
|
||||
of making it official at www.vim.org.
|
||||
|
||||
Historical notes
|
||||
================
|
||||
|
||||
|
@ -9,6 +9,8 @@ snippet ddate
|
||||
`strftime("%B %d, %Y")`
|
||||
snippet time
|
||||
`strftime("%H:%M")`
|
||||
snippet datetime
|
||||
`strftime("%Y-%m-%d %H:%M")`
|
||||
snippet lorem
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
snippet GPL2
|
||||
|
@ -161,3 +161,40 @@ snippet obj
|
||||
F.prototype = o;
|
||||
return new F();
|
||||
}
|
||||
# Define multiple properties
|
||||
snippet props
|
||||
var ${1:my_object} = Object.defineProperties(
|
||||
${2:new Object()},
|
||||
{
|
||||
${3:property} : {
|
||||
get : function $1_$3_getter() {
|
||||
// getter code
|
||||
},
|
||||
set : function $1_$3_setter(value) {
|
||||
// setter code
|
||||
},
|
||||
value : ${4:value},
|
||||
writeable : ${5:boolean},
|
||||
enumerable : ${6:boolean},
|
||||
configurable : ${7:boolean}
|
||||
}
|
||||
}
|
||||
);
|
||||
# Define single property
|
||||
snippet prop
|
||||
Object.defineProperty(
|
||||
${1:object},
|
||||
"${2:property}",
|
||||
{
|
||||
get : function $1_$2_getter() {
|
||||
// getter code
|
||||
},
|
||||
set : function $1_$2_setter(value) {
|
||||
// setter code
|
||||
},
|
||||
value : ${3:value},
|
||||
writeable : ${4:boolean},
|
||||
enumerable : ${5:boolean},
|
||||
configurable : ${6:boolean}
|
||||
}
|
||||
);
|
||||
|
@ -79,7 +79,7 @@ snippet clatin1
|
||||
snippet cascii
|
||||
# -*- coding: ascii -*-
|
||||
# Lambda
|
||||
snippet ld
|
||||
snippet lda
|
||||
${1:var} = lambda ${2:vars} : ${3:action}
|
||||
snippet .
|
||||
self.
|
||||
@ -162,3 +162,18 @@ snippet getopt
|
||||
${4}
|
||||
elif option in ("-v", "--verbose"):
|
||||
verbose = argument
|
||||
# logging
|
||||
# glog = get log
|
||||
snippet glog
|
||||
import logging
|
||||
logger = logging.getLogger(${1:__name__})
|
||||
snippet le
|
||||
logger.error(${1:msg})
|
||||
snippet ld
|
||||
logger.debug(${1:msg})
|
||||
snippet lw
|
||||
logger.warning(${1:msg})
|
||||
snippet lc
|
||||
logger.critical(${1:msg})
|
||||
snippet li
|
||||
logger.info(${1:msg})
|
||||
|
@ -680,6 +680,8 @@ snippet hmt
|
||||
has_many :${1:object}, :through => :${2:object}
|
||||
snippet ho
|
||||
has_one :${1:object}
|
||||
snippet hod
|
||||
has_one :${1:object}, dependent: :${2:destroy}
|
||||
snippet i18
|
||||
I18n.t('${1:type.key}')${2}
|
||||
snippet ist
|
||||
@ -967,3 +969,5 @@ snippet shared
|
||||
shared_examples "${1:shared examples name}" ${2}
|
||||
snippet itb
|
||||
it_behaves_like "${1:shared examples name}"${2}
|
||||
snippet ana
|
||||
accepts_nested_attributes_for :${1:association}
|
||||
|
Reference in New Issue
Block a user