I am trying to select an entire XML CDATA section with VIM. For those unfamiliar with XML, a CDATA section looks like this:
<someTag><![CDATA[
This text is escaped in a Character Data section!
Look, I can use < and > characters freely!
]]></someTag>
<anotherTag><![CDATA[More escaped text!]]></anotherTag>
I tried this mapping to visually select and yank the text inside the CDATA section, but it appears that the call function disables visual selection:
inoremap <F9> <Esc>:call searchpair('<!\[CDATA\[', '', ']]>', 'b')v:call searchpair('<!\[CDATA\[', '', ']]>')y
Is there any way to select the entire CDATA section? This is what I use to select methods in C-based languages, for reference:
inoremap <F7> <Esc><C-V>aBy
Thank you.