0

Is there any difference between doing the following two commands:

:1,19g!/let/d

And:

:1,19v/let/d

Or is v an alias for g! ?

David542
  • 2,445
  • 14
  • 50
  • 3
    You will get your answer instantly if you how how to use the built in help, I suggest you read this post. – dedowsdi Apr 25 '20 at 03:08
  • @dedowsdi yea it takes me a good deal of time to navigate their docs, for example: E149: Sorry, no help for g!, and v brings up visual mode. – David542 Apr 25 '20 at 03:11
  • Make sure you spend enough time to read it, try it, there is also :h {subject}, no one can use vim properly without knowing how to use the :h, it should always be your first choice when you have questions. – dedowsdi Apr 25 '20 at 03:14
  • It might take a lot of time to know :h, but trust me, it's totally worth it, it's one of the most used command for all vimmers. – dedowsdi Apr 25 '20 at 03:21
  • 1
    @David542 If you're looking for help on Ex commands you need to include the :, you need :help :v. The ! version is documented together with the original, so it will be under :help :g. – filbranden Apr 25 '20 at 04:05
  • David542: yeah make sure you read that post @dedowsdi linked in the comment, it's a great primer on how to use Vim's help effectively! – filbranden Apr 25 '20 at 04:12

1 Answers1

1

Yes, they're the same.

As :help :v says:

Same as :g!.

(That's the whole contents of that help entry.)

You'll find the description for :g! under :help :g, just below the description of :g itself:

:[range]g[lobal]!/{pattern}/[cmd]

Execute the Ex command [cmd] (default :p) on the lines within [range] where {pattern} does NOT match.

filbranden
  • 28,785
  • 3
  • 26
  • 71