Wikia

Vim Tips Wiki

Read tag files from all directories in your path

Talk0
1,610pages on
this wiki
Revision as of 15:36, May 3, 2011 by Fritzophrenic (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
vim.command(cmdSetTags)
EOF
endfunction

call BuildTagsFromPath()

CommentsEdit

Advertisement | Your ad here

Around Wikia's network

Random Wiki