Wikia

Vim Tips Wiki

Changes: Read tag files from all directories in your path

Edit

Back to page

(change "anon" author to blank; trim "created" date; minor manual clean)
m (category)
 
Line 9: Line 9:
 
|version=6.0
 
|version=6.0
 
|rating=-3/3
 
|rating=-3/3
|category1=
+
|category1=Navigation
 
|category2=
 
|category2=
 
}}
 
}}

Latest revision as of 15:36, May 3, 2011

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

Around Wikia's network

Random Wiki