From 738d7508181423e1633e4d5d6014e8ad2acb4595 Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Thu, 12 Aug 2010 16:23:26 +0200 Subject: Documented :HighlightTags tags file format requirements --- README.md | 12 +++++++++++- TODO.md | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8ae9d39..a9f13cd 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ On Windows the [system()] [system] function used by `easytags.vim` causes a comm ### The `:UpdateTags` command -This command executes [Exuberant Ctags] [exuberant_ctags] from inside Vim to update the global tags file defined by `g:easytags_file`. When no arguments are given the tags for the current file are updated, otherwise the arguments are passed on to `ctags`. For example when you execute the Vim command `:UpdateTags -R ~/.vim` (or `:UpdateTags -R ~\vimfiles` on Windows) the plug-in will execute `ctags -R ~/.vim` for you (with some additional arguments). +This command executes [Exuberant Ctags] [exuberant_ctags] from inside Vim to update the global tags file defined by `g:easytags_file`. When no arguments are given the tags for the current file are updated, otherwise the arguments are passed on to `ctags`. For example when you execute the Vim command `:UpdateTags -R ~/.vim` (or `:UpdateTags -R ~\vimfiles` on Windows) the plug-in will execute `ctags -R ~/.vim` for you (with some additional arguments, see the troubleshooting section "`:HighlightTags` only works for the tags file created by `:UpdateTags`" for more information). When you execute this command like `:UpdateTags!` (including the bang!) then all tags whose files are missing will be filtered from the global tags file. @@ -100,6 +100,16 @@ UNIX has [symbolic links](http://en.wikipedia.org/wiki/Symbolic_link) and [hard ## Troubleshooting +### `:HighlightTags` only works for the tags file created by `:UpdateTags` + +If you want to create tags files and have their tags highlighted by the `easytags.vim` plug-in then you'll have to create the tags file with certain arguments to Exuberant Ctags: + + $ ctags --fields=+l --c-kinds=+p --c++-kinds=+p ... + +The `--fields=+l` argument makes sure that Exuberant Ctags includes a `language:...` property with each entry in the tags file. This is required by the `:HighlightTags` command so it can filter tags by their file type. The other two arguments make sure Exuberant Ctags generates tags for function prototypes in C/C++ source code. + +If you have the `g:easytags_include_members` option enabled (its off by default) then you'll also need to add the `--extra=+q` argument so that Exuberant Ctags generates tags for structure/class members. + ### The plug-in complains that Exuberant Ctags isn't installed After a Mac OS X user found out the hard way that the `ctags` executable isn't always Exuberant Ctags and we spend a few hours debugging the problem I added proper version detection: The plug-in executes `ctags --version` when Vim is started to verify that Exuberant Ctags 5.5 or newer is installed. If it isn't Vim will show the following message on startup: diff --git a/TODO.md b/TODO.md index fbe11b3..d881ec0 100644 --- a/TODO.md +++ b/TODO.md @@ -8,7 +8,9 @@ * Use separate tags files for each language stored in ~/.vim/tags/ to increase performance because a single, global tags file quickly grows to a megabyte? - * On Microsoft Windows (tested on XP) GVim loses focus while `ctags` is running because Vim opens a command prompt window. Also the CursorHold event seems to fire repeatedly, contradicting my understanding of the autocmd and its behavior on UNIX?! + * Make `g:easytags_autorecurse` accept the following values: 0 (only scan the current file), 1 (always scan all files in the same directory) and 2 (always recurse down the current directory)? + + * On Microsoft Windows (tested on XP) GVim loses focus while `ctags` is running because Vim opens a command prompt window. Also the CursorHold event seems to fire repeatedly, contradicting my understanding of the automatic command and its behavior on UNIX?! This behavior doesn't occur when I use the integration with my `shell.vim` plug-in. * I might have found a bug in Vim: The tag `easytags#highlight_cmd` was correctly being highlighted by my plug-in (and was indeed included in my tags file) even though I couldn't jump to it using `Ctrl-]`, which caused: -- cgit v1.2.3