Having the code:
[Test]
public void ShouldDoSomethingMeaningFull() {
Assert.Fail();
}
I often need to overwrite the line (3) Assert.Fail();. What I currently do is this:
- Go to that line
3G. - Select everything starting from first non-whitespace
^v$. - Change it –
c.
The whole sequence is: 3G^v$c.
While this works for me but it is not efficient way of doing it because my fingers jump to the ^ and $.
Any better way?
Thanks,
Dmitriy.
The obvious improvement would be 3GC (C means change to end of line, i.e. the same as 3Gc$)
If you prefer to change the entire line as pointed out by Pavel Shved, there’s a not so obvious shortcut for that as well. 3GS is the same as 3Gcc.
The “Making small changes” section of the help file has more details.