Search code examples
xmlvimcdata

Match open CDATA section in Vim


Vim has the terrific shortcut [{ for going to the last open { character. Is there a way to go to the last open CDATA tag in XML? Some thing similar to ?<!\[CDATA\[ does not work as there may be a close tag afterward.


Solution

  • :call searchpair('<!\[CDATA\[', '', ']]>', 'b')