Closed kontrapunktstefan closed 2 months ago
Hey, you cannot change what you typed yourself, that is a limitation of Vim, unfortunately. The best you can do is something like this:
snippet apo "lilypond pitches with apostophes"
`!p
lines = []
for idx, line in enumerate(snip.v.text.splitlines()):
lines.append(" ".join(f"{a}'" for a in line.split()))
snip.rv = "\n".join(lines)
`
endsnippet
You use it like this:
c d e
<tab>
), this will remove the textapo<tab>
or whatever your expand trigger isc' d' e'
.Hope that helps
Dear Holger, thanks for Your reply. I've found a solution with a vim script.
Am Di., 10. Sept. 2024 um 14:18 Uhr schrieb Holger Rapp < @.***>:
Closed #1555 https://github.com/SirVer/ultisnips/issues/1555 as completed.
— Reply to this email directly, view it on GitHub https://github.com/SirVer/ultisnips/issues/1555#event-14197900012, or unsubscribe https://github.com/notifications/unsubscribe-auth/AROZ3ITFGCK36MYEAYIDR3LZV3PRVAVCNFSM6AAAAABKOIJMMKVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUGE4TOOJQGAYDCMQ . You are receiving this because you authored the thread.Message ID: @.***>
I have written the following snippet for UltiSnips in Vim. With this snippet I want to add an apostrophe to all lilypond pitches:
When I execute it, however, the text appears twice:
I just want the 2nd line
I've tried snippet 1 "lilypond pitches with apostophes"
but this gives an error: