?? taglist.txt
字號:
*Tlist_Get_Tagname_By_Line()*Tlist_Get_Tagname_By_Line([{filename}, {linenumber}]) Return the name of the tag at or before the specified line number in the specified file. If the filename and line number are not specified, then the current buffer name and the current line number are used. *Tlist_Set_App()*Tlist_Set_App({appname}) Set the name of the plugin that controls the taglist plugin window and buffer. This can be used to integrate the taglist plugin with other Vim plugins. For example, the winmanager plugin and the Cream package use this function and specify the appname as "winmanager" and "cream" respectively. By default, the taglist plugin is a stand-alone plugin and controls the taglist window and buffer. If the taglist window is controlled by an external plugin, then the appname should be set appropriately.============================================================================== *taglist-extend*9. Extending~The taglist plugin supports all the languages supported by the exuberant ctagstool, which includes the following languages: Assembly, ASP, Awk, Beta, C,C++, C#, Cobol, Eiffel, Erlang, Fortran, HTML, Java, Javascript, Lisp, Lua,Make, Pascal, Perl, PHP, Python, Rexx, Ruby, Scheme, Shell, Slang, SML, Sql,TCL, Verilog, Vim and Yacc.You can modify the taglist plugin support for the above listed languages. Youcan also extend the taglist plugin to add support for new languages.If you want to add support for a new language to the taglist plugin, you needto first extend the exuberant ctags tool. For more information about extendingexuberant ctags, visit http://ctags.sourceforge.net/EXTENDING.html You can extend the taglist plugin to add support for new languages or modifythe support for an already supported language by setting the followingvariables in the .vimrc file.To modify the support for an already supported language, you have to set thetlist_xxx_settings variable. Replace xxx with the Vim filetype name. Todetermine the filetype name used by Vim for a file, use the following commandin the buffer containing the file: > :set filetype<For example, to modify the support for the perl language files, you have toset the tlist_perl_settings variable.The format of the value set in the tlist_xxx_settings variable is> <language_name>;flag1:name1;flag2:name2;flag3:name3<The different fields in the value are separated by the ';' character.The first field 'language_name' is the name used by exuberant ctags to referto this language files. This name can be different from the file type nameused by Vim. For example, for C++, the language name used by ctags is 'c++'but the filetype name used by Vim is 'cpp'.The remaining fields follow the format "flag:name". The sub-field 'flag' isthe language specific flag used by exuberant ctags to generate thecorresponding tags. For example, for the C language, to list only thefunctions, the 'f' flag is used. For more information about the flagssupported by exuberant ctags for a particular language, read the help textfrom the 'ctags --help' command. The sub-field 'name' specifies the title textto use for displaying the tags of a particular type. For example, 'name' canbe set to 'functions'. This field can be set to any text string name.For example, to list only the classes and functions defined in a C++language file, add the following lines to your .vimrc file> let tlist_cpp_settings = 'c++;c:class;f:function'<In the above setting, 'cpp' is the Vim filetype name and 'c++' is the nameused by the exuberant ctags tool. 'c' and 'f' are the flags passed toexuberant ctags to list C++ classes and functions and 'class' is the titleused for the class tags and 'function' is the title used for the function tagsin the taglist window.For example, to display only functions defined in a C file and to use "MyFunctions" as the title for the function tags, use> let tlist_c_settings = 'c;f:My Functions'<When you set the tlist_xxx_settings variable, you will override the defaultsetting used by the taglist plugin for the 'xxx' language. You cannot add tothe default options used by the taglist plugin for a particular file type.To add support for a new language, set the tlist_xxx_settings variableappropriately as described above. Replace 'xxx' in the variable name with theVim filetype name for the new language.For example, to extend the taglist plugin to support the latex language, youcan use the following line (assuming, you have already extended exuberantctags to support the latex language): > let tlist_tex_settings='latex;b:bibitem;c:command;l:label'<With the above line, when you edit files of filetype "tex" in Vim, the taglistplugin will invoke the exuberant ctags tool passing the "latex" filetype andthe flags b, c and l to generate the tags. The text heading 'bibitem','command' and 'label' will be used in the taglist window for the tags whichare generated for the flags b, c and l respectively.============================================================================== *taglist-faq*10. Frequently Asked Questions~Q. The taglist plugin doesn't work. The taglist window is empty and the tags defined in a file are not displayed. A. Are you using Vim version 6.0 and above? The taglist plugin relies on the features supported by Vim version 6.0 and above. You can use the following command to get the Vim version:> $ vim --version< Are you using exuberant ctags version 5.0 and above? The taglist plugin relies on the features supported by exuberant ctags and will not work with GNU ctags or the Unix ctags utility. You can use the following command to determine whether the ctags installed in your system is exuberant ctags:> $ ctags --version< Did you turn on the Vim filetype detection? The taglist plugin relies on the filetype detected by Vim and passes the filetype to the exuberant ctags utility to parse the tags. Check the output of the following Vim command:> :filetype< The output of the above command should contain "filetype detection:ON". To turn on the filetype detection, add the following line to the .vimrc or _vimrc file:> filetype on< Is your version of Vim compiled with the support for the system() function? The following Vim command should display 1:> :echo exists('*system')< In some Linux distributions (particularly Suse Linux), the default Vim installation is built without the support for the system() function. The taglist plugin uses the system() function to invoke the exuberant ctags utility. You need to rebuild Vim after enabling the support for the system() function. If you use the default build options, the system() function will be supported. Do you have the |'shellslash'| option set? You can try disabling the |'shellslash'| option. When the taglist plugin invokes the exuberant ctags utility with the path to the file, if the incorrect slashes are used, then you will see errors. Check the shell related Vim options values using the following command:> :set shell? shellcmdflag? shellpipe? :set shellquote? shellredir? shellxquote?< If these options are set in your .vimrc or _vimrc file, try removing those lines. Are you using a Unix shell in a MS-Windows environment? For example, the Unix shell from the MKS-toolkit. Do you have the SHELL environment set to point to this shell? You can try resetting the SHELL environment variable. If you are using a Unix shell on MS-Windows, you should try to use exuberant ctags that is compiled for Unix-like environments so that exuberant ctags will understand path names with forward slash characters. Is your filetype supported by the exuberant ctags utility? The file types supported by the exuberant ctags utility are listed in the ctags help. If a file type is not supported, you have to extend exuberant ctags. You can use the following command to list the filetypes supported by exuberant ctags:> ctags --list-languages< Run the following command from the shell prompt and check whether the tags defined in your file are listed in the output from exuberant ctags:> ctags -f - --format=2 --excmd=pattern --fields=nks <filename>< If you see your tags in the output from the above command, then the exuberant ctags utility is properly parsing your file. Do you have the .ctags or _ctags or the ctags.cnf file in your home directory for specifying default options or for extending exuberant ctags? If you do have this file, check the options in this file and make sure these options are not interfering with the operation of the taglist plugin. If you are using MS-Windows, check the value of the TEMP and TMP environment variables. If these environment variables are set to a path with space characters in the name, then try using the DOS 8.3 short name for the path or set them to a path without the space characters in the name. For example, if the temporary directory name is "C:\Documents and Settings\xyz\Local Settings\Temp", then try setting the TEMP variable to the following:> set TEMP=C:\DOCUMEN~1\xyz\LOCALS~1\Temp< If exuberant ctags is installed in a directory with space characters in the name, then try adding the directory to the PATH environment variable or try setting the 'Tlist_Ctags_Cmd' variable to the shortest path name to ctags or try copying the exuberant ctags to a path without space characters in the name. For example, if exuberant ctags is installed in the directory "C:\Program Files\Ctags", then try setting the 'Tlist_Ctags_Cmd' variable as below:> let Tlist_Ctags_Cmd='C:\Progra~1\Ctags\ctags.exe'<Q. When I try to open the taglist window, I am seeing the following error message. How do I fix this problem? Taglist: Failed to generate tags for /my/path/to/file ctags: illegal option -- -^@usage: ctags [-BFadtuwvx] [-f tagsfile] file ...A. The taglist plugin will work only with the exuberant ctags tool. You cannot use the GNU ctags or the Unix ctags program with the taglist plugin. You will see an error message similar to the one shown above, if you try use a non-exuberant ctags program with Vim. To fix this problem, either add the exuberant ctags tool location to the PATH environment variable or set the 'Tlist_Ctags_Cmd' variable.Q. A file has more than one tag with the same name. When I select a tag name from the taglist window, the cursor is positioned at the incorrect tag location. A. The taglist plugin uses the search pattern generated by the exuberant ctags utility to position the cursor at the location of a tag definition. If a file has more than one tag with the same name and same prototype, then the search pattern will be the same. In this case, when searching for the tag pattern, the cursor may be positioned at the incorrect location. Q. I have made some modifications to my file and introduced new functions/classes/variables. I have not yet saved my file. The taglist plugin is not displaying the new tags when I update the taglist window.A. The exuberant ctags utility will process only files that are present in the disk. To list the tags defined in a file, you have to save the file and then update the taglist window. Q. I have created a ctags file using the exuberant ctags utility for my source tree. How do I configure the taglist plugin to use this tags file? A. The taglist plugin doesn't use a tags file stored in disk. For every opened file, the taglist plugin invokes the exuberant ctags utility to get the list of tags dynamically. The Vim system() function is used to invoke exuberant ctags and get the ctags output. This function internally uses a temporary file to store the output. This file is deleted after the output from the command is read. So you will never see the file that contains the output of exuberant ctags.Q. When I set the |'updatetime'| option to a low value (less than 1000) and if I keep pressing a key with the taglist window open, the current buffer contents are changed. Why is this?A. The taglist plugin uses the |CursorHold| autocmd to highlight the current tag. The CursorHold autocmd triggers for every |'updatetime'| milliseconds. If the |'updatetime'| option is set to a low value, then the CursorHold autocmd will be triggered frequently. As the taglist plugin changes the focus to the taglist window to highlight the current tag, this could interfere with the key movement resulting in changing the contents of the current buffer. The workaround for this problem is to not set the |'updatetime'| option to a low value.============================================================================== *taglist-todo*11. Todo~1. Group tags according to the scope and display them. For example, group all the tags belonging to a C++/Java class 2. Support for displaying tags in a modified (not-yet-saved) file. 3. Automatically open the taglist window only for selected filetypes. For other filetypes, close the taglist window. 4. When using the shell from the MKS toolkit, the taglist plugin doesn't work.5. The taglist plugin doesn't work with files edited remotely using the netrw plugin. The exuberant ctags utility cannot process files over scp/rcp/ftp, etc.==============================================================================vim:tw=78:ts=8:noet:ft=help:
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -