so I am continuing my use off vim...I have this piece of html here:
<div id=container>
<ol>
<li><h1>banner</h1></li>
<li><first_item</li>
<li><second_item</li>
<li><third_item</li>
<li><fourth_item</li>
</div>
The div tag starts on the 17th line. I went to move the header one out of the list but still within the div tag. My moves were:
Then there was the next question about removing the tags - there is most probably a plugin out there to help me which I will hunt down now.
Was what I did long winded? is there a quicker way or more efficient way to achieve this? (excluding the bit about removing the list tags around the header.
Tim Pope's unimpaired plugin, as well as my LineJuggler plugin provide ]e
mappings to quickly move line(s). With that, you can move a line from 19 to 17 (i.e. over 18) with 1[e
.
For removing surrounding tags, have a look at surround.vim - Delete/change/add parentheses/quotes/XML-tags , also from Tim. Alternatively, you could just delete the inner tag (dat
), and use my UnconditionalPaste plugin's glp
mapping to paste that as a separate line, or even use g[p
on line 18 to paste to above with the correct indent (of the current line).
PS: Instead of 19gg
, you can also do 19G
; still two key presses, but in parallel.