I am an experienced Windows developer and I am trying to teach myself how to use Vim. I am good at regular expressions and understand the principles of using Vim. However, I have a specific problem, and although I have a solution, it seems to me that it's better to be better.
I have a file that contains a line similar to the following:
CODE<tab><tab>Lorem ipsum dolor sit amet
There may be a variable number of <tab> or <space> characters between CODE and Lorem . Assuming the cursor is above βCβ in CODE in normal mode, I want it to be found, this is the key combination that will produce the next output, and leave the cursor between βEβ CODE and it is βLβ Lorem in mode insertion.
CODELorem ipsum dolor sit amet
My current solution is to use the following key sequence:
w d ? \ s \ + <return>
This works, but it seems illogical to go past the thing I want to remove before I can remove it. I feel like I have to go to the end of CODE and delete forward. I understand this may just be the Vim idiom I don't know about. I could also completely lose a key piece of Vim knowledge.
What is the best way to achieve my goal?
vim command keyboard-shortcuts
Damian powder
source share