snippet begin "Begin command block" b
begin
	$1
end
endsnippet

snippet fun "Function definition" b
function ${1:`!v empty(expand('%')) ? 'name' : expand('%:t:r')`}
	$2
end
endsnippet

snippet if "If statement" b
if ${1:condition}
	$2
end
endsnippet

snippet test "If test" b
if test ${1:expression}
	$2
end
endsnippet

snippet elif "Else-if branch" b
else if ${1:condition}
	$2
endsnippet

snippet switch "Switch statement" b
switch ${1:value}
	case ${2:matches}
		$3
end
endsnippet

snippet default "Match any case" b
case '*'
	$1
endsnippet

snippet for "For loop" b
for ${1:var} in ${2:values}
	$3
end
endsnippet

snippet while "While loop" b
while ${1:condition}
	$2
end
endsnippet
