Fandom

Vim Tips Wiki

Apply range to any command that does not accept ranges

Redirected from VimTip1153

1,624pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Tip 1153 Printable Monobook Previous Next

created 2006 · complexity basic · author Yakov Lerner · version 6.0


Some commands do not accept ranges, but you want to execute them for every line in the range.

This trick allows to apply the range to any command that does not accept range directly:

:n1,n2 g/^/ command

That is, you add g/^/ between the range and the command.

CommentsEdit

Also on Fandom

Random Wiki