Vim & CtrlPBufTag not working with custom tags (ctags)

279 Views Asked by At

Here is .ctags file:

-R
--langdef=swift
--langmap=swift:.swift
--regex-swift=/[[:<:]]class[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/c,class/
--regex-swift=/[[:<:]]enum[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/e,enum/
--regex-swift=/[[:<:]]func[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/f,function/
--regex-swift=/[[:<:]]protocol[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/P,protocol/
--regex-swift=/[[:<:]]struct[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/s,struct/
--regex-swift=/[[:<:]]extension[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/E,extension/
--regex-swift=/[[:<:]]typealias[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/t,typealias/

The tags file is being generated just fine, and I can search for Swift tags using the :tag command. When I use the :CtrlPBufTag, I get the ==NO ENTRIES== message.

The tags are working just fine for other filetypes. Example, here is a tagfile for two files, one PHP and one Swift:

!_TAG_FILE_FORMAT   2   /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED   1   /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR    Darren Hiebert  /[email protected]/
!_TAG_PROGRAM_NAME  Exuberant Ctags //
!_TAG_PROGRAM_URL   http://ctags.sourceforge.net    /official site/
!_TAG_PROGRAM_VERSION   5.8 //
PhpTest test.php    /^class PhpTest$/;" c
SwiftyClass test.swift  /^class SwiftyClass {$/;"   c
__construct test.php    /^    public function __construct()$/;" f
swiftyFunc  test.swift  /^    func swiftyFunc() {$/;"   f

On the PHP file, I can use :CtrlPBufTag to view tags for the buffer. For Swift, I get the ==NO ENTRIES==.

0

There are 0 best solutions below