bitc / lushtags

Create ctags compatible tags files for Haskell programs
MIT License
81 stars 14 forks source link

"No tags file" when attempting to jump to tag #13

Closed jberryman closed 11 years ago

jberryman commented 11 years ago

I'm new to using tags with Vim, so forgive me if this is obvious. I've installed lushtags according to the docs, and get a correct-looking sidebar when opening a file.

The documentation says:

Tagbar is nice because it deals with creating tags automatically. There is no need to manually run commands or keep track of tag files. 

I assumed that meant I could just open tagbar anywhere and then do the usual jumping between files, but when I put the cursor over a token in the current file and do a ctrl-] I'm receiving:

E433: No tags file
E426: tag not found: Foo

Am I misunderstanding what should be happening?

bitc commented 11 years ago

lushtags isn't designed to be used this way. It creates no tag files and is designed to only show tags in Tagbar.

If you want to be able to jump to tags then you will need to use one of the other tag generation programs (or twist lushtags to generate tag files).

Even better, however, is to use another program of mine, vim-hdevtools, which has a feature that allows you to jump to identifiers. It is much smarter than tags: for example, if you have multiple functions in different modules with the same name, then vim-hdevtools knows to jump to the correct function. It will also give you the full signature of identifiers, plus lots of other great features.

jberryman commented 11 years ago

Thanks for responding and I'll check out vim-hdevtools.

So lushtags only works per-file? As I said I haven't used vim with tags much, and just started trying out tagbar, so I might not know what I'm doing. But it seems like from the README that lushtags is purporting to be an easier replacement for the usual methods of "manually running commands" that "keep track of tag files", while actually providing little of the same functionality. Could the README be clarified.

Thanks for your work!

atn34 commented 11 years ago

From the first line of the readme: "Create ctags compatible tags files for Haskell programs"

Maybe this is a little misleading?

Also how exactly do you jump to function definition with vim-hdevtools? That feature does not seem to be documented.

bitc commented 11 years ago

@atn34:

  1. In vim-hdevtools, move the cursor over the function you are interested in.
  2. Execute :HdevtoolsInfo
  3. A window will open up showing some details about the function, including a hyperlink pointing to the source file and location where it is defined
  4. Move your cursor over the hyperlink and press Enter (or Control Enter to navigate in a split)
duilec commented 5 months ago
  1. To check if ctags is installed on your system, type the following command
ctags --version
  1. If the ctags command is not found, install universal-ctags or exuberant-ctags, type the following command
sudo apt update
sudo apt install exuberant-ctags # or sudo apt install universal-ctags
  1. cd to your folder, type the following command
ctags -R .
  1. vim to your file or folder, type ctrl-] to jump definition of function/data structure (backing by ctrl-t)
  2. if your definition of function in current file, please use gd in vim.