0

Right now I'm trying to configure ctags in my vim environment but I'm not sure what I'm missing.

First, I installed ctags (using yaourt) and the I added this on ~/.ctags.

After that, I run ctags -R . on the root of my project and it generated a file "tags" with 14000 lines.

I open vim and use the :set tags=./tags making sure that I'm pointing to the right tags file, and when I try to jump to a definition using Ctrl+Shift+} (in a latin american keyboard, which stands for Ctrl+]) it doesn't work. And when I try to see the :tags, it shows that there are not any tags.

What am I missing? Why is this not working properly?

6
  • 1
    I recommend using universal-ctags-git on aur instead of ctags.
    – Mass
    Commented Sep 20, 2017 at 19:18
  • What does :tag {some-variable} do?
    – Tumbler41
    Commented Sep 20, 2017 at 19:18
  • Before using set tags=./tags it shows the proper definition of the variable, after that, it's not working.
    – sant016
    Commented Sep 20, 2017 at 19:32
  • 1
    Does it give an error? Have you ensured that your tags file is in the appropriate directory and is called "tags?" Also you might try set tags=./tags;. This makes it search in parent directories for tags.
    – Tumbler41
    Commented Sep 20, 2017 at 19:34
  • Yes it is in the appropiated directory, and it said that there were not any tags. Do you know why the Ctrl+Shift+{ is not working?
    – sant016
    Commented Sep 20, 2017 at 19:39

2 Answers 2

1

Along with Mass's answer, I think your latin american keyboard might be causing some confusion. Vim can't see Shift and Ctrl when used together on letter keys, because it produces no ASCII output. I simulated a latin american keyboard on my computer and found that in order to trigger tags all I needed to do was

CTRL+}

It's counter-intuitive since the documentation says that its CTRL+] but because of how vim interprets Ctrl this is the correct key combo on a latin american keyboard.

0
2
  1. set tags=./tags means "path of the current file" not necessarily the current directory. The vim default set tags=./tags,tags would look in both path of current file and current directory. You can ensure the correct file is shown with echo tagfiles()

  2. The way to show all tags is :tselect / (not :tags, which shows the tag stack, only active when you have navigated with tags). After scrolling down to the bottom of the list, you can type a number to jump to that tag.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.