Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim delete find back including selected character

Tags:

vim

Suppose I have the following line

&.btn, &.btn-success

and the cursor is on the last s.

If I do dF, it will delete backward the way I want it but will keep the s.

I want to be able to be on the s, and delete backwards, including the comma and including the last s.

Is there a way without extra keystrokes?

like image 717
Abdo Avatar asked Jan 09 '23 12:01

Abdo


2 Answers

Move to the comma first, then delete to the EOL:

F,D
like image 128
romainl Avatar answered Jan 22 '23 04:01

romainl


Yes you can do it in VISUAL mode. vF,d

like image 23
hawk Avatar answered Jan 22 '23 04:01

hawk