22
33Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
44For Vim version 6.0 and above
5- Last change: 2003 Oct 29
5+ Last change: 2004 April 24
66
771. Overview | taglist-intro |
882. Taglist on the internet | taglist-internet |
993. Requirements | taglist-requirement |
10104. Installation | taglist-install |
11115. Usage | taglist-using |
12126. Configuration | taglist-configure |
13- 6 . Commands | taglist-commands |
13+ 7 . Commands | taglist-commands |
14148. Extending | taglist-extend |
15159. FAQ | taglist-faq |
161610. Todo | taglist-todo |
@@ -99,7 +99,8 @@ by adding the following line to your .vimrc file: >
9999This plugin will not work in | compatible | mode. Make sure the | compatible |
100100option is not set. This plugin will not work if you run Vim in the
101101restricted mode (using the -Z command-line argument). This plugin also
102- assumes that the system() Vim function is supported.
102+ assumes that the system() Vim function is supported. Make sure that the
103+ 'C' flag is not set in the 'cpoptions' Vim option.
103104
104105==============================================================================
105106 *taglist-install*
@@ -236,10 +237,14 @@ normal mode mapping for the <F7> key to update the taglist window. >
236237 nnoremap <silent> <F7> :TlistUpdate<CR>
237238<
238239Taglist Session~
240+ A taglist session refers to the group of files and their tags displayed in the
241+ taglist window in a Vim session.
242+
239243You can save and restore taglist sessions (and all the displayed tags)
240- using the TlistSessionSave and TlistSessionLoad commands. To save all
241- the tags displayed in the taglist window in a file, use the TlistSessionSave
242- command and specify the filename: >
244+ using the TlistSessionSave and TlistSessionLoad commands.
245+
246+ To save all the tags displayed in the taglist window in a file, use the
247+ TlistSessionSave command and specify the filename: >
243248
244249 :TlistSessionSave <file name>
245250<
@@ -249,7 +254,14 @@ To load the saved taglist session, use the TlistSessionLoad command: >
249254<
250255Information about the tags displayed for the files in the taglist window will
251256be stored in the taglist session file. This will be used to restore the
252- taglist window state later.
257+ taglist window state later. When you load a taglist session file, the tags
258+ stored in the file will be added to the tags already displayed in the taglist
259+ window.
260+
261+ The taglist session feature can be used to save the tags for large files or a
262+ group of frequently used files (like a project). By using the taglist session
263+ file, you can minimize the amount to time it takes to load/refresh the taglist
264+ window for those files.
253265
254266Changing the taglist window highlighting~
255267The following highlight groups are defined and used to highlight the various
@@ -300,6 +312,8 @@ in the taglist window.
300312 q Close the taglist window
301313 ? Display help
302314
315+ The above keys will work in both the normal mode and the insert mode.
316+
303317Using the taglist plugin with the winmanager plugin~
304318You can use the taglist plugin with the winmanager plugin. This will allow you
305319to use the file explorer, buffer explorer and the taglist plugin at the same
@@ -442,40 +456,87 @@ window is open. >
442456
443457 let Tlist_Exit_OnlyWindow = 1
444458<
459+ Tlist_File_Fold_Auto_Close~
460+ By default, the tags tree displayed in the taglist window for all the buffers
461+ will be opened. You can close/fold the tags tree for the files manually. To
462+ automatically close the tags tree for inactive files, you can set the
463+ Tlist_File_Fold_Auto_Close variable to 1. When this variable is set to 1, if
464+ a Vim buffer is no longer displayed in a Vim window, the corresponding tags
465+ tree in the taglist window will be collapsed/folded. When a buffer is loaded
466+ in a Vim window, the corresponding tags tree will be opened.
467+ >
468+ let Tlist_File_Fold_Auto_Close = 1
469+ <
470+ Tlist_Auto_Highlight_Tag~
471+ By default, the taglist plugin will highlight the current tag in the taglist
472+ window. If you want to disable the highlighting of the current tag, then you
473+ can set the Tlist_Auto_Highlight_Tag variable to zero. Note that even though
474+ the current tag highlighting is disabled, the tags for a new file will still
475+ be added to the taglist window.
476+ >
477+ let Tlist_Auto_Highlight_Tag = 0
478+ <
479+ Tlist_Process_File_Always~
480+ By default, the taglist plugin will generate and process tags for new files
481+ only when the taglist window is opened. When the taglist window is closed, the
482+ taglist plugin will stop processing the tags for new files. You can set the
483+ Tlist_Process_File_Always variable to 1 to generate the list of tags for new
484+ files even when the taglist window is closed. When you open the taglist
485+ window, the tags for all the files opened so far will be displayed.
486+ >
487+ let Tlist_Process_File_Always = 1
488+ <
489+
445490==============================================================================
446491 *taglist-commands*
4474927. Commands~
448493
449494The taglist plugin provides the following ex-mode commands:
450495
451496Tlist~
452- You can use the ":Tlist" command to open or close (toggle) the taglist window.
453- Invoking the ":Tlist" command when the taglist window is opened, will close
454- the taglist window.
497+ Open or close (toggle) the taglist window. Opens the taglist window, if the
498+ window is not opened currently. Closes the taglist window, if the taglist
499+ window is already opened.
455500
456501TlistClose~
457- You can use the ":TlistClose" command to close the taglist window .
502+ Close the taglist window. Can be used from any one of the Vim windows .
458503
459504TlistUpdate~
460- You can use the ":TlistUpdate" command to update the tags for the current
461- buffer after you made some changes to the buffer. You should save the
462- modified buffer before you update the taglist window. Otherwise the listed
463- tags will not include the new tags created in the buffer.
505+ Update the tags for the current buffer. When a file is changed and saved to
506+ disk, the taglist window will not be automatically updated to display the new
507+ tags in the file. The ":TlistUpdate" command can be used to force an update of
508+ the tags for the current file/buffer. As the taglist plugin uses the file
509+ saved in the disk (instead of the file displayed in a Vim buffer), you should
510+ save the modified buffer before you update the taglist window. Otherwise the
511+ listed tags will not include the new tags created in the buffer.
464512
465513TlistSync~
466- You can use the ":TlistSync" command to highlight the current tag.
514+ Highlight the current tag in the taglist window. By default, the taglist
515+ plugin periodically updates the taglist window to highlight the current tag.
516+ The ":TlistSync" command can be used to force the taglist plugin to highlight
517+ the current tag.
467518
468519TlistShowPrototype~
469- You can use the ":TlistShowPrototype" command to display the prototype
470- of a function in the specified line number.
520+ Display the prototype of the tag near the specified line number. If the line
521+ number is not specified, the current line number is used. A tag spans multiple
522+ lines starting from the line where it is defined to the line before the next
523+ tag. The ":TlistShowPrototype" command displays the prototype for the tag for
524+ any line number in this range.
525+
526+ TlistShowTag~
527+ Display the name of the tag defined near the specified line number. If the
528+ line number is not specified, the current line number is used. A tag spans
529+ multiple lines starting from the line where it is defined to the line before
530+ the next tag. The ":TlistShowTag" command displays the tag name for any line
531+ number in this range.
471532
472533TlistSessionSave~
473- You can save the tags displayed in the taglist window to a file using
474- the ":TlistSessionSave" command .
534+ Save the information about files and tags displayed in the taglist window to
535+ the specified session file .
475536
476537TlistSessionLoad~
477- You can load a taglist session from a file using the ":TlistSessionLoad"
478- command .
538+ Load information about files and tags stored from the specified session file
539+ and update the taglist window with those files .
479540
480541==============================================================================
481542 *taglist-extend*
@@ -487,6 +548,9 @@ C#, Cobol, Eiffel, Erlang, Fortran, HTML, Java, Javascript, Lisp, Lua, Make,
487548Pascal, Perl, PHP, Python, Rexx, Ruby, Scheme, Shell, Slang, SML, Sql, TCL,
488549Verilog, Vim and Yacc.
489550
551+ You can modify the taglist plugin support for the above listed languages. You
552+ can also extend the taglist plugin to add support for new languages.
553+
490554If you want to add support for a new language to the taglist plugin, you need
491555to first extend the exuberant ctags tool. For more information about extending
492556exuberant ctags, visit http://ctags.sourceforge.net/EXTENDING.html
@@ -502,6 +566,9 @@ in the buffer containing the desired file: >
502566
503567 :set filetype
504568<
569+ For example, to modify the support for the perl language files, you have to
570+ set the tlist_perl_settings variable.
571+
505572The format of the value set in the tlist_xxx_settings variable is >
506573
507574 <language_name>;flag1:name1;flag2:name2;flag3:name3
@@ -517,7 +584,8 @@ functions, the 'f' flag should be used. For more information about the flags
517584supported by exuberant ctags for a particular language, read the help text
518585from the 'ctags --help' comand. The sub-field 'name' specifies the title
519586text to use for displaying the tags of a particular type. For example,
520- 'name' can be set to 'functions' .
587+ 'name' can be set to 'functions' . This field can be set to any text
588+ string name.
521589
522590For example, to list only the classes and functions defined in a C++
523591language file, add the following lines to your .vimrc file >
@@ -534,8 +602,22 @@ Functions" as the title for the function group, use >
534602
535603 let tlist_c_settings = 'c;f:My Functions'
536604<
605+ When you set the tlist_xxx_settings variable, you will override the default
606+ setting used by the taglist plugin for the 'xxx' language. You cannot add to
607+ the options used by the taglist plugin for a particular file type.
608+
537609To add support for a new language, set the tlist_xxx_settings variable
538- appropriately as described above.
610+ appropriately as described above. For example, to extend the taglist plugin
611+ to support the latex language, you can use the following line (assuming, you
612+ have already extended exuberant ctags to support the latex language): >
613+
614+ let tlist_tex_settings='latex;b:bibitem;c:command;l:label'
615+ <
616+ With the above line, when you edit files of filetype "tex" in Vim, the taglist
617+ plugin will invoke the exuberant ctags tool with the "latex" filetype and with
618+ the flags b, c and l to generate the tags. The text heading 'bibitem' ,
619+ 'command' and 'label' will be used for the tags which are generated for the
620+ flags b, c and l respectively.
539621
540622==============================================================================
541623 *taglist-faq*
0 commit comments