I have the following utilsnips script that I use for Vim:
snippet - "assignment"
You could use
r option to include head and trailing spaces around snippets.
r will treat snippet as a python regular expression and you should define your snippet within quotes when using this flag.
snippet " -" "assignment" r <- endsnippet
Note that there is a space before and after
<- in snippet definition.
As a bonus, It's more interesting to define the snippet like the following:
snippet " - " "assignment" rA <- endsnippet
A is autoexpansion. so now you dont need to hit
tab anymore! just type
- and as soon as you type space after
- it will expand to