SirVer/ultisnips

How can make the trigger_word as argument to python?

hwypengsir opened this issue · 0 comments

The syntax of UltiSnips's snippet is as below:

snippet trigger_word [ "description" [ options ] ]

The upper method can convert all characters in the string into upper case:

"string".upper()
'STRING'

I want to write a small snippets to convert the trigger_word into it's upper case in html file.Add the below lines in vim-snippets/UltiSnips\html.snippets.

snippet string
`!p snip.rv="string".upper()`
endsnippet

string can expand into STRING when to edit html file,how can make any other string be expanded into it's uppercase status?For example,otherstring expanded into OTHERSTRING?If i get the way to get trigger_word as a variable ,then it's simple to convert in calling python.