Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete until (and not including) the last char on the line

Tags:

vim

shortcut

I would like to delete a sequence ending with plenty parenthesis and rather than count the exact number of parenthesis to do a d[count]f), I want to delete up to the before last character in a line.

I tried dt$ but with no success.

EDIT: Eventually, can we exclude more characters ?

like image 505
Dimitri Lesnoff Avatar asked Nov 01 '25 11:11

Dimitri Lesnoff


1 Answers

So as I see the real question is "How to delete until (and not including) the last char on the line.

And the answer is: dv$. See :h exclusive and :h o_v.

like image 73
Matt Avatar answered Nov 04 '25 04:11

Matt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!