This should be too simple, but I have wanted to know for a long time and haven’t seen this question, it’s hard to search for.
I often want to delete from somewhere in a line to the beginning of the code on next line. For instance, in C-ish syntax, let’s say I want to remove the first boolean in:
if (long_boolean_expression1 &&
long_boolean_expression2) {
/* code */
}
and get:
if (long_boolean_expression2) {
/* code */
}
Here I can do 0wdb. from the second line. (Is there anything shorter or more intuitive? There must be a single command that does 0w but I can’t find it.)
When editing HTML though, nothing seems to work. Whenever I need to do something like turning this:
<table>
<tr>
into this:
<table><tr>
I end up doing it with backspace in insert mode, because all my attempts to do it in normal mode fail, often deleting too much and leaving me with:
<table<tr> <!-- Fail! -->
How do I do this?
Try putting your cursor on the
land typingDJ.Dis to delete until the end of line from cursor,Jis to join next line to current one.For your HTML example, just try
Jon the first line to join the second line to it.