mirror of
https://github.com/gryf/tagbar.git
synced 2026-05-11 00:42:59 +02:00
Compare commits
147 Commits
v2.5
...
show_tag_kind
| Author | SHA1 | Date | |
|---|---|---|---|
| 7404b43c62 | |||
| 8d8550cf5d | |||
| 7b36c46d17 | |||
| 91566e6c0b | |||
| d01d7e7546 | |||
| 399b75256a | |||
| 40be9a2e5f | |||
| c6b473f559 | |||
| 8a8e85436d | |||
| 1773059756 | |||
| 3634e7ab4f | |||
| eb392a4502 | |||
| a284cd0091 | |||
| c21176d8da | |||
| 00dfa82b00 | |||
| e62d3444e9 | |||
| 04bb728039 | |||
| fcac7f2936 | |||
| bfc121dc38 | |||
| 4fa15349c5 | |||
| f9c5f24576 | |||
| a084e47eb4 | |||
| df09799372 | |||
| f933907afa | |||
| 5283bc834a | |||
| 5d1ae684a1 | |||
| e1eec86934 | |||
| 5c33e09d68 | |||
| 251c774431 | |||
| 37400d9950 | |||
| 64e935fe58 | |||
| b54d8d64f1 | |||
| 76f16f891b | |||
| 4e5e0ebe59 | |||
| 032fd1fbb3 | |||
| f3a369c31d | |||
| f46ba1a41f | |||
| 9ee516ee6f | |||
| 59c9b7ce1c | |||
| 5e392c1b8d | |||
| ca1c9ee2e2 | |||
| 9bf4fd99e4 | |||
| a9ec78aa5b | |||
| ae46cc025b | |||
| 87d0111bd3 | |||
| 0181f1d0cd | |||
| a5220adc9a | |||
| fabae6a11d | |||
| 2bc6e96ae4 | |||
| 8a139e0576 | |||
| be46ee5988 | |||
| b2c5f0b928 | |||
| 07b7e9b68e | |||
| c251265edf | |||
| fdceb4ea71 | |||
| 614b5b244f | |||
| 3fdefbaa47 | |||
| 368d37ed45 | |||
| 13d4cfcc2c | |||
| 42ce2919a3 | |||
| 836a39af8f | |||
| 0ead3332a9 | |||
| e872e67641 | |||
| b610fb2f5d | |||
| ace45adc51 | |||
| 88d7464079 | |||
| dbc05b24a3 | |||
| 6d8770f949 | |||
| c4963e91cc | |||
| 87bbb46e95 | |||
| b4a5800f72 | |||
| ba3693f977 | |||
| 528bdc6b8d | |||
| 2dcd5260b6 | |||
| 3f28e3b073 | |||
| 915b11bd1c | |||
| e090fe73d1 | |||
| 574376d165 | |||
| 66c56b11a7 | |||
| c57dd9f7a4 | |||
| f3250b2dd1 | |||
| 0377f19d74 | |||
| 2d650b96cf | |||
| 290b71e2b7 | |||
| 78a7eeecf3 | |||
| 207b8520c2 | |||
| 1a2c4ec958 | |||
| 0fd09344c7 | |||
| abffaba655 | |||
| 15f9ad6e88 | |||
| b60d08c468 | |||
| e5408f740f | |||
| 85c198ba57 | |||
| 2e2ba2eab2 | |||
| fd79a17189 | |||
| ae4bbcdaaf | |||
| 3c37ddcc14 | |||
| 5566cb34d5 | |||
| 97d7b04bdd | |||
| 4801c897f8 | |||
| 24efd12f50 | |||
| fec9b2a1ab | |||
| 56cd34830d | |||
| 0b14e28719 | |||
| 225fcaa3ce | |||
| dab8d99fb8 | |||
| a566f7141f | |||
| 7ef2dd0ef1 | |||
| 84d65042fa | |||
| c37d783d4f | |||
| 7ec151a7a9 | |||
| e97d2c00ad | |||
| 57acb383b6 | |||
| 495e5fcb08 | |||
| 746771801c | |||
| 824767bc48 | |||
| 57ee79bd4c | |||
| a217435f50 | |||
| 2bacadf716 | |||
| e4fda667f9 | |||
| 5732ce9bd6 | |||
| f36e0d3d39 | |||
| dacf4f273e | |||
| 82a932406f | |||
| 2ebd2a1392 | |||
| ca02374f40 | |||
| a93fb868d8 | |||
| 070a75cb04 | |||
| 24915dbe24 | |||
| f5435678fb | |||
| 3ecdb5028d | |||
| d0d307c9bd | |||
| f0f9d66465 | |||
| e6e084e8b0 | |||
| cde257b1bc | |||
| 54b28e4988 | |||
| 7c0d8675b5 | |||
| acca348959 | |||
| 1c605bd958 | |||
| 2665695f57 | |||
| 32b5b15b52 | |||
| 87d293206b | |||
| 93f2b68166 | |||
| db9404ca1a | |||
| b6f47e4020 | |||
| ec0eb883dc | |||
| d0df97040b |
@@ -0,0 +1,82 @@
|
||||
TAGBAR LICENSE
|
||||
|
||||
This is the normal Vim license (see ':h license' in Vim) with the necessary
|
||||
replacements for the project and maintainer information.
|
||||
|
||||
I) There are no restrictions on distributing unmodified copies of Tagbar
|
||||
except that they must include this license text. You can also distribute
|
||||
unmodified parts of Tagbar, likewise unrestricted except that they must
|
||||
include this license text. You are also allowed to include executables
|
||||
that you made from the unmodified Tagbar sources, plus your own usage
|
||||
examples and scripts.
|
||||
|
||||
II) It is allowed to distribute a modified (or extended) version of Tagbar,
|
||||
including executables and/or source code, when the following four
|
||||
conditions are met:
|
||||
1) This license text must be included unmodified.
|
||||
2) The modified Tagbar must be distributed in one of the following five ways:
|
||||
a) If you make changes to Tagbar yourself, you must clearly describe in
|
||||
the distribution how to contact you. When the maintainer asks you
|
||||
(in any way) for a copy of the modified Tagbar you distributed, you
|
||||
must make your changes, including source code, available to the
|
||||
maintainer without fee. The maintainer reserves the right to
|
||||
include your changes in the official version of Tagbar. What the
|
||||
maintainer will do with your changes and under what license they
|
||||
will be distributed is negotiable. If there has been no negotiation
|
||||
then this license, or a later version, also applies to your changes.
|
||||
The current maintainer is Jan Larres <jan@majutsushi.net>. If this
|
||||
changes it will be announced in appropriate places (most likely
|
||||
majutsushi.github.io/tagbar and/or github.com/majutsushi/tagbar).
|
||||
When it is completely impossible to contact the maintainer, the
|
||||
obligation to send him your changes ceases. Once the maintainer has
|
||||
confirmed that he has received your changes they will not have to be
|
||||
sent again.
|
||||
b) If you have received a modified Tagbar that was distributed as
|
||||
mentioned under a) you are allowed to further distribute it
|
||||
unmodified, as mentioned at I). If you make additional changes the
|
||||
text under a) applies to those changes.
|
||||
c) Provide all the changes, including source code, with every copy of
|
||||
the modified Tagbar you distribute. This may be done in the form of
|
||||
a context diff. You can choose what license to use for new code you
|
||||
add. The changes and their license must not restrict others from
|
||||
making their own changes to the official version of Tagbar.
|
||||
d) When you have a modified Tagbar which includes changes as mentioned
|
||||
under c), you can distribute it without the source code for the
|
||||
changes if the following three conditions are met:
|
||||
- The license that applies to the changes permits you to distribute
|
||||
the changes to the Tagbar maintainer without fee or restriction, and
|
||||
permits the Tagbar maintainer to include the changes in the official
|
||||
version of Tagbar without fee or restriction.
|
||||
- You keep the changes for at least three years after last
|
||||
distributing the corresponding modified Tagbar. When the
|
||||
maintainer or someone who you distributed the modified Tagbar to
|
||||
asks you (in any way) for the changes within this period, you must
|
||||
make them available to him.
|
||||
- You clearly describe in the distribution how to contact you. This
|
||||
contact information must remain valid for at least three years
|
||||
after last distributing the corresponding modified Tagbar, or as
|
||||
long as possible.
|
||||
e) When the GNU General Public License (GPL) applies to the changes,
|
||||
you can distribute the modified Tagbar under the GNU GPL version 2
|
||||
or any later version.
|
||||
3) A message must be added, at least in the documentation, such that the
|
||||
user of the modified Tagbar is able to see that it was modified. When
|
||||
distributing as mentioned under 2)e) adding the message is only
|
||||
required for as far as this does not conflict with the license used for
|
||||
the changes.
|
||||
4) The contact information as required under 2)a) and 2)d) must not be
|
||||
removed or changed, except that the person himself can make
|
||||
corrections.
|
||||
|
||||
III) If you distribute a modified version of Tagbar, you are encouraged to use
|
||||
the Tagbar license for your changes and make them available to the
|
||||
maintainer, including the source code. The preferred way to do this is
|
||||
by e-mail or by uploading the files to a server and e-mailing the URL. If
|
||||
the number of changes is small (e.g., a modified Makefile) e-mailing a
|
||||
context diff will do. The e-mail address to be used is
|
||||
<jan@majutsushi.net>
|
||||
|
||||
IV) It is not allowed to remove this license from the distribution of the
|
||||
Tagbar sources, parts of it or from a modified version. You may use this
|
||||
license for previous Tagbar releases instead of the license that they
|
||||
came with, at your option.
|
||||
@@ -1,16 +1,89 @@
|
||||
# Overview
|
||||
# Tagbar: a class outline viewer for Vim
|
||||
|
||||
Tagbar is a vim plugin for browsing the tags of source code files.
|
||||
It provides a sidebar that displays the ctags-generated tags of the current file, ordered by their scope. This means that for example methods in C++ are displayed under the class they are defined in.
|
||||
## What Tagbar is
|
||||
|
||||
Check out the homepage at http://majutsushi.github.com/tagbar/ for more information.
|
||||
Tagbar is a Vim plugin that provides an easy way to browse the tags of the
|
||||
current file and get an overview of its structure. It does this by creating a
|
||||
sidebar that displays the ctags-generated tags of the current file, ordered by
|
||||
their scope. This means that for example methods in C++ are displayed under
|
||||
the class they are defined in.
|
||||
|
||||
## What Tagbar is not
|
||||
|
||||
# Important: If the file structure is displayed wrong
|
||||
Tagbar is not a general-purpose tool for managing `tags` files. It only
|
||||
creates the tags it needs on-the-fly in-memory without creating any files.
|
||||
`tags` file management is provided by other plugins, like for example
|
||||
[easytags](https://github.com/xolox/vim-easytags).
|
||||
|
||||
If you notice that there are some errors in the way your file's structure is displayed in Tagbar, please make sure that the bug is actually in Tagbar before you report a bug. Since Tagbar uses [exuberant-ctags](http://ctags.sourceforge.net/) and compatible programs to do the actual file parsing, it is likely that the bug is actually in one of those programs instead.
|
||||
## Dependencies
|
||||
|
||||
There is an example in `:h tagbar-issues` about how to run ctags manually so you can determine where the bug actually is. If the bug is actually in ctags, please report it on their website instead, as there is nothing I can do about it in Tagbar. Thank you!
|
||||
[Vim 7.0](http://www.vim.org/) (But see note below)
|
||||
[Exuberant ctags 5.5](http://ctags.sourceforge.net/)
|
||||
|
||||
You can also have a look at ctags bugs that have previously been filed on Tagbar here:
|
||||
https://github.com/majutsushi/tagbar/issues?labels=ctags-bug&page=1&state=closed
|
||||
## Installation
|
||||
|
||||
Extract the archive or clone the repository into a directory in your
|
||||
`'runtimepath'`, or use a plugin manager of your choice like
|
||||
[pathogen](https://github.com/tpope/vim-pathogen). Don't forget to run
|
||||
`:helptags` if your plugin manager doesn't do it for you so you can access the
|
||||
documentation with `:help tagbar`.
|
||||
|
||||
Note: Vim versions < 7.0.167 have a bug that prevents Tagbar from working. If
|
||||
you are affected by this use this alternate Tagbar download instead:
|
||||
[zip](https://github.com/majutsushi/tagbar/zipball/70fix). It is on par with
|
||||
version 2.2 but probably won't be updated after that due to the amount of
|
||||
changes required.
|
||||
|
||||
If the ctags executable is not installed in one of the directories in your
|
||||
`$PATH` environment variable you have to set the `g:tagbar_ctags_bin`
|
||||
variable, see the documentation for more info.
|
||||
|
||||
## Quickstart
|
||||
|
||||
Put something like the following into your ~/.vimrc:
|
||||
|
||||
```vim
|
||||
nmap <F8> :TagbarToggle<CR>
|
||||
```
|
||||
|
||||
If you do this the F8 key will toggle the Tagbar window. You can of course use
|
||||
any shortcut you want. For more flexible ways to open and close the window
|
||||
(and the rest of the functionality) see the documentation.
|
||||
|
||||
## Support for additional filetypes
|
||||
|
||||
For filetypes that are not supported by Exuberant Ctags check out [the
|
||||
wiki](https://github.com/majutsushi/tagbar/wiki) to see whether other projects
|
||||
offer support for them and how to use them. Please add any other
|
||||
projects/configurations that you find or create yourself so that others can
|
||||
benefit from them, too.
|
||||
|
||||
## Note: If the file structure display is wrong
|
||||
|
||||
If you notice that there are some errors in the way your file's structure is
|
||||
displayed in Tagbar, please make sure that the bug is actually in Tagbar
|
||||
before you report an issue. Since Tagbar uses
|
||||
[exuberant-ctags](http://ctags.sourceforge.net/) and compatible programs to do
|
||||
the actual file parsing, it is likely that the bug is actually in the program
|
||||
responsible for that filetype instead.
|
||||
|
||||
There is an example in `:h tagbar-issues` about how to run ctags manually so
|
||||
you can determine where the bug actually is. If the bug is actually in ctags,
|
||||
please report it on their website instead, as there is nothing I can do about
|
||||
it in Tagbar. Thank you!
|
||||
|
||||
You can also have a look at [ctags bugs that have previously been filed
|
||||
against Tagbar](https://github.com/majutsushi/tagbar/issues?labels=ctags-bug&page=1&state=closed).
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||

|
||||
|
||||
## License
|
||||
|
||||
Vim license, see LICENSE
|
||||
|
||||
## Maintainer
|
||||
|
||||
Jan Larres <[jan@majutsushi.net](mailto:jan@majutsushi.net)>
|
||||
|
||||
+1246
-558
File diff suppressed because it is too large
Load Diff
+316
-40
@@ -3,7 +3,7 @@
|
||||
Author: Jan Larres <jan@majutsushi.net>
|
||||
Licence: Vim licence, see |license|
|
||||
Homepage: http://majutsushi.github.com/tagbar/
|
||||
Version: 2.5
|
||||
Version: 2.6.1
|
||||
|
||||
==============================================================================
|
||||
Contents *tagbar* *tagbar-contents*
|
||||
@@ -21,6 +21,7 @@ Contents *tagbar* *tagbar-contents*
|
||||
Highlight colours ............. |tagbar-highlight|
|
||||
Automatically opening Tagbar .. |tagbar-autoopen|
|
||||
Show current tag in statusline |tagbar-statusline|
|
||||
Ignoring specific files ....... |tagbar-ignore|
|
||||
6. Extending Tagbar ................ |tagbar-extend|
|
||||
7. Troubleshooting & Known issues .. |tagbar-issues|
|
||||
8. History ......................... |tagbar-history|
|
||||
@@ -107,14 +108,13 @@ The following features are supported by Tagbar:
|
||||
------------------------------------------------------------------------------
|
||||
OTHER CTAGS-COMPATIBLE PROGRAMS *tagbar-other*
|
||||
|
||||
Tagbar theoretically also supports filetype-specific programs that can output
|
||||
tag information that is compatible with ctags. However due to potential
|
||||
incompatibilities this may not always completely work. Tagbar has been tested
|
||||
with doctorjs/jsctags and will use that if present, other programs require
|
||||
some configuration (see |tagbar-extend|). If a program does not work even with
|
||||
correct configuration please contact me.
|
||||
Tagbar also supports filetype-specific programs that can produce
|
||||
ctags-compatible output, as long as these programs can write to the standard
|
||||
output. Tagbar has been tested with doctorjs/jsctags and will use that if
|
||||
present, other programs require some configuration (see |tagbar-extend|). If a
|
||||
program does not work even with correct configuration please contact me.
|
||||
|
||||
Note: Please check |tagbar-issues| for some possible issues with jsctags.
|
||||
Note: Please check |tagbar-issues| for some potential issues with jsctags.
|
||||
|
||||
==============================================================================
|
||||
2. Requirements *tagbar-requirements*
|
||||
@@ -132,7 +132,7 @@ The following requirements have to be met in order to be able to use tagbar:
|
||||
|
||||
Tagbar will work on any platform that ctags runs on -- this includes
|
||||
UNIX derivatives, Mac OS X and Windows. Note that other versions like
|
||||
GNU ctags will not work.
|
||||
BSD ctags will not work.
|
||||
Tagbar generates the tag information by itself and doesn't need (or use)
|
||||
already existing tag files.
|
||||
- File type detection must be turned on in vim. This can be done with the
|
||||
@@ -195,11 +195,11 @@ and have it close automatically on tag selection regardless of the
|
||||
|g:tagbar_autoclose| setting.
|
||||
|
||||
Pausing the Tagbar window~
|
||||
Use |:TagbarTogglePause| to toggle freezing the Tagbar window on its currently
|
||||
displayed file. Freezing the window stops the Tagbar contents from changing
|
||||
when switching to a different source file. All Tagbar functionality continues
|
||||
to work as expected. Unfreezing the window will cause it to load the current
|
||||
source file.
|
||||
Use |:TagbarTogglePause| to toggle freezing/locking the Tagbar window on its
|
||||
currently displayed file. Freezing the window stops the Tagbar contents from
|
||||
changing when switching to a different source file. All Tagbar functionality
|
||||
continues to work as expected. Unfreezing the window will cause it to load the
|
||||
current source file.
|
||||
|
||||
Jumping to tags~
|
||||
When you're inside the Tagbar window you can jump to the definition of a tag
|
||||
@@ -250,7 +250,8 @@ COMMANDS *tagbar-commands*
|
||||
'j' Jump to Tagbar window if already open
|
||||
'c' Close Tagbar on tag selection (just as if |g:tagbar_autoclose| were
|
||||
set to 1, but doesn't imply 'f'), but only if the Tagbar window was
|
||||
opened using this command.
|
||||
opened using this command. If this is used the "c" flag will be
|
||||
shown in the statusline of the Tagbar window.
|
||||
|
||||
For example, the following command would always jump to the Tagbar window,
|
||||
opening it first if necessary, but keep it open after selecting a tag
|
||||
@@ -261,14 +262,15 @@ COMMANDS *tagbar-commands*
|
||||
Close the Tagbar window if it is open.
|
||||
|
||||
:TagbarToggle *:TagbarToggle*
|
||||
Open the Tagbar window if it is closed or close it if it is open.
|
||||
:Tagbar
|
||||
Open the Tagbar window if it is closed, or close it if it is open.
|
||||
|
||||
:TagbarOpenAutoClose *:TagbarOpenAutoClose*
|
||||
Open the Tagbar window, jump to it and close it on tag selection. This is
|
||||
an alias for ":TagbarOpen fjc".
|
||||
|
||||
:TagbarTogglePause *:TagbarTogglePause*
|
||||
Freezes/Unfreezes the Tagbar window. Stops the contents of the window
|
||||
Freezes/Unfreezes the Tagbar window. Stops the contents of the window
|
||||
from changing when a different source file is selected.
|
||||
|
||||
:TagbarSetFoldlevel[!] {number} *:TagbarSetFoldlevel*
|
||||
@@ -298,6 +300,8 @@ COMMANDS *tagbar-commands*
|
||||
Start debug mode. This will write debug messages to file [logfile] while
|
||||
using Tagbar. If no argument is given "tagbardebug.log" in the current
|
||||
directory is used. Note: an existing file will be overwritten!
|
||||
Note also that it is usually necessary to call this command before loading
|
||||
a file that creates problems in order to get all of the needed data.
|
||||
|
||||
:TagbarDebugEnd *:TagbarDebugEnd*
|
||||
End debug mode, debug messages will no longer be written to the logfile.
|
||||
@@ -307,28 +311,63 @@ KEY MAPPINGS *tagbar-keys*
|
||||
|
||||
The following mappings are valid in the Tagbar window:
|
||||
|
||||
<F1> Display key mapping help.
|
||||
<F1>/? Display key mapping help.
|
||||
Map option: tagbar_map_help
|
||||
<CR>/<Enter> Jump to the tag under the cursor. Doesn't work for pseudo-tags
|
||||
or generic headers.
|
||||
Map option: tagbar_map_jump
|
||||
p Jump to the tag under the cursor, but stay in the Tagbar window.
|
||||
Map option: tagbar_map_preview
|
||||
P Open the tag in a |preview-window|.
|
||||
Map option: tagbar_map_previewwin
|
||||
<LeftMouse> When on a fold icon, open or close the fold depending on the
|
||||
current state.
|
||||
<2-LeftMouse> Same as <CR>. See |g:tagbar_singleclick| if you want to use a
|
||||
single- instead of a double-click.
|
||||
<C-N> Go to the next top-level tag.
|
||||
Map option: tagbar_map_nexttag
|
||||
<C-P> Go to the previous top-level tag.
|
||||
Map option: tagbar_map_prevtag
|
||||
<Space> Display the prototype of the current tag (i.e. the line defining
|
||||
it) in the command line.
|
||||
Map option: tagbar_map_showproto
|
||||
v Hide tags that are declared non-public. Tags without any
|
||||
visibility information will still be shown.
|
||||
Map option: tagbar_map_hidenonpublic
|
||||
+/zo Open the fold under the cursor.
|
||||
Map option: tagbar_map_openfold
|
||||
-/zc Close the fold under the cursor or the current one if there is
|
||||
no fold under the cursor.
|
||||
Map option: tagbar_map_closefold
|
||||
o/za Toggle the fold under the cursor or the current one if there is
|
||||
no fold under the cursor.
|
||||
Map option: tagbar_map_togglefold
|
||||
*/zR Open all folds by setting foldlevel to 99.
|
||||
Map option: tagbar_map_openallfolds
|
||||
=/zM Close all folds by setting foldlevel to 0.
|
||||
<C-N> Go to the next top-level tag.
|
||||
<C-P> Go to the previous top-level tag.
|
||||
Map option: tagbar_map_closeallfolds
|
||||
zj Go to the start of the next fold, like the standard Vim |zj|.
|
||||
Map option: tagbar_map_nextfold
|
||||
zk Go to the end of the previous fold, like the standard Vim |zk|.
|
||||
Map option: tagbar_map_prevfold
|
||||
s Toggle sort order between name and file order.
|
||||
Map option: tagbar_map_togglesort
|
||||
c Toggle the |g:tagbar_autoclose| option.
|
||||
Map option: tagbar_map_toggleautoclose
|
||||
x Toggle zooming the window.
|
||||
Map option: tagbar_map_zoomwin
|
||||
q Close the Tagbar window.
|
||||
Map option: tagbar_map_close
|
||||
|
||||
These mappings can be redefined with the given map options. The argument can
|
||||
be either a string or a |List| of strings. In the latter case the
|
||||
functionality will be assigned to all of the keys in the list. For example, if
|
||||
you want to remap the sort toggling functionality to "r":
|
||||
>
|
||||
let g:tagbar_map_togglesort = "r"
|
||||
<
|
||||
See |key-notation| for how to write special keys like <Space> or the keypad
|
||||
keys.
|
||||
|
||||
==============================================================================
|
||||
5. Configuration *tagbar-configuration*
|
||||
@@ -352,11 +391,29 @@ Default: 0
|
||||
By default the Tagbar window will be opened on the right-hand side of vim. Set
|
||||
this option to open it on the left instead.
|
||||
|
||||
If |g:tagbar_vertical| is used then setting this variable will open the Tagbar
|
||||
window at the top, otherwise it will open at the bottom.
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:tagbar_left = 1
|
||||
<
|
||||
|
||||
*g:tagbar_vertical*
|
||||
g:tagbar_vertical~
|
||||
Default: 0
|
||||
|
||||
If this is set to a positive value then the Tagbar window will be opened at
|
||||
the top or bottom of the Vim window instead of at the side. This can be useful
|
||||
for monitors that have been rotated into a vertical position. The value of
|
||||
this variable will determine the number of lines to use for the Tagbar window.
|
||||
See |g:tagbar_left| for configuring the position of the window.
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:tagbar_vertical = 30
|
||||
<
|
||||
|
||||
*g:tagbar_width*
|
||||
g:tagbar_width~
|
||||
Default: 40
|
||||
@@ -368,12 +425,30 @@ Example:
|
||||
let g:tagbar_width = 30
|
||||
<
|
||||
|
||||
*g:tagbar_zoomwidth*
|
||||
g:tagbar_zoomwidth~
|
||||
Default: 1
|
||||
|
||||
Width of the Tagbar window when zoomed.
|
||||
|
||||
Possible values are:
|
||||
1: Use the maximum width available.
|
||||
0: Use the width of the longest currently visible tag.
|
||||
>1: Use this width in characters.
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:tagbar_zoomwidth = 0
|
||||
<
|
||||
|
||||
*g:tagbar_autoclose*
|
||||
g:tagbar_autoclose~
|
||||
Default: 0
|
||||
|
||||
If you set this option the Tagbar window will automatically close when you
|
||||
jump to a tag. This implies |g:tagbar_autofocus|.
|
||||
jump to a tag. This implies |g:tagbar_autofocus|. If enabled the "C" flag will
|
||||
be shown in the statusline of the Tagbar window. This can also be toggled with
|
||||
a key, see |tagbar-keys|.
|
||||
|
||||
Example:
|
||||
>
|
||||
@@ -443,12 +518,45 @@ Example:
|
||||
let g:tagbar_show_visibility = 0
|
||||
<
|
||||
|
||||
*g:tagbar_show_linenumbers*
|
||||
g:tagbar_show_linenumbers~
|
||||
Default: 0
|
||||
|
||||
Whether line numbers should be shown in the Tagbar window.
|
||||
|
||||
Possible values are:
|
||||
0: Don't show any line numbers.
|
||||
1: Show absolute line numbers.
|
||||
2: Show relative line numbers.
|
||||
-1: Use the global line number settings.
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:tagbar_show_linenumbers = 2
|
||||
<
|
||||
|
||||
*g:tagbar_hide_nonpublic*
|
||||
g:tagbar_hide_nonpublic~
|
||||
Default: 0
|
||||
|
||||
Hide tags that are declared non-public. Tags without any visibility
|
||||
information will still be shown. If enabled the "v" flag will be shown in the
|
||||
statusline of the Tagbar window. This can also be toggled with a key, see
|
||||
|tagbar-keys|.
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:tagbar_hide_nonpublic = 1
|
||||
<
|
||||
|
||||
*g:tagbar_expand*
|
||||
g:tagbar_expand~
|
||||
Default: 0
|
||||
|
||||
If this option is set the Vim window will be expanded by the width of the
|
||||
Tagbar window if using a GUI version of Vim.
|
||||
If this option is set to 1 the Vim window will be expanded by the width of the
|
||||
Tagbar window if using a GUI version of Vim. Setting it to 2 will also try
|
||||
expanding a terminal, but note that this is not supported by all terminals.
|
||||
See also |xterm-resize|.
|
||||
|
||||
Example:
|
||||
>
|
||||
@@ -492,7 +600,7 @@ Examples (don't worry if some of the characters aren't displayed correctly,
|
||||
just choose other characters in that case):
|
||||
>
|
||||
let g:tagbar_iconchars = ['â–¶', 'â–Ľ'] (default on Linux and Mac OS X)
|
||||
let g:tagbar_iconchars = ['â–ľ', 'â–¸']
|
||||
let g:tagbar_iconchars = ['â–¸', 'â–ľ']
|
||||
let g:tagbar_iconchars = ['â–·', 'â—˘']
|
||||
let g:tagbar_iconchars = ['+', '-'] (default on Windows)
|
||||
<
|
||||
@@ -501,17 +609,50 @@ just choose other characters in that case):
|
||||
g:tagbar_autoshowtag~
|
||||
Default: 0
|
||||
|
||||
If this variable is set and the current tag is inside of a closed fold then
|
||||
the folds will be opened as much as needed for the tag to be visible so it can
|
||||
be highlighted. If it is not set then the folds won't be opened and the parent
|
||||
tag will be highlighted instead. You can use the |:TagbarShowTag| command to
|
||||
open the folds manually.
|
||||
If this variable is set to 1 and the current tag is inside of a closed fold
|
||||
then the folds will be opened as much as needed for the tag to be visible so
|
||||
it can be highlighted. If it is set to 0 then the folds will only be opened
|
||||
when opening the Tagbar window and the current tag is inside a closed fold,
|
||||
otherwise the folds won't be opened and the parent tag will be highlighted
|
||||
instead. If it is set to 2 then the folds will never be opened automatically.
|
||||
|
||||
You can use the |:TagbarShowTag| command to open the folds manually.
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:tagbar_autoshowtag = 1
|
||||
<
|
||||
|
||||
*g:tagbar_previewwin_pos*
|
||||
g:tagbar_previewwin_pos~
|
||||
Default: "topleft", or "rightbelow vertical" if |g:tagbar_vertical| is set
|
||||
|
||||
The position of the preview window. Valid values are the window splitting
|
||||
commands that are described starting from |:vertical|. Set it to an empty
|
||||
string to use the options 'splitbelow' and 'splitright'.
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:tagbar_previewwin_pos = "aboveleft"
|
||||
<
|
||||
If you want to disable line numbers in the preview window put something like
|
||||
this into your vimrc:
|
||||
>
|
||||
autocmd BufWinEnter * if &previewwindow | setlocal nonumber | endif
|
||||
<
|
||||
|
||||
*g:tagbar_autopreview*
|
||||
g:tagbar_autopreview~
|
||||
Default: 0
|
||||
|
||||
If this variable is set to 1 then moving the cursor in the Tagbar window will
|
||||
automatically show the current tag in the preview window.
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:tagbar_autopreview = 1
|
||||
<
|
||||
|
||||
*g:tagbar_updateonsave_maxlines*
|
||||
g:tagbar_updateonsave_maxlines~
|
||||
|
||||
@@ -527,14 +668,47 @@ system is different from the one set in Vim, i.e. the 'encoding' option. For
|
||||
example, if you use a Simplified Chinese Windows version that has a system
|
||||
encoding of "cp936", and you have set 'encoding' to "utf-8", then you would
|
||||
have to set this variable to "cp936".
|
||||
Note that this requires Vim to be compiled with the |+multi_byte| and (unless
|
||||
your encoding is latin1) |+iconv| features to work.
|
||||
Note that this requires Vim to be compiled with the |+multi_byte| and |+iconv|
|
||||
features to work.
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:tagbar_systemenc = 'cp936'
|
||||
<
|
||||
|
||||
*g:tagbar_status_func*
|
||||
g:tagbar_status_func~
|
||||
Default: undefined
|
||||
|
||||
This is the name of a function whose return value will be used to draw the
|
||||
statusline of the Tagbar window.
|
||||
|
||||
The function has to take four arguments:
|
||||
1. current: Whether Tagbar is the current window; 0 or 1.
|
||||
2. sort: The sort order of the tags; 'Name' if they are sorted by name and
|
||||
'Order' if they are sorted by their order of appearance in the file.
|
||||
3. fname: The name of the file that the tags belong to.
|
||||
4. flags: A list of characters that represent various state in the Tagbar
|
||||
window.
|
||||
|
||||
In order to avoid possible future additions to the arguments resulting in an
|
||||
error it is recommended to add an additional vararg to the signature (see
|
||||
|a:0|).
|
||||
|
||||
Here is an example that, when put into your vimrc, will emulate Tagbar's
|
||||
default statusline:
|
||||
>
|
||||
function! TagbarStatusFunc(current, sort, fname, flags, ...) abort
|
||||
let colour = a:current ? '%#StatusLine#' : '%#StatusLineNC#'
|
||||
let flagstr = join(flags, '')
|
||||
if flagstr != ''
|
||||
let flagstr = '[' . flagstr . '] '
|
||||
endif
|
||||
return colour . '[' . sort . '] ' . flagstr . fname
|
||||
endfunction
|
||||
let g:tagbar_status_func = 'TagbarStatusFunc'
|
||||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
HIGHLIGHT COLOURS *tagbar-highlight*
|
||||
|
||||
@@ -654,6 +828,9 @@ tagbar#currenttag({format}, {default} [, {flags}])
|
||||
'p' Display the raw prototype instead of the parsed tag. This can be
|
||||
useful in cases where ctags doesn't report some information, like
|
||||
the signature. Note that this can get quite long.
|
||||
'k' This is essentially the same as in 'f' flag - it will display the
|
||||
full hierarchy of the tag, and additionally will provide the
|
||||
information of the kind of the tag.
|
||||
|
||||
For example, if you put the following into your statusline: >
|
||||
%{tagbar#currenttag('[%s] ','')}
|
||||
@@ -663,6 +840,18 @@ Note that if there is an error when processing the current file no error
|
||||
message will be shown in order to not disrupt the statusline. If the function
|
||||
doesn't seem to work right open the Tagbar window to see any error messages.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
IGNORING SPECIFIC FILES *tagbar-ignore*
|
||||
|
||||
You can ignore specific files by setting the |buffer-variable|
|
||||
"b:tagbar_ignore" to 1. This is best done with an |autocommand|:
|
||||
>
|
||||
autocmd BufNewFile,BufReadPost foo.cpp let b:tagbar_ignore = 1
|
||||
<
|
||||
Note that autocommands are order-sensitive, so make sure that this autocommand
|
||||
gets defined before the ones that Tagbar defines so the variable will get
|
||||
found at the right time.
|
||||
|
||||
==============================================================================
|
||||
6. Extending Tagbar *tagbar-extend*
|
||||
|
||||
@@ -793,6 +982,25 @@ ctagsargs: The arguments to be passed to the filetype-specific ctags program
|
||||
program output its data on stdout. Not used for the normal ctags
|
||||
program.
|
||||
|
||||
The value of ctagsargs may be a |List| of strings (a string for
|
||||
each argument), or a single string (|expr-string|) of all the
|
||||
arguments.
|
||||
|
||||
When the value of ctagsargs is a list, tagbar.vim takes care of
|
||||
escaping each argument in the list as required for the current
|
||||
'shell' type.
|
||||
|
||||
When the value of ctagsargs is a string, it must be properly
|
||||
escaped (if required by the current shell type). The reason
|
||||
tagbar.vim does not attempt to escape the string in this case is
|
||||
because if there is a space, it is ambiguous as to whether the
|
||||
space is delimiting an argument or included in the argument. To
|
||||
avoid this amiguity, tagbar.vim expects the string to be already
|
||||
escaped as required.
|
||||
|
||||
If special escaping is required for different OS shell types or if
|
||||
in doubt, then it is recommended to define ctagsargs with a List.
|
||||
|
||||
|
||||
You then have to assign this dictionary to a variable in your vimrc with the
|
||||
name
|
||||
@@ -961,6 +1169,30 @@ LaTeX parser that works better than the example configuration presented here.
|
||||
So if you are using a development build newer than that or a stable version
|
||||
newer than 5.8 you should use the built-in support instead of this example.
|
||||
|
||||
Project-specific configuration~
|
||||
|
||||
In addition to the normal global configuration it is also possible to have
|
||||
project-specific settings. This is mostly useful for additional ctags options,
|
||||
like for example macros to ignore. Or maybe you want to do things like folding
|
||||
certain tag kinds in some projects.
|
||||
|
||||
In order to use this feature you need to create User |autocommand|s in an
|
||||
augroup called "TagbarProjects" and have it create a buffer-local variable
|
||||
called "b:tagbar_type". This variable has to hold a type definition just like
|
||||
the normal ones described in this chapter. This definition will then be
|
||||
applied only to the files matched by the autocommand.
|
||||
|
||||
Note that there can be multiple definitions of the augroup with their own
|
||||
autocommands (for example in separate project directories); they will get
|
||||
merged automatically by Vim.
|
||||
|
||||
Example:
|
||||
>
|
||||
augroup TagbarProjects
|
||||
autocmd User ~/myproject/*.c let b:tagbar_type = {'deffile' : '~/myproject/ctags.cnf'}
|
||||
augroup END
|
||||
<
|
||||
|
||||
Writing your own tag-generating program~
|
||||
If you want to write your own program for generating tags then here are some
|
||||
imporant tips to get it to integrate well with Tagbar:
|
||||
@@ -973,10 +1205,11 @@ imporant tips to get it to integrate well with Tagbar:
|
||||
(stdout), it doesn't generate files and reads them in after that. So make
|
||||
sure that your program has an option to output the tags on stdout.
|
||||
- Some fields are supported for providing additional information about a
|
||||
tag. One field is required: the "kind" field as a single letter without
|
||||
a "kind:" fieldname. This field has to be the first one in the list. All
|
||||
other fields need to have a fieldname in order to determine what they are.
|
||||
The following fields are supported for all filetypes:
|
||||
tag. One field is required: the "kind" field as a single letter, either
|
||||
with or without a "kind:" fieldname. If it is used without the fieldname
|
||||
then it has to be the first field in the list. All other fields need to
|
||||
have a fieldname in order to determine what they are. The following fields
|
||||
are supported for all filetypes:
|
||||
|
||||
* line: The line number of the tag.
|
||||
* column: The column number of the tag.
|
||||
@@ -1008,12 +1241,27 @@ ctags manually execute the following command in a terminal:
|
||||
If you set the |g:tagbar_ctags_bin| variable you probably have to use the same
|
||||
value here instead of simply "ctags".
|
||||
|
||||
If Tagbar doesn't seem to work at all, but you don't get any error messages,
|
||||
you can use Tagbar's debug mode to try to find the source of the problem (see
|
||||
|tagbar-commands| on how to invoke it). In that case you should especially pay
|
||||
attention to the reported file type and the ctags command line in the log
|
||||
file.
|
||||
If something more fundamental isn't working right then try running the
|
||||
|:messages| command to see if Tagbar printed any error messages that might
|
||||
have been missed.
|
||||
|
||||
If the bug does seem to be in Tagbar then you can use Tagbar's debug mode to
|
||||
try to find the source of the problem. Usually you would use it like this:
|
||||
|
||||
1. Open Vim without loading any files.
|
||||
2. Run :TagbarDebug.
|
||||
3. Open the file you are having problems with.
|
||||
4. Open Tagbar. If the problem is with the statusline functionality this
|
||||
step may not be necessary.
|
||||
5. Exit Vim.
|
||||
|
||||
This should leave a file called "tagbardebug.log" in the current directory.
|
||||
See |tagbar-commands| for more information on the debug commands. When you
|
||||
look at the file you should especially pay attention to the reported file type
|
||||
and the ctags command line in the log file.
|
||||
|
||||
|
||||
Known issues~
|
||||
|
||||
- jsctags has to be newer than 2011-01-06 since it needs the "-f" option to
|
||||
work. Also, the output of jsctags seems to be a bit unreliable at the
|
||||
@@ -1067,6 +1315,27 @@ file.
|
||||
==============================================================================
|
||||
8. History *tagbar-history*
|
||||
|
||||
2.6.1 (2014-01-23)
|
||||
- Automatically close the preview window when jumping to a tag
|
||||
- Don't forget the previous window in certain situations, which was
|
||||
causing problems with for example fugitive
|
||||
- Fixed toggling kind-specific folds
|
||||
- Fixed ctags error that can happen with Cygwin
|
||||
|
||||
2.6 (2013-12-06)
|
||||
- Added possibility to show tags in the preview window, either manually or
|
||||
automatically.
|
||||
- Allow customizing the statusline, see :help g:tagbar_status_func.
|
||||
- Type configuration can now be project-specific.
|
||||
- The keybindings in the Tagbar window are now configurable.
|
||||
- Improvements to Ctags execution on Windows, thanks to Darcy Parker.
|
||||
- Added function tagbar#currentfile() that returns the path to the file
|
||||
currently being displayed in Tagbar, thanks to Zhao Cai.
|
||||
- Added a :Tagbar command as an alias for :TagbarToggle.
|
||||
- Added an way to ignore specific files in case they create problems.
|
||||
- Optionally show line numbers in the Tagbar window.
|
||||
- The usual bunch of small improvements and bugfixes.
|
||||
|
||||
2.5 (2013-03-25)
|
||||
- New command :TagbarTogglePause to freeze Tagbar in its current state so
|
||||
you can switch to other files while keeping the old information
|
||||
@@ -1219,11 +1488,18 @@ software.
|
||||
The folding technique was inspired by NERDTree by Martin Grenfell.
|
||||
|
||||
Thanks to the following people for code contributions, feature suggestions etc:
|
||||
Peter Butkovic
|
||||
Zhao Cai
|
||||
Jan Christoph Ebersbach
|
||||
Vadim Fint
|
||||
Leandro Freitas
|
||||
Ingo Karkat
|
||||
Audrius KaĹľukauskas
|
||||
Michael McClimon
|
||||
Seth Milliken
|
||||
Kien N
|
||||
Darcy Parker
|
||||
fritzophrenic
|
||||
pielgrzym
|
||||
Taybin Rutkin
|
||||
Kian Ryan
|
||||
|
||||
+70
-49
@@ -4,7 +4,7 @@
|
||||
" Author: Jan Larres <jan@majutsushi.net>
|
||||
" Licence: Vim licence
|
||||
" Website: http://majutsushi.github.com/tagbar/
|
||||
" Version: 2.5
|
||||
" Version: 2.6.1
|
||||
" Note: This plugin was heavily inspired by the 'Taglist' plugin by
|
||||
" Yegappan Lakshmanan and uses a small amount of code from it.
|
||||
"
|
||||
@@ -42,49 +42,45 @@ if v:version == 700 && !has('patch167')
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('g:tagbar_left')
|
||||
let g:tagbar_left = 0
|
||||
endif
|
||||
function! s:init_var(var, value) abort
|
||||
if !exists('g:tagbar_' . a:var)
|
||||
execute 'let g:tagbar_' . a:var . ' = ' . string(a:value)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
if !exists('g:tagbar_width')
|
||||
let g:tagbar_width = 40
|
||||
endif
|
||||
function! s:setup_options() abort
|
||||
if !exists('g:tagbar_vertical') || g:tagbar_vertical == 0
|
||||
let previewwin_pos = 'topleft'
|
||||
else
|
||||
let previewwin_pos = 'rightbelow vertical'
|
||||
endif
|
||||
let options = [
|
||||
\ ['autoclose', 0],
|
||||
\ ['autofocus', 0],
|
||||
\ ['autopreview', 0],
|
||||
\ ['autoshowtag', 0],
|
||||
\ ['compact', 0],
|
||||
\ ['expand', 0],
|
||||
\ ['foldlevel', 99],
|
||||
\ ['hide_nonpublic', 0],
|
||||
\ ['indent', 2],
|
||||
\ ['left', 0],
|
||||
\ ['previewwin_pos', previewwin_pos],
|
||||
\ ['show_visibility', 1],
|
||||
\ ['show_linenumbers', 0],
|
||||
\ ['singleclick', 0],
|
||||
\ ['sort', 1],
|
||||
\ ['systemenc', &encoding],
|
||||
\ ['vertical', 0],
|
||||
\ ['width', 40],
|
||||
\ ['zoomwidth', 1],
|
||||
\ ]
|
||||
|
||||
if !exists('g:tagbar_autoclose')
|
||||
let g:tagbar_autoclose = 0
|
||||
endif
|
||||
|
||||
if !exists('g:tagbar_autofocus')
|
||||
let g:tagbar_autofocus = 0
|
||||
endif
|
||||
|
||||
if !exists('g:tagbar_sort')
|
||||
let g:tagbar_sort = 1
|
||||
endif
|
||||
|
||||
if !exists('g:tagbar_compact')
|
||||
let g:tagbar_compact = 0
|
||||
endif
|
||||
|
||||
if !exists('g:tagbar_indent')
|
||||
let g:tagbar_indent = 2
|
||||
endif
|
||||
|
||||
if !exists('g:tagbar_show_visibility')
|
||||
let g:tagbar_show_visibility = 1
|
||||
endif
|
||||
|
||||
if !exists('g:tagbar_expand')
|
||||
let g:tagbar_expand = 0
|
||||
endif
|
||||
|
||||
if !exists('g:tagbar_singleclick')
|
||||
let g:tagbar_singleclick = 0
|
||||
endif
|
||||
|
||||
if !exists('g:tagbar_foldlevel')
|
||||
let g:tagbar_foldlevel = 99
|
||||
endif
|
||||
for [opt, val] in options
|
||||
call s:init_var(opt, val)
|
||||
endfor
|
||||
endfunction
|
||||
call s:setup_options()
|
||||
|
||||
if !exists('g:tagbar_iconchars')
|
||||
if has('multi_byte') && has('unix') && &encoding == 'utf-8' &&
|
||||
@@ -95,13 +91,37 @@ if !exists('g:tagbar_iconchars')
|
||||
endif
|
||||
endif
|
||||
|
||||
if !exists('g:tagbar_autoshowtag')
|
||||
let g:tagbar_autoshowtag = 0
|
||||
endif
|
||||
function! s:setup_keymaps() abort
|
||||
let keymaps = [
|
||||
\ ['jump', '<CR>'],
|
||||
\ ['preview', 'p'],
|
||||
\ ['previewwin', 'P'],
|
||||
\ ['nexttag', '<C-N>'],
|
||||
\ ['prevtag', '<C-P>'],
|
||||
\ ['showproto', '<Space>'],
|
||||
\ ['hidenonpublic', 'v'],
|
||||
\
|
||||
\ ['openfold', ['+', '<kPlus>', 'zo']],
|
||||
\ ['closefold', ['-', '<kMinus>', 'zc']],
|
||||
\ ['togglefold', ['o', 'za']],
|
||||
\ ['openallfolds', ['*', '<kMultiply>', 'zR']],
|
||||
\ ['closeallfolds', ['=', 'zM']],
|
||||
\ ['nextfold', 'zj'],
|
||||
\ ['prevfold', 'zk'],
|
||||
\
|
||||
\ ['togglesort', 's'],
|
||||
\ ['toggleautoclose', 'c'],
|
||||
\ ['zoomwin', 'x'],
|
||||
\ ['close', 'q'],
|
||||
\ ['help', ['<F1>', '?']],
|
||||
\ ]
|
||||
|
||||
if !exists('g:tagbar_systemenc')
|
||||
let g:tagbar_systemenc = &encoding
|
||||
endif
|
||||
for [map, key] in keymaps
|
||||
call s:init_var('map_' . map, key)
|
||||
unlet key
|
||||
endfor
|
||||
endfunction
|
||||
call s:setup_keymaps()
|
||||
|
||||
augroup TagbarSession
|
||||
autocmd!
|
||||
@@ -109,6 +129,7 @@ augroup TagbarSession
|
||||
augroup END
|
||||
|
||||
" Commands {{{1
|
||||
command! -nargs=0 Tagbar call tagbar#ToggleWindow()
|
||||
command! -nargs=0 TagbarToggle call tagbar#ToggleWindow()
|
||||
command! -nargs=? TagbarOpen call tagbar#OpenWindow(<f-args>)
|
||||
command! -nargs=0 TagbarOpenAutoClose call tagbar#OpenWindow('fcj')
|
||||
@@ -119,7 +140,7 @@ command! -nargs=? TagbarCurrentTag echo tagbar#currenttag('%s', 'No current t
|
||||
command! -nargs=1 TagbarGetTypeConfig call tagbar#gettypeconfig(<f-args>)
|
||||
command! -nargs=? TagbarDebug call tagbar#StartDebug(<f-args>)
|
||||
command! -nargs=0 TagbarDebugEnd call tagbar#StopDebug()
|
||||
command! -nargs=0 TagbarTogglePause call tagbar#PauseAutocommands()
|
||||
command! -nargs=0 TagbarTogglePause call tagbar#toggle_pause()
|
||||
|
||||
" Modeline {{{1
|
||||
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
|
||||
|
||||
+16
-19
@@ -3,48 +3,45 @@
|
||||
" Author: Jan Larres <jan@majutsushi.net>
|
||||
" Licence: Vim licence
|
||||
" Website: http://majutsushi.github.com/tagbar/
|
||||
" Version: 2.5
|
||||
" Version: 2.6.1
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:ic = g:tagbar_iconchars[0]
|
||||
if s:ic =~ '[]^\\-]'
|
||||
let s:ic = '\' . s:ic
|
||||
endif
|
||||
let s:io = g:tagbar_iconchars[1]
|
||||
if s:io =~ '[]^\\-]'
|
||||
let s:io = '\' . s:io
|
||||
endif
|
||||
|
||||
let s:pattern = '\([' . s:ic . s:io . '] \?\)\@<=[^-+: ]\+[^:]\+$'
|
||||
let s:ics = escape(join(g:tagbar_iconchars, ''), ']^\-')
|
||||
let s:pattern = '\(^[' . s:ics . '] \?\)\@<=[^-+: ]\+[^:]\+$'
|
||||
execute "syntax match TagbarKind '" . s:pattern . "'"
|
||||
|
||||
let s:pattern = '\([' . s:ic . s:io . '][-+# ]\?\)\@<=[^*(]\+\(\*\?\(([^)]\+)\)\? :\)\@='
|
||||
let s:pattern = '\(\S\@<![' . s:ics . '][-+# ]\?\)\@<=[^*(]\+\(\*\?\(([^)]\+)\)\? :\)\@='
|
||||
execute "syntax match TagbarScope '" . s:pattern . "'"
|
||||
|
||||
let s:pattern = '[' . s:ic . s:io . ']\([-+# ]\?\)\@='
|
||||
let s:pattern = '\S\@<![' . s:ics . ']\([-+# ]\?\)\@='
|
||||
execute "syntax match TagbarFoldIcon '" . s:pattern . "'"
|
||||
|
||||
let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=+\([^-+# ]\)\@='
|
||||
let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=+\([^-+# ]\)\@='
|
||||
execute "syntax match TagbarVisibilityPublic '" . s:pattern . "'"
|
||||
let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=#\([^-+# ]\)\@='
|
||||
let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=#\([^-+# ]\)\@='
|
||||
execute "syntax match TagbarVisibilityProtected '" . s:pattern . "'"
|
||||
let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=-\([^-+# ]\)\@='
|
||||
let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=-\([^-+# ]\)\@='
|
||||
execute "syntax match TagbarVisibilityPrivate '" . s:pattern . "'"
|
||||
|
||||
unlet s:pattern
|
||||
|
||||
syntax match TagbarHelp '^".*' contains=TagbarHelpKey,TagbarHelpTitle
|
||||
syntax match TagbarHelpKey '" \zs.*\ze:' contained
|
||||
syntax match TagbarHelpTitle '" \zs-\+ \w\+ -\+' contained
|
||||
|
||||
syntax match TagbarNestedKind '^\s\+\[[^]]\+\]$'
|
||||
syntax match TagbarComment '^".*'
|
||||
syntax match TagbarType ' : \zs.*'
|
||||
syntax match TagbarSignature '(.*)'
|
||||
syntax match TagbarPseudoID '\*\ze :'
|
||||
|
||||
highlight default link TagbarComment Comment
|
||||
highlight default link TagbarHelp Comment
|
||||
highlight default link TagbarHelpKey Identifier
|
||||
highlight default link TagbarHelpTitle PreProc
|
||||
highlight default link TagbarKind Identifier
|
||||
highlight default link TagbarNestedKind TagbarKind
|
||||
highlight default link TagbarScope Title
|
||||
|
||||
Reference in New Issue
Block a user