So my issue when yanking a word (yw) is that it copies the trailing spaces as well:
Example:
Doing a yw on this:
‖Hello World
Results in copying Hello
But the same applies to:
‖LongVariableName = 'SomeValue';
Results in copying LongVariableName
Is there a way to make as such I copy without copying any space? (which for me makes sense when copying words)
>Solution :
You can use yiw to yank the ‘inner word’ text object (yaw would include an additional space). See :help text-objects.
A nice feature of text objects is that the cursor can be anywhere on the object (in this case the word) for it to work.
There are many text objects in vim:
ismeans inner sentenceipmeans inner paragraphi)means inner parentheses
And many more!