- Improved javascript snippet file.

This commit is contained in:
Shougo Matsushita 2012-10-26 10:46:05 +09:00
parent f46f36837e
commit 2a4db10f9b
2 changed files with 17 additions and 2 deletions

View File

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

View File

@ -454,6 +454,9 @@ snippet *neosnippet-unite-action-snippet*
============================================================================== ==============================================================================
CHANGELOG *neosnippet-changelog* CHANGELOG *neosnippet-changelog*
2012-10-26
- Improved javascript snippet file.
2012-10-25 2012-10-25
- Deleted sandbox execution. - Deleted sandbox execution.