Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
vimgrep
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  24 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
hilal Adam  
View profile  
 More options Apr 4 2012, 1:12 pm
From: hilal Adam <hila...@yahoo.com>
Date: Wed, 4 Apr 2012 10:12:28 -0700 (PDT)
Local: Wed, Apr 4 2012 1:12 pm
Subject: vimgrep

Sorry if not correct platform for this question.
Need to use vimgrep/grep to find a particular string in c code.  I am trying to find all occurrences of '**' (pointer to pointer). But I get hundreds of lines of output for all comment lines which include a minimum of 2 '*'s.
Any help is appreciated.

HA


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Fritz  
View profile  
 More options Apr 4 2012, 1:22 pm
From: Ben Fritz <fritzophre...@gmail.com>
Date: Wed, 4 Apr 2012 10:22:19 -0700 (PDT)
Local: Wed, Apr 4 2012 1:22 pm
Subject: Re: vimgrep

On Wednesday, April 4, 2012 12:12:28 PM UTC-5, hilal Adam wrote:
> Sorry if not correct platform for this question.</div>
> Need to use vimgrep/grep to find a particular string in c code.  I am trying to find all occurrences of &#39;**&#39; (pointer to pointer). But I get hundreds of lines of output for all comment lines which include a minimum of 2 &#39;*&#39;s.</div>
> Any help is appreciated.</div>

> </div>
> HA
> </div></div></div>

vimgrep, just like '/' searching in Vim, uses regular expressions. In a regular expression, * means "as many as possible of the preceding search atom" which normally means "as many as possible of the preceding character".

You don'


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Fritz  
View profile  
 More options Apr 4 2012, 1:28 pm
From: Ben Fritz <fritzophre...@gmail.com>
Date: Wed, 4 Apr 2012 10:28:25 -0700 (PDT)
Local: Wed, Apr 4 2012 1:28 pm
Subject: Re: vimgrep

On Wednesday, April 4, 2012 12:22:19 PM UTC-5, Ben Fritz wrote:
> On Wednesday, April 4, 2012 12:12:28 PM UTC-5, hilal Adam wrote:
> > Sorry if not correct platform for this question.</div>
> > Need to use vimgrep/grep to find a particular string in c code.  I am trying to find all occurrences of &#39;**&#39; (pointer to pointer). But I get hundreds of lines of output for all comment lines which include a minimum of 2 &#39;*&#39;s.</div>
> > Any help is appreciated.</div>

> > </div>
> > HA
> > </div></div></div>

> vimgrep, just like '/' searching in Vim, uses regular expressions. In a regular expression, * means "as many as possible of the preceding search atom" which normally means "as many as possible of the preceding character".

> You don'

Dammit, I accidentally hit some key combination which Google Groups used to post before I was done.

You don't give the exact search you used, so I was guessing here that you searched with ** as your search pattern, which will match zero or more '*' characters, but I realize now that this will match absolutely anything, because "as many as possible" means zero or more, so ** will match every line in every file.

Probably, then, you searched for \*\*, which will match 2 '*' characters in a row. However, it will match ANY two * characters, even if followed by another character which is not a * character.

You need to specify that you only want to match where the preceding character and the next character are not also *.

To do this, I'd use a pattern like:

\*\@<!\*\*\*\@!

or simpler, with "very not magic":

\V*\@<!***\@!

See :help /\@<! and :help /\@!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hilal Adam  
View profile  
 More options Apr 4 2012, 2:27 pm
From: hilal Adam <hila...@yahoo.com>
Date: Wed, 4 Apr 2012 11:27:21 -0700 (PDT)
Local: Wed, Apr 4 2012 2:27 pm
Subject: Re: vimgrep

Ben, Thanks for your prompt response.
Somehow I am getting 3 copies of your premature, and complete replies.

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 **.

How would you do this in grep on cygwin command line?

Thanks again.

________________________________
 From: Ben Fritz <fritzophre...@gmail.com>
To: vim_use@googlegroups.com
Cc: "v...@vim.org" <v...@vim.org>; hilal Adam <hila...@yahoo.com>
Sent: Wednesday, April 4, 2012 12:28 PM
Subject: Re: vimgrep

On Wednesday, April 4, 2012 12:22:19 PM UTC-5, Ben Fritz wrote:
> On Wednesday, April 4, 2012 12:12:28 PM UTC-5, hilal Adam wrote:
> > Sorry if not correct platform for this question.</div>
> > Need to use vimgrep/grep to find a particular string in c code.  I am trying to find all occurrences of '**' (pointer to pointer). But I get hundreds of lines of output for all comment lines which include a minimum of 2 '*'s.</div>
> > Any help is appreciated.</div>

> > </div>
> > HA
> > </div></div></div>

> vimgrep, just like '/' searching in Vim, uses regular expressions. In a regular expression, * means "as many as possible of the preceding search atom" which normally means "as many as possible of the preceding character".

> You don'

Dammit, I accidentally hit some key combination which Google Groups used to post before I was done.

You don't give the exact search you used, so I was guessing here that you searched with ** as your search pattern, which will match zero or more '*' characters, but I realize now that this will match absolutely anything, because "as many as possible" means zero or more, so ** will match every line in every file.

Probably, then, you searched for \*\*, which will match 2 '*' characters in a row. However, it will match ANY two * characters, even if followed by another character which is not a * character.

You need to specify that you only want to match where the preceding character and the next character are not also *.

To do this, I'd use a pattern like:

\*\@<!\*\*\*\@!

or simpler, with "very not magic":

\V*\@<!***\@!

See :help /\@<! and :help /\@!

--
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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jürgen Krämer  
View profile  
 More options Apr 5 2012, 1:39 am
From: Jürgen Krämer <jottka...@googlemail.com>
Date: Thu, 05 Apr 2012 07:39:38 +0200
Local: Thurs, Apr 5 2012 1:39 am
Subject: Re: vimgrep

Hi,

[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?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Fritz  
View profile  
 More options Apr 5 2012, 11:30 am
From: Ben Fritz <fritzophre...@gmail.com>
Date: Thu, 5 Apr 2012 08:30:00 -0700 (PDT)
Subject: Re: vimgrep

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "_vimrc" by hilal Adam
hilal Adam  
View profile  
 More options Apr 20 2012, 1:05 am
From: hilal Adam <hila...@yahoo.com>
Date: Thu, 19 Apr 2012 22:05:15 -0700 (PDT)
Local: Fri, Apr 20 2012 1:05 am
Subject: _vimrc

I an not sure if this an acceptable request or not. My apologies if not.
Would experts like Ben Fritz, Marcin, Jurgen share their vimrc files with this forum?

HA


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil Dobbin  
View profile  
 More options Apr 20 2012, 2:26 am
From: Phil Dobbin <phildob...@gmail.com>
Date: Fri, 20 Apr 2012 07:26:48 +0100
Local: Fri, Apr 20 2012 2:26 am
Subject: Re: _vimrc

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 20/04/2012 06:05, hilal Adam wrote:

> I an not sure if this an acceptable request or not. My apologies if not.
> Would experts like Ben Fritz, Marcin, Jurgen share their vimrc files
> with this forum?

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-----

  smime.p7s
5K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Beckett  
View profile  
 More options Apr 20 2012, 2:44 am
From: "John Beckett" <johnb.beck...@gmail.com>
Date: Fri, 20 Apr 2012 16:44:58 +1000
Local: Fri, Apr 20 2012 2:44 am
Subject: RE: _vimrc

hilal Adam wrote:
> Would experts like Ben Fritz, Marcin, Jurgen share their
> vimrc files with this forum?

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Cross referencing in VIM" by hilal Adam
hilal Adam  
View profile  
 More options May 17 2012, 11:39 pm
From: hilal Adam <hila...@yahoo.com>
Date: Thu, 17 May 2012 20:39:39 -0700 (PDT)
Local: Thurs, May 17 2012 11:39 pm
Subject: Cross referencing in VIM

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary Johnson  
View profile  
 More options May 18 2012, 1:40 am
From: Gary Johnson <garyj...@spocom.com>
Date: Thu, 17 May 2012 22:40:49 -0700
Local: Fri, May 18 2012 1:40 am
Subject: Re: Cross referencing in VIM
On 2012-05-17, hilal Adam wrote:

> 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.

I don't understand how cscope "lacks proper documentation".  From
within Vim there is ":help cscope" and from the shell, "man cscope".
A quick search of the web finds these:

    http://cscope.sourceforge.net/cscope_vim_tutorial.html
    http://www.vim.org/scripts/script.php?script_id=51
    http://vim.wikia.com/wiki/Cscope
    http://hthreads.csce.uark.edu/wiki/Navigating_with_Cscope

It is almost as easy to use as ctags.  At the top-level of a source
tree, execute "cscope -R -b".  From within Vim, execute ":cs add
cscope.out".

Granted, I use a plugin developed by a coworker and myself to allow
cscope's search features to be accessed by simple mappings, but the
references above also describe some plugins and mappings you will
probably find useful.

I couldn't live without cscope.  I work on huge embedded systems
written in C and I seldom have to think about where things are
located--I just search for symbols using cscope and Vim's quickfix
list.

Regards,
Gary


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
JT Mitchum  
View profile  
 More options May 18 2012, 4:05 am
From: JT Mitchum <jtmitc...@gmail.com>
Date: Fri, 18 May 2012 03:05:00 -0500
Subject: Re: Cross referencing in VIM

Have you tried TagBar plugin?

I don't know enough to verify if it solves your problem - other than I know it uses exuberant ctags and seems to autoload them.

I'll be watching this for a better answer - I don't think my idea really does it.

JT
On May 17, 2012, at 10:39 PM, hilal Adam wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Fritz  
View profile  
 More options May 18 2012, 11:48 am
From: Ben Fritz <fritzophre...@gmail.com>
Date: Fri, 18 May 2012 08:48:54 -0700 (PDT)
Local: Fri, May 18 2012 11:48 am
Subject: Re: Cross referencing in VIM

On Thursday, May 17, 2012 10:39:39 PM UTC-5, hilal Adam wrote:
> 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.

I used to use CScope a lot. I did not find it hard to use or understand in
the slightest. I found Vim's built-in documentation (:help cscope) to be all
I really needed, plus web searches for scope for setting up the databases in
the first place. With cscope, I also used the CCTree plugin to view an
entire call tree for any given function:

  http://www.vim.org/scripts/script.php?script_id=2368

I've since mostly stopped using CScope, because I've started using Eclim.
Eclim integrates Vim with Eclipse allowing you to use Eclipse's extensive
code navigation and information features, including:

• search for all references (e.g. function calls) for the item under the
  cursor, similar to :cscope find s
• seacrh for the declaration of an item, similar to :cscope find g
• search for the definition of an item :cscope find g
• show the entire call tree leading to a function, similar to CCTree +
  cscope.
• start a vimgrep relative to the project root, similar to :cscope find t or
  :cscope find e
• fuzzy find of files within the project, similar to :cscope find f

It can do much more (like insert-mode completion) but the above is all I
used cscope for, and Eclim does it better.

  http://eclim.org/features.html

Note that there is not (that I have found) an equivalent to :cscope find d
or :cscope find i, but I used these very rarely, if at all. Nor does Eclim
currently support call trees of functions *called by* the given function,
although Eclipse does, so that may come in the future.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hilal Adam  
View profile  
 More options May 24 2012, 11:59 pm
From: hilal Adam <hila...@yahoo.com>
Date: Thu, 24 May 2012 20:59:06 -0700 (PDT)
Local: Thurs, May 24 2012 11:59 pm
Subject: Re: Cross referencing in VIM

Sorry I bring this up again.

My difficulty is with installing cscope and getting it to run.

Per the documentation, I have added this line into cscope_maps.vim:
 if filereadable("cscope.out")
        cs add cscope.out 

...

and to _vimrc, I added:

if has('cscope')
" set cscopetag cscopeverbose
...

then, every time I attempt to open a file in Vim, I get following error message: 

"Error detected while processing C:\Program Files\Vim\vim73\plugin\cscope_maps.vim:
line   42:
E262: error reading cscope connection 0"

I looked for a solution with no luck.

Anyone knows how to fix this and better yet how to get cscope in Vim running?

Thanks for any help.

________________________________
 From: Ben Fritz <fritzophre...@gmail.com>
To: vim_use@googlegroups.com
Cc: "v...@vim.org" <v...@vim.org>; hilal Adam <hila...@yahoo.com>
Sent: Friday, May 18, 2012 10:48 AM
Subject: Re: Cross referencing in VIM

On Thursday, May 17, 2012 10:39:39 PM UTC-5, hilal Adam wrote:
> 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.

I used to use CScope a lot. I did not find it hard to use or understand in
the slightest. I found Vim's built-in documentation (:help cscope) to be all
I really needed, plus web searches for scope for setting up the databases in
the first place. With cscope, I also used the CCTree plugin to view an
entire call tree for any given function:

  http://www.vim.org/scripts/script.php?script_id=2368

I've since mostly stopped using CScope, because I've started using Eclim.
Eclim integrates Vim with Eclipse allowing you to use Eclipse's extensive
code navigation and information features, including:

• search for all references (e.g. function calls) for the item under the
  cursor, similar to :cscope find s
• seacrh for the declaration of an item, similar to :cscope find g
• search for the definition of an item :cscope find g
• show the entire call tree leading to a function, similar to CCTree +
  cscope.
• start a vimgrep relative to the project root, similar to :cscope find t or
  :cscope find e
• fuzzy find of files within the project, similar to :cscope find f

It can do much more (like insert-mode completion) but the above is all I
used cscope for, and Eclim does it better.

  http://eclim.org/features.html

Note that there is not (that I have found) an equivalent to :cscope find d
or :cscope find i, but I used these very rarely, if at all. Nor does Eclim
currently support call trees of functions *called by* the given function,
although Eclipse does, so that may come in the future.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Mechelynck  
View profile  
 More options May 25 2012, 1:49 am
From: Tony Mechelynck <antoine.mechely...@gmail.com>
Date: Fri, 25 May 2012 07:49:26 +0200
Local: Fri, May 25 2012 1:49 am
Subject: Re: Cross referencing in VIM
On 25/05/12 05:59, hilal Adam wrote:

1. You need to know what directory was current when creating cscope.out.
If different from the current directory, it must be given as an
additional argument to :cscope add

2. cscope.out may have become out of date (referencing source files or
include files which don't exist anymore) and in that case you would need
to generate it again.

3. The :cscope command is only available in Vim executables compiled
with + cscope; I recommend to wrap your cscope commands in :if has('cscope')

Best regards,
Tony.
--
"If dolphins are so smart, why did Flipper work for television?"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Edward  
View profile   Translate to Translated (View Original)
 More options May 26 2012, 5:42 am
From: Edward <dwr...@gmail.com>
Date: Sat, 26 May 2012 17:42:52 +0800
Local: Sat, May 26 2012 5:42 am
Subject: Re: Cross referencing in VIM

Hi Adam,
I'm using VIM to develop my projects every day. They are mainly C code
with some perl/python/batch and makefiles. You didn't mention which OS
you are using. So i just want to share my experience on Windows.
cscope is a great plugin to do what you want even though it isn't
updated for a while.
You can just download it and put it into PTAH. Then use it to generate a
database file. In my case, i wrote a batch file to do this :
|del cscope.out|
|ctags -R --c++-types=+p --fields=+iaS --extra=+q|
|gfind . -regex ||".*\.\(c\|h\|mak\|py\|pl\|bat\|cmd\)"| |-not -regex
||".*\(no_use\).*"| |-type f -||printf| |"%%p\n"| |>cscope.file|
|cscope -Rb -icscope.file|

After you get cscope.out(database file), you can open the gvim and use
<:cs add cscope.out> to load your database file. Then you can lookup
your symbols use cs find x xxxxxxx(you can find help by simply type :cs
command)

BTW: there is a great plugin named cscope_maps.vim, it provide bunches
of key map for cscope usage.

锟斤拷 2012/5/18 11:39, hilal Adam 写锟斤拷:

> 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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Syntax highlighting" by hilal Adam
hilal Adam  
View profile  
 More options Nov 14 2012, 6:42 pm
From: hilal Adam <hila...@yahoo.com>
Date: Wed, 14 Nov 2012 15:42:14 -0800 (PST)
Local: Wed, Nov 14 2012 6:42 pm
Subject: Syntax highlighting

I wasn't able to find a related fix for this problem. Sorry if this is a repeat question.
Hope to get some help with this.
I suddenly (not sure when) lost the syntax highlighting for my file types when I start VIM. When I attempt to do "syntax on", I get following error:
"Error detected while processing c:\Program Files\Vim\vim73\syntax\syntax.vim:
line 42:
E216: No such groug or event: filetypedetect BufRead

Thanks in advance for your help.

-H


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Mechelynck  
View profile  
 More options Nov 14 2012, 7:01 pm
From: Tony Mechelynck <antoine.mechely...@gmail.com>
Date: Thu, 15 Nov 2012 01:00:50 +0100
Local: Wed, Nov 14 2012 7:00 pm
Subject: Re: Syntax highlighting
On 15/11/12 00:42, hilal Adam wrote:

> I wasn't able to find a related fix for this problem. Sorry if this is a
> repeat question.
> Hope to get some help with this.
> I suddenly (not sure when) lost the syntax highlighting for my file
> types when I start VIM. When I attempt to do "syntax on", I get
> following error:
> "Error detected while processing c:\Program
> Files\Vim\vim73\syntax\syntax.vim:
> line 42:
> E216: No such groug or event: filetypedetect BufRead

> Thanks in advance for your help.

> -H

Do you have a vimrc (which Vim would see as $HOME/_vimrc on Windows or
$HOME/.vimrc on Unix-like systems)? If you don't, I recommend the
following one-liner:

runtime vimrc_example.vim

Later you may want to add more customizations, usually below that line.

Best regards,
Tony.
--
"I don't like spinach, and I'm glad I don't, because if I liked it I'd
eat it, and I just hate it."
                -- Clarence Darrow


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hilal Adam  
View profile  
 More options Nov 14 2012, 8:04 pm
From: hilal Adam <hila...@yahoo.com>
Date: Wed, 14 Nov 2012 17:03:51 -0800 (PST)
Local: Wed, Nov 14 2012 8:03 pm
Subject: Re: Syntax highlighting

 

________________________________
 From: Tony Mechelynck <antoine.mechely...@gmail.com>
To: vim_use@googlegroups.com
Cc: hilal Adam <hila...@yahoo.com>
Sent: Wednesday, November 14, 2012 6:00 PM
Subject: Re: Syntax highlighting

On 15/11/12 00:42, hilal Adam wrote:

> I wasn't able to find a related fix for this problem. Sorry if this is a
> repeat question.
> Hope to get some help with this.
> I suddenly (not sure when) lost the syntax highlighting for my file
> types when I start VIM. When I attempt to do "syntax on", I get
> following error:
> "Error detected while processing c:\Program
> Files\Vim\vim73\syntax\syntax.vim:
> line 42:
> E216: No such groug or event: filetypedetect BufRead

> Thanks in advance for your help.

> -H

Do you have a vimrc (which Vim would see as $HOME/_vimrc on Windows or $HOME/.vimrc on Unix-like systems)? If you don't, I recommend the following one-liner:

runtime vimrc_example.vim

Later you may want to add more customizations, usually below that line.

Best regards,
Tony.
-- "I don't like spinach, and I'm glad I don't, because if I liked it I'd
eat it, and I just hate it."
        -- Clarence Darrow

-- 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

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++

Oh. Yes I do. Following lines are included:

filetype on
filetype plugin on
filetype indent on
syntax on

Thanks for your reply.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Mechelynck  
View profile  
 More options Nov 14 2012, 8:33 pm
From: Tony Mechelynck <antoine.mechely...@gmail.com>
Date: Thu, 15 Nov 2012 02:32:50 +0100
Local: Wed, Nov 14 2012 8:32 pm
Subject: Re: Syntax highlighting
On 15/11/12 02:03, hilal Adam wrote:

Hm. Then the output of the :scriptnames command should show the
following near the top:

_vimrc
filetype.vim
ftplugin.vim
indent.vim
syntax.vim
synload.vim
syncolor.vim

not necessarily in that order, and with possibly in gvim a menu.vim
somewhere between them. Full paths are included. Do they look
reasonable? I would expect these files to be in "C:/Program
Files/Vim/vim73/" and its subdirectories, shown with either forward
slashes or backslashes as separators, except for your vimrc, which
should be found in some directory which depends on your login name.

Best regards,
Tony.
--
ARTHUR: Go on, Bors, chop its head off.
BORS:   Right.  Silly little bleeder.  One rabbit stew coming up.
                  "Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charles E Campbell  
View profile  
 More options Nov 14 2012, 10:30 pm
From: Charles E Campbell <drc...@campbellfamily.biz>
Date: Wed, 14 Nov 2012 22:29:48 -0500
Local: Wed, Nov 14 2012 10:29 pm
Subject: Re: Syntax highlighting
Tony Mechelynck wrote:
> On 15/11/12 02:03, hilal Adam wrote:
>> <snip>

>> Oh. Yes I do. Following lines are included:

>> filetype on
>> filetype plugin on
>> filetype indent on
>> syntax on

>> Thanks for your reply.

<snip>

Hilal -- do you happen to have

set nocp

in your .vimrc?

Regards,
Charles Campbell


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Mechelynck  
View profile  
 More options Nov 14 2012, 11:01 pm
From: Tony Mechelynck <antoine.mechely...@gmail.com>
Date: Thu, 15 Nov 2012 05:01:20 +0100
Local: Wed, Nov 14 2012 11:01 pm
Subject: Re: Syntax highlighting
On 15/11/12 04:29, Charles E Campbell wrote:

That should make no difference, unless that vimrc is named exrc: if a
vimrc is (looked for and) found, Vim sets 'nocompatible' just before
sourcing it.

It might also make a difference if -u is used, but IMHO it doesn't make
sense to use -u %HOME%\_vimrc

Best regards,
Tony.
--
The faster we go, the rounder we get.
                -- The Grateful Dead


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "_vimrc" by Marcin Szamotulski
Marcin Szamotulski  
View profile  
 More options Nov 15 2012, 5:15 am
From: Marcin Szamotulski <msza...@gmail.com>
Date: Thu, 15 Nov 2012 10:14:47 +0000
Local: Thurs, Nov 15 2012 5:14 am
Subject: Re: _vimrc
On 22:05 Thu 19 Apr     , hilal Adam wrote:

> I an not sure if this an acceptable request or not. My apologies if not.
> Would experts like Ben Fritz, Marcin, Jurgen share their vimrc files with this forum?

> HA

> --
> 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

Wow, you mean me?
    - yes it is already on the net:

    http://atp-vim.sourceforge.net/help.shtml

    (at the bottom)

Best,
    - Marcin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Syntax highlighting" by hilal Adam
hilal Adam  
View profile  
 More options Nov 15 2012, 6:45 pm
From: hilal Adam <hila...@yahoo.com>
Date: Thu, 15 Nov 2012 15:45:16 -0800 (PST)
Local: Thurs, Nov 15 2012 6:45 pm
Subject: Re: Syntax highlighting

________________________________
 From: Charles E Campbell <drc...@campbellfamily.biz>
To: vim_use@googlegroups.com
Sent: Wednesday, November 14, 2012 9:29 PM
Subject: Re: Syntax highlighting

Tony Mechelynck wrote:
> On 15/11/12 02:03, hilal Adam wrote:
>> <snip>

>> Oh. Yes I do. Following lines are included:

>> filetype on
>> filetype plugin on
>> filetype indent on
>> syntax on

>> Thanks for your reply.

<snip>

Hilal -- do you happen to have

set nocp

in your .vimrc?

Regards,
Charles Campbell

--
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

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++
Hi Charles,

Sorry I couldn't respond earlier. Our IT blocks all personal email access at work.

Yes I do have "set nocompatible" in my _vimrc. 
I still have the problem hope someone will be able to identify my problem.

-Hilal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »