Skip to content

How can make the trigger_word as argument to python? #1470

Open
@hwypengsir

Description

@hwypengsir

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions