Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"dt" motion in Vim working with mutiple lines

I very often use dt-some_character motion in Vim, to delete every character upto some_character. However, it works only for a single line.

Is there any analogue that would work for multiple lines?

like image 539
syntagma Avatar asked Dec 05 '22 03:12

syntagma


2 Answers

You could use d/some-character<CR> (e.g d/e then Enter to delete up to the next 'e').

Note however that this will modify the last-search register ("/).

Edit :

The counterpart to F is ? (search backwards) (d?X is inclusive, so no dT).

like image 134
Marth Avatar answered Feb 27 '23 17:02

Marth


There are several plugins that extend the built-in f / t motions to cover multiple lines:

  • ft_improved
  • fanfingtastic

Another one that goes into the same direction, but via a different approach:

  • EasyMotion
like image 34
Ingo Karkat Avatar answered Feb 27 '23 16:02

Ingo Karkat