Ubuntu – How to configure ctags in Kate

kate

I use Kubuntu LTS as my OS. How to use ctags in Kate?

I selected ctags in the plugin manager window, so that now, by right clicking on any word of my code few ctags options appear. Namely: "go to declaration", "go to definition", "look up". But choosing one of these options nothing happens.

I think I did something wrong in the configuration: what should I write in the "ctags database" and in the "index targets" boxes?

Best Answer

Once you have CTags installed

sudo apt-get install exuberant-ctags

Activate the plugin by going to Settings -> Configure Kate...

Then when the window pops up, click Application -> Plugins and check "CTags"

screenshot of kate plugins

Next in Kate's Index Targets tab pane, click Add and enter the /path/to/project/root, then click Update Index

screenshot of "Index Targets" pane

Now you will be able to use the CTags.


Notice the Database tab pane is where you can set the CTags command. See the man pages for options. Generally, I like to exclude my dependency package folders by adding:

--exclude=vendor --exclude=node_modules

No need to put anything in the "CTags Database File" field because Kate will automatically generate this file when you click Update Index

screenshot database tab pane


Note that you can, but do not need to create a .kateproject file to use the CTags.

Related Question