Vim Tips Wiki

Read tag files from all directories in your path

1,624pages on
this wiki
Add New Page
Talk0 Share
Tip 1028 Printable Monobook Previous Next

created 2005 · complexity intermediate · version 6.0

In my development environment, I have several header files directories. I need these directories to be both in my path, and in my tags list.

To accomplish this I use the following Python based script:

set path=.,$_WINCEROOT/.,$_WINCEROOT/public/,$_WINCEROOT/public/common/oak/inc,$_WINCEROOT/public/common/ddk/inc,$_WINCEROOT/public/common/sdk/inc,$_WINCEROOT/private/cellcore/dtpt/inc
set tags=./tags,../tags,../inc/tags

function! BuildTagsFromPath()
python << EOF
import sys
import vim
paths = vim.eval("&path") # &path gets the option path.
pathsSplit = paths.split(",")

# prepend original tag list before path.
tags = vim.eval("&tags")
for path in pathsSplit:
  tags += "%s/tags," % (path)
cmdSetTags = "set tags=%s" % tags

call BuildTagsFromPath()


Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.