Live data from Hacker News

Dumb-jump: an Emacs “jump to definition” package

github.com

11–20 of 53 posts

Re: Dumb-jump: an Emacs “jump to definition” package

#15

What do people use to get something like this for C/C++? Also is there any package for auto-completion in C/C++?

EmacsTags + CompanyMode and you should be good to go. You'll need to install the correct tags package for your system, but it's only about 10 minutes of minor annoyance.

Whenever the point is over a word in a C++ codebase, e.g. FooSystem, it will be underlined, and you can click on it and jump to definition, show all references, etc. Then if you type Foo, CompanyMode should pop up a dialog box that will autocomplete FooManager.

I think you can also install a fuzzy matching package for CompanyMode which allows you to type e.g. "FSy" to complete "FooSystem", though I may be confusing Helm and CompanyMode.

You may also want to check out the Projectile package. It's for large project navigation, and I think it helps with automatically running ETags / GTags on an as-needed basis.

Re: Dumb-jump: an Emacs “jump to definition” package

#16
post #2

Still learning VIM user here, do we have something like this?

Are you aware of '*' and '#', and 'gd'? http://vim.wikia.com/wiki/Go_to_definition_using_g

It never seems to work for me. If I put the cursor over a word and type gd, it seems to go to the first line that the word is mentioned, not necessarily the definition. It's handy, for sure, but not too reliable. I think it can be improved with some plugins though.

Re: Dumb-jump: an Emacs “jump to definition” package

#18

I must be missing something, but what is the advantage of this over something like Emacs Tags ( https://www.emacswiki.org/emacs/EmacsTags ) ?

Building a tags file is not trivial.For example if you cloned a random repository on github you'd want to just jump around and not have to have the additional step of generating it and keeping it up to date.

Re: Dumb-jump: an Emacs “jump to definition” package

#19

What do people use to get something like this for C/C++? Also is there any package for auto-completion in C/C++?

RTags works pretty well and always jump to the right definition for me. You pass it to a compilation database json file that you can make using CMake. It runs in the background as a daemon and provides robust go-to-definition as well as autocomplete for both C and C++.

https://github.com/Andersbakken/rtags

Re: Dumb-jump: an Emacs “jump to definition” package

#20
post #18

I must be missing something, but what is the advantage of this over something like Emacs Tags ( https://www.emacswiki.org/emacs/EmacsTags ) ?

Building a tags file is not trivial.For example if you cloned a random repository on github you'd want to just jump around and not have to have the additional step of generating it and keeping it up to date.

Can't it just be done automatically and on-the-fly using ctags or another appropriate command?
Post reply on HN