The question may be also phrased as, can Ultisnips regular expression match after the current cursor?
My goal is to have a postfix of curly bracket for LaTeX subscripts. Say I want to type a_{bcd}
, but in the first place I typed a_c
. I wish I could move my cursor in the following position (cursor represented by |) a_|c
, and insert a curly bracket. In the end what I get is a_{$1c$2}$0
.
What appears intuitive for me is the following
snippet "_{([^\s$]*)" "subscript" iA
_{$1 `!p match.group(1)`$2}$0
endsnippet
however it does not work, and it seems that Ultisnips does not match the text after the cursor.
A
option), is that the case?A
option. I updated with my code that does not work.