質問

The below dir hierarchy is from ctags faq

I could create a tag file, with absolute file path as

cd ~/project
ctags --file-scope=no -R `pwd`

how can I create one tag file which searches my project, and the std library functions. For example, say my project is /sysint/client , and the library is at /misccomp. How can I create a tag file which searches both these dir and sub dir. (I do not want to search all under / ).

DO you thinking splitting into 2 tag file is better?

`-----misccomp
  |       `...
  `-----sysint
          `-----client
          |       `-----hdrs
          |       `-----lib
          |       `-----src
          |       `-----test
          `-----common
          |       `-----hdrs
          |       `-----lib
          |       `-----src
          |       `-----test
          `-----server
                  `-----hdrs
                  `-----lib
                  `-----src
                  `-----test
役に立ちましたか?

解決

I think that splitting into 2 tag file is better. Why:

  • I think, you need to update your tags sometimes. There is faster to update smaller tag file than bigger one. So, when you edit your project, only project's tags are updated, when you edit lib - only lig's tags are updated. Instead of update all the tags every time;
  • While I was writing plugin Indexer I found out that several tag files works not slower that single tag file.

I also would recommend you to use this plugin Indexer, it will do all the work automatically. It provides painless automatic tags generation and keeps tags up-to-date. Tags file is generated in background, so you don't have to wait. Check it if you want.

UPD: For detailed information, see the article: Vim: convenient code navigation for your projects, which explains the usage of Indexer + Vimprj thoroughly. Among other things, tags for libraries are explained, which is exactly what you want.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top