big-moving.ru/api/soft/ajaxorg/demo/kitchen-sink/docs/snippets.snippets

26 lines
428 B
Plaintext
Raw Normal View History

2022-06-24 15:29:23 +05:00
# Function
snippet fun
function ${1?:function_name}(${2:argument}) {
${3:// body...}
}
# Anonymous Function
regex /((=)\s*|(:)\s*|(\()|\b)/f/(\))?/
name f
function${M1?: ${1:functionName}}($2) {
${0:$TM_SELECTED_TEXT}
}${M2?;}${M3?,}${M4?)}
# Immediate function
trigger \(?f\(
endTrigger \)?
snippet f(
(function(${1}) {
${0:${TM_SELECTED_TEXT:/* code */}}
}(${1}));
# if
snippet if
if (${1:true}) {
${0}
}