You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
428 B
Plaintext

# 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}
}