Re: search file for text in reg ?
Hi, > /a Tony, thanks, That is also great to know and I will use it. thank you and everyone for vim, -m -- -- 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. For more options, visit https://groups.google.com/d/optout.
Re: search file for text in reg ?
On Fri, Dec 14, 2018 at 6:55 PM Tim Chase wrote: > > On 2018-12-14 09:48, M Kelly wrote: > > Is there a way to search a file for the text that is in a register ? > > Is the content of the register literal text or a regular expression? > > If it's a regular expression (or doesn't have any regex metachars in > it), you can use > > :let @/=@a or /a where means "hit the Ctrl-R key combination", and replacing a by the one-character name of the register in question. (Ctrl-R a inserts he contens of register a in Insert and Command-line modes, see "help c_CTRL-R".) Then hit after the register name (also for the :let statement). > > where "@a" is the register in question. You can then use n/N to > navigate forward/backward. > > If it's literal text that might contain regexp metachars, you have to > escape them: > > :let @/=escape(@a, '.*\\$^') > > (adjust the set of escaped characters accordingly; I just grabbed a > few I knew to be problematic) or /a then add escaping backslashes if and where needed by editing the command-line before you hit . > > -tim Best regards, Tony. -- -- 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. For more options, visit https://groups.google.com/d/optout.
Re: search file for text in reg ?
Hi, > :let @/=@a Awesome, thank you Tim. -m -- -- 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. For more options, visit https://groups.google.com/d/optout.
Re: search file for text in reg ?
On 2018-12-14 09:48, M Kelly wrote: > Is there a way to search a file for the text that is in a register ? Is the content of the register literal text or a regular expression? If it's a regular expression (or doesn't have any regex metachars in it), you can use :let @/=@a where "@a" is the register in question. You can then use n/N to navigate forward/backward. If it's literal text that might contain regexp metachars, you have to escape them: :let @/=escape(@a, '.*\\$^') (adjust the set of escaped characters accordingly; I just grabbed a few I knew to be problematic) -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. For more options, visit https://groups.google.com/d/optout.
search file for text in reg ?
Hi, Is there a way to search a file for the text that is in a register ? thx always for everything vim, -m -- -- 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. For more options, visit https://groups.google.com/d/optout.