neosnippet.vim/autoload/neosnippet/snippets/javascript.snip

58 lines
886 B
Plaintext
Raw Normal View History

2012-02-02 04:33:35 +00:00
snippet :f
${1:method_name}: function(${2:attribute}) {
${0}
}
2012-02-02 04:33:35 +00:00
snippet func
alias function
options word
function ${1:function_name}(${2:argument}) {
${0:// body...}
}
2012-02-02 04:33:35 +00:00
snippet proto
options head
${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {
${0:// body...}
};
2012-02-02 04:33:35 +00:00
snippet f
options word
function(${1}) { ${0:$TM_SELECTED_TEXT} };
2012-02-02 04:33:35 +00:00
snippet if
options head
if (${1:true}) {
${0:$TM_SELECTED_TEXT}
}
2012-02-02 04:33:35 +00:00
snippet ife
options head
if (${1:true}) {
${0:$TM_SELECTED_TEXT}
} else {
}
2012-02-02 04:33:35 +00:00
snippet for
options head
for (var ${2:i}=0; $2 < ${1:Things}.length; $2++) {
${0}
}
2012-02-02 04:33:35 +00:00
snippet forin
options head
for (var ${2:i} in ${1:Things}) {
${0}
};
2012-02-02 04:33:35 +00:00
snippet ;,
${1:value_name}:${0:value},
2012-02-02 04:33:35 +00:00
snippet key
${1:key}: "${2:value}"}${3:, }
2012-02-02 04:33:35 +00:00
snippet timeout
options head
setTimeout(function() {${0}}${2:}, ${1:10});