Monday, November 25, 2013

Re: How to search for alternatives in :tag /pattern ?

On Sun, Nov 24, 2013 at 8:31 AM, Micha Moskovic <michamos@gmail.com> wrote:

Hi,

I have the following problem.
I am editting a file for which a ctags file has been generated. This
file contains two tags, "tag1" and "tag2". With ":tag tag1" and ":tag
tag2", I can jump to "tag1" and "tag2" respectively. Now suppose I would
like to add both "tag1" and "tag2" to the tag stack. According to help,
I can do ":tag /pattern" to search for a pattern, and indeed
":tag /tag." works as expected. However, I would like to search for
"tag1" and "tag2" only and so I tried ":tag /tag1\|tag2". However,
contrary to my expectations, this does not work!

Am I doing something wrong?

Regards,
Micha

     I tried it, read the error message, and found that

:tag /tag1\\|tag2

does the job.  I did not find any mention of this under

:help :tag
:help tag-regexp

so maybe this is not documented.  (Maybe I should try upgrading.  I am still using 7.3.646.)

HTH
-- 
Benji Fisher

--
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: