Re: Small documentation tweak for :g delimiters
On 2023-05-01 21:37, Owajigbanam Ogbuluijah wrote: > If you check the documentation for *help :v*, you'd see it's > marked as the same Yes, `:g!` and `:v` are the same. However, both can take alternate delimiters (other than "/"). The documentation states that the alternate delimter cannot be a backslash, a double-quote, or a bar. But my initial email notes that "!" should be in included in that list of prohibited characters (as Bram confirms) because it's viewed as a negation to :g and is invalid for :v -tim -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZFBB/wCD8ESGGL0c%40thechases.com.
Re: Small documentation tweak for :g delimiters
If you check the documentation for *help :v*, you'd see it's marked as the same On Mon, May 1, 2023 at 7:50 PM Tim Chase wrote: > Shortly after the help for :v it reads > > Instead of the '/' which surrounds the {pattern}, you can use any > other single byte character, but not an alphabetic character, > '\', '"' or '|'. This is useful if you want to include a '/' in > the search pattern or replacement string. > > This makes it sounds like "!" should be a viable delimiter (as it > it is for a :s command per `:help pattern-delimiter`). However, > it ends up turning a :g command into a :v command. > > So in addition to excluding backslash, double-quote, and bar, I'd > recommend adding "!" to the list here. > > -tim > > discovered by unthinkingly doing a > > :g!/path/ > > and getting all lines that didn't contain "path" rather than all > lines that did contain "/path/". Using an alternate delimiter like > > :g@/path/ > > worked as expected. And I often use "!" as my pattern-delimiter > in substitute commands when the pattern contains "/" characters > > -- > -- > You received this message from the "vim_use" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php > > --- > You received this message because you are subscribed to the Google Groups > "vim_use" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to vim_use+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/vim_use/ZFAYFQnS5iT/YvRo%40thechases.com > . > -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAOmRJreyyv01DKjYyp8VnySNMLFC2hQjOdiathmunvO5d%3DbkFg%40mail.gmail.com.
Re: Small documentation tweak for :g delimiters
Tim Chase wrote: > Shortly after the help for :v it reads > > Instead of the '/' which surrounds the {pattern}, you can use any > other single byte character, but not an alphabetic character, > '\', '"' or '|'. This is useful if you want to include a '/' in > the search pattern or replacement string. > > This makes it sounds like "!" should be a viable delimiter (as it > it is for a :s command per `:help pattern-delimiter`). However, > it ends up turning a :g command into a :v command. > > So in addition to excluding backslash, double-quote, and bar, I'd > recommend adding "!" to the list here. > > -tim > > discovered by unthinkingly doing a > > :g!/path/ > > and getting all lines that didn't contain "path" rather than all > lines that did contain "/path/". Using an alternate delimiter like > > :g@/path/ > > worked as expected. And I often use "!" as my pattern-delimiter > in substitute commands when the pattern contains "/" characters Thanks for the suggestion. I first thought this was only for ":global", but using it with ":vglobal" gives an error "E477: No ! allowed". Thus it can indeed be added to the list. -- Scientists decoded the first message from an alien civilization: SIMPLY SEND 6 TIMES 10 TO THE 50 ATOMS OF HYDROGEN TO THE STAR SYSTEM AT THE TOP OF THE LIST, CROSS OFF THAT STAR SYSTEM, THEN PUT YOUR STAR SYSTEM AT THE BOTTOM OF THE LIST AND SEND IT TO 100 OTHER STAR SYSTEMS. WITHIN ONE TENTH GALACTIC ROTATION YOU WILL RECEIVE ENOUGH HYDROGREN TO POWER YOUR CIVILIZATION UNTIL ENTROPY REACHES ITS MAXIMUM! IT REALLY WORKS! /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20230501213725.049491C0916%40moolenaar.net.
Small documentation tweak for :g delimiters
Shortly after the help for :v it reads Instead of the '/' which surrounds the {pattern}, you can use any other single byte character, but not an alphabetic character, '\', '"' or '|'. This is useful if you want to include a '/' in the search pattern or replacement string. This makes it sounds like "!" should be a viable delimiter (as it it is for a :s command per `:help pattern-delimiter`). However, it ends up turning a :g command into a :v command. So in addition to excluding backslash, double-quote, and bar, I'd recommend adding "!" to the list here. -tim discovered by unthinkingly doing a :g!/path/ and getting all lines that didn't contain "path" rather than all lines that did contain "/path/". Using an alternate delimiter like :g@/path/ worked as expected. And I often use "!" as my pattern-delimiter in substitute commands when the pattern contains "/" characters -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZFAYFQnS5iT/YvRo%40thechases.com.