Setting a variable for use in all interpolation

Asked by Jeremy Cantrell

Currently, I'm using something like this:

`!p snip.rv = comment_start(snip)`Filename: ${1:`!p snip.rv = fn or 'filename'`}
`!p snip.rv = comment_start(snip)`Description: ${2:description}
`!p snip.rv = comment_start(snip)`Maintainer: ${3:name}
`!p snip.rv = comment_start(snip)`Last Modified: `!v strftime('%a %Y-%m-%d %H:%M:%S (%z)')`

Is there a way to set "comment_start(snip)" to a variable so i can reuse it in the other lines? Or is there another way to do this?

Question information

Language:
English Edit question
Status:
Answered
For:
UltiSnips Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
SirVer (sirver) said :
#1

This can be done with a global. See *UltiSnips-globals*.

Revision history for this message
voyeg3r (voyeg3r) said :
#2

Hi Jeremy Cantrell,

when there is an implementation of this solution you could post here?

Can you help with this problem?

Provide an answer of your own, or ask Jeremy Cantrell for more information if necessary.

To post a message you must log in.