Suppose in a latex file, I have a line
$X_{i_{j}}$ and $Y^{i_{k}}$
My goal is to define a text object in VIM for the subscript, i.e. _{i_{j}}
, and superscript, i.e. ^{i_{k}}
.
I was reading this wiki page. It requires more knowledge about command-line mode than I currently have.
For subscript, I was thinking the ex command should start by finding _
, then move the cursor to its immediately right, and finally find the paired brace using %
in normal model. I do not know how to write this up in ex command.