Say I have the following code:
<p>
Hello
</p>
And I want to make it
<p>Hello</p>
I would like to put the cursor in normal mode at the end of line 1, so on the ' > ' and have a command to delete all spaces until the next character. The closest I can think of is the motion
d/Hello
which deletes everything until Hello but the issue is that it deletes also the character under the cursor (the ' > ') so I end up with
<pHello
</p>
How would you do that?
To delete one character, position the cursor over the character to be deleted and type x . The x command also deletes the space the character occupied—when a letter is removed from the middle of a word, the remaining letters will close up, leaving no gap. You can also delete blank spaces in a line with the x command.
One way when you won't need to repeat this action many times.
JxJx
Explanation:
J # Join current line with next one but substitute end of line with a space.
x # Remove the space.
Jx # Repeat same process for last line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With