Topic: gd request

The gd command in VIM just goes to the first place in the file that an item is defined.  ViEmu mimics that gehavior exactly.  I think it would be nicer if gd actually went to the real declaration of an item - even if the item is a method defined in a different class.  Example:


MyFile2 x = new MyFile2();

If the cursor is on MyFile2Object and I press gd, it would open MyFile2.
If the cursor is on MyFile2() it would open MyFile2 and go to the constructor.
If the cursor is on DoSomething it would open MyFile2 and go to the DoSomething() method.

If declarations are in the same file then gd would bring me to that declaration instead of just the first place it is used.  There is a GoToDeclaration opion in VisualStudio so it would probably be just a remappging for gd.

This would be much appreciated,



Re: gd request

Thanks for the suggestion, Jerry. We take note of it and will look into adding this in a future release.


Re: gd request

Jerry, you can mimic that quite easily with the following mapping:

:nnoremap gd "zyiw:vsc Edit.GotoDefinition <c-r>z<return>

This maps gd to copying the word under the cursor to register z ("zyiw) and then types the ex command :vsc which can invoke a VS command, types Edit.GotoDefinition and retrieves the contents of the z register (<c-r>z), followed by typing <return> to execute it.

I've just tested it and it works fine.

ViEmu ain't fully programmable, but you can often do nice-ish things with the available tools smile


Re: gd request

This worked great.  I put it in my _viemurc file and everything is good.  This command is a good lesson in mapping commands also.

Thanks a bunch.