[please don't top-post]
hilal Adam wrote:
>
> Yes. You're right \*\* was one of the approaches I used. Unfortunately
> * is treated as a metacharacter/special character/keyword by
> grep/vimgrep/c language and this where the difficulty is originating
> from.
>
> I tried your suggestion, \*\@<!\*\*\*\@!, and I get a no pattern found
> reply while I stirring at a line that has **.
Ben's suggestion should work -- at least it did for me. But you can also
try the following pattern
\(^\|[^*]\)\*\*\([^*]\|$\)
This searches for two asterisks that are preceded by either the start of
line or some character other than an asterisk and which are followed by
a non-asterisk or the end of line.
This would also include the preceding and following characters in the
match, if any. If you want to restrict the match (and thus the
highlighting) to the two asterisks, include \zs and \ze in the pattern:
\(^\|[^*]\)\zs\*\*\ze\([^*]\|$\)
Regards,
J�rgen
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
On Wednesday, April 4, 2012 1:27:21 PM UTC-5, hilal Adam wrote:
> Ben, Thanks for your prompt response.
> Somehow I am getting 3 copies of your premature, and complete replies.
>
I only see one post. Weird. I'm starting to really hate the Google
Groups interface. I may try subscribing to get emails and just filter
them all away from my inbox. Ugh.
Maybe you're getting multiple copies because you're on the CC list as
well as subscribed to the mailing list? I've never had problems with
that, but I've been using the web interface for quite some time now
without getting any email I don't subscribe to directly.
> Yes. You're right \*\* was one of the approaches I used.
> Unfortunately * is treated as a metacharacter/special character/keyword
> by grep/vimgrep/c language and this where the difficulty is originating
> from.
>
* is not special anymore if escaped with a \.
> I tried your suggestion, \*\@<!\*\*\*\@!, and I get a no pattern
> found reply while I stirring at a line that has **.
>
> How would you do this in grep on cygwin command line?
>
I don't know about using grep from the cygwin command line. The pattern
I gave uses Vim regular expressions, so you'd need to use a :vimgrep
command to use it.
Here's the breakdown:
\*\@<! - match only where there is not a literal '*' just before
\*\* - two literal '*' characters
\*\@! - match only where there is not a literal '*' as the next
character after the match
These are both zero-width matches, meaning they are not part of the
match itself. I don't think grep from the cygwin command line supports
any such concept.
Someone else (Google Groups mangled the non-ascii characers in the name)
suggested \zs and \ze which similarly won't be supported. But if you are
using an external grep command this probably won't matter, since you can
accept matches of the character (or beginning/end of line) immediately
before/after the **. The suggested \(^\|[^*]\)\*\*\([^*]\|$\) pattern
may work in grep, possibly with some tweaking for syntax.
If you go to GitHub & enter vimrc as a search term, you'll get quite a
lot of results.
Not sure how many of the regular contributors to this list commit/backup
their dotfiles and/or $VIMRUNTIME directories on GitHub but a lot of
well known Vimmers (Steve Losh, Tim Pope to name but two) do & they are
most instructive in their content.
Cheers,
Phil...
- --
But masters, remember that I am an ass.
Though it be not written down,
yet forget not that I am an ass.
Wm. Shakespeare - Much Ado About Nothing
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: §auto-key-locate cert pka ldap hkp://keys.gnupg.net
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJPkQGkAAoJEKpMeDHWT5ADZk8IAKVxOkyX4pw6ZdjNInrPL9gS
rpaatAPordKVSPDJr1jNpAGpl6lOa3kbgrVcrMmnp+NynaaWbqiolXHo0ZMAte+J
UdRlaqE854/rhhrdmkKnnLT7j2LZ/a8gOletX+8rfwAtL6/ieh+lK1rL9VGu4x5u
/4xT/OuPJtOCMKCaWpQQMH2xi8YZ2FuSoEATbNdscieglwWBhiP+H2Kz00p0NdrT
tM5vLXlSAKlaLpWAoakK8fg4obOD2mWgORvh6RGxcMJaEBnevKYpBD0P6NP6Yq0+
HAH3ImL4OwpTZvDEi8cMG7PTaFnMsP9c24AbVCr3dIJmksRkenPLOLCC+gqVx9E=
=H+La
-----END PGP SIGNATURE-----
Google finds lots of them, but many of those are burdened with
baggage.
There are two simple samples in these tips:
http://vim.wikia.com/wiki/Example_vimrc
http://vim.wikia.com/wiki/Build_Vim_in_Windows_with_Visual_Studio
John
I am bias towards VIM when it comes to editors for doing development work (mainly C). But I have this problem regarding cross referencing. I use ctags which only provides half of the equation when I search for definitions of functions and variables. However, I haven't been able to find a useful way for doing cross referencing. For example in cases where I want find where a function is used, etc. I have come across cscope which is outdated and lacks proper documentation for how to install and run. Could anyone help with pointing to the right direction.
I appreciate any help in this respect.
del cscope.outctags -R --c++-types=+p
--fields=+iaS --extra=+qgfind . -regex ".*\.\(c\|h\|mak\|py\|pl\|bat\|cmd\)"
-not -regex ".*\(no_use\).*" -type f -printf
"%%p\n" >cscope.filecscope -Rb -icscope.file |
I am bias towards VIM when it comes to editors for doing development work (mainly C). But I have this problem regarding cross referencing. I use ctags which only provides half of the equation when I search for definitions of functions and variables. However, I haven't been able to find a useful way for doing cross referencing. For example in cases where I want find where a function is used, etc. I have come across cscope which is outdated and lacks proper documentation for how to install and run. Could anyone help with pointing to the right direction.
I appreciate any help in this respect.
--
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
-- Thanks & Best Regards Edward Xu