I edit DocBook XML files. In my plugin, i want to implement a function that would increase or decrease the section numbers recursively, assuming that cursor is at the toplevel section. For example, when my cursor is at the top
<sect2 element, it means to turn
<sect2> <sect3> <sect4> <para>some text</para> </sect4> </sect3> </sect2>
<sect1> <sect2> <sect3> <para>some text</para> </sect3> </sect2> </sect1>
i have this code in my script, but it does not work:
execute 'normal vat' # select the text up to the closing tag execute 'normal :s/sect\(\d\?\)>/\="sect" . (submatch(1) - 1). ">"/g'
but it does not work. any idea?