user137369
user137369

Reputation: 5704

Execute normal actions in vim from command mode

We can type :6d in vim to immediately go to and delete line 6.

Is there a way to extend these commands to do normal operations? As an example, I’d like to do :6V to go to line 6 and select it, or do maybe something more complex, like :6V12dd which would select and delete lines from 6 to 12.

Upvotes: 0

Views: 273

Answers (1)

FDinoff
FDinoff

Reputation: 31459

You can specify ranges to commands from the command line in the form below

start,end

So if you wanted to delete lines 6 through 12 you could use

:6,12d

If you want to use normal mode commands from the command line take a look at the command normal

Upvotes: 3

Related Questions