Problem: ^]
doesn't work if cursor is on a function name prefixed with its package.
I am using ctags
and by reading the tags
file generated I ensured that the sub is indexed in the tags file, like:
a_func_like_this lib/Package/Module.pm /^ sub a_func_like_this {$/; s"
So it works if my cursor is on a_func_like_this
.
However if the full name is specified (along with its module) like Package::Module::a_func_like_this
, ^]
would search for the full name which is not indexed by ctags
.
It's like the default behaviour of ^]
is yiw :tag <C-r>"<CR>
. Which implies that Package::Module::a_func_like_this
is being searched and thus returns no result.
As a workaround I want it to just get the part after ::
if that presents in the Inner Word.
That said, even with such work around, I may have to manually select the correct version of a_func_like_this
even though the exact file I am looking for is clearly Package::Module
(the part discarded). I guess vi
should have something smarter for tag jumping.
How should I approach this?
yaw :tag <C-r>"<CR>
, which doesn't work for full function names because thePackage::
part is captured byyaw
. A workaround is to useyiw
however I may have to manually find the correct version of the function though the package is explicitly seen. Any ideas to make the tag jumping smarter? – Sunny Pun Nov 3 '17 at 0:56--fields
option may be useful. I'll instead try YouCompleteMe to see if that's handled better there... – Sunny Pun Nov 3 '17 at 4:20