I often surround some code/text with some other lines of text. For the sake of a concrete example, say I have some text:
this is
some text
I then have macro that lets me convert that (after highlighting the lines) to
if false then
this is
some text
end;
the macros I use to do this are:
nmap <space>i ccif false then<CR><c-r>"end;<esc>
vmap <space>i cif false then<CR><c-r>"end;<esc>
However I would like to be able to create macro to then remove the surrounding text. That is, if the cursor is surrounded by lines "if false then" and "end;" then those lines should be removed.
Any ideas how I would create a macro like that?
Let me note that I have looked at surround.vim, but have not found a way to do it using that package.