c0r73x / neotags.nvim

Tag highlight in neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No highlighting and error in ctags-default flags

m31k0r opened this issue · comments

  • The default for neotags_ctags_args should contain −−extra=[+|−]flags not --extras=[+|-]flags
  • I am not able to see any difference, when invoking NeotagsToogle.
    My Config:

let g:neotags_enabled = 1
let g:neotags_ctags_args = [ \ '--fields=+l', \ '--c-kinds=+p', \ '--c++-kinds=+p', \ '--sort=no', \ '--extra=+q', \ ]
let g:neotags_highlight = 1

I use the latest version of Universal Ctags which tells me:
Warning: --extra option is obsolete; use --extras instead

Thats why I use extras instead of extra as default. But you can define it in your vimrc.

Which version of ctags are you using, it might be that it generates diffrent kinds of tagfiles that I havn't tested.

So Archlinux still uses Exuberant Ctags 5.8 as default. So the problem with extras/extra gets resolved by using Universal Ctags.

But I still don't see any Highlighting.
init.vim:

"Install Plugins
call plug#begin('~/.config/nvim/plugged')
Plug 'c0r73x/neotags.nvim', { 'do': ':UpdateRemotePlugins' }
call plug#end()

"Config for Neotag
let g:neotags_enabled = 1
let g:neotags_highlight = 1

Example test.cpp:

#define FOO int
FOO test;
class Foo2 {};
Foo2 test2;

Generated tags:

FOO	/home/jholder/test/test.cpp	/^#define FOO /;"	d	language:C++	file:
test	/home/jholder/test/test.cpp	/^FOO test;$/;"	v	language:C++	typeref:typename:FOO
Foo2	/home/jholder/test/test.cpp	/^class Foo2 {};$/;"	c	language:C++	file:
test2	/home/jholder/test/test.cpp	/^Foo2 test2;$/;"	v	language:C++	typeref:typename:Foo2

Only class, #define, int gets highlighted.
Versions:

NVIM v 0.2.2
Universal Ctags 0.0.0(47726595), Copyright (C) 2015 Universal Ctags Team

Thanks for the help.

Humm ok I get the same problem when running with a clean vimrc.

I will fix it.

Now it should work as expected.

Yes now it works. Could you maybe add in the README that universal-ctags is needed and Exuberant Ctags is not enough.