> 1. CTRL-W }
>
> Seems exactly like what I want, but requires me to build a tags file
> and include it in every folder where I have .js files.
>
> My function prototypes are global, is there some way to have a
> "global" tags file in a central location? eg. under $VIM?
Have you looked at the 'tags' option?
:help 'tags'
With the right path setup in 'tags', you can use a single
``tags`` file in the root directory of your JavaScript projects,
if that's what you want.
In my C projects, I usually keep Vim's current working
directory at the top of the project rather than changing into
the directory immediately containing the file I'm editing, so I
keep a ``tags`` file at the top of the tree of files for my
current project, but you could add an absolute path to 'tags' if
you like, and generate the tags from your "prototype" files.
I also run the ``ctags`` tool as follows:
ctags \
--recurse \
--c-kinds=+px \
--c++-kinds=+px \
--fields=+iaS \
--extra=+q
In particular, the ``--recurse`` flag tells ``ctags`` to descend
into subdirectories to extract tags from your source code. I
don't know what JavaScript-specific switches you'll want to use,
but the basic idea should get you going.
> 2. [I
>
> Jumps to matches for the current keyword, looking in all included
> files. Unfortunately, Javascript has no #include equivalent.
>
> Can I manually forces files into the list that the include commands
> search?
With a recursively generated ``tags`` file as described above,
you may find you are content with tags-related commands such as:
CTRL-] " Jump to the tag under cursor (like :tag).
g] " Use :tselect for tag under cursor.
See more at:
:help tagsrch.txt
Michael Henry
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
No comments:
Post a Comment