1
0
mirror of https://github.com/gryf/tagbar.git synced 2026-05-10 16:32:58 +02:00

68 Commits

Author SHA1 Message Date
Jan Larres 81cfb3f903 Version 2.3 2011-12-24 18:14:54 +13:00
Jan Larres 49aa899098 Mention the wiki 2011-12-24 17:22:15 +13:00
Jan Larres 8e5ce3a3e5 Replace usearrows with iconchars 2011-12-22 18:06:48 +13:00
Jan Larres f9b50a1e95 Remove need to provide complete jsctags configuration if jsctags not in path 2011-12-21 20:33:31 +13:00
Jan Larres 9a2cf9756f Add convenience function for automatically opening Tagbar 2011-12-21 19:28:34 +13:00
Jan Larres a93bd87715 Extract some init steps into function 2011-12-21 17:03:12 +13:00
Jan Larres f3973b1817 Fix bug when scope field exists but is empty 2011-12-13 18:24:24 +13:00
Jan Larres 5461adc534 Skip comments in ctags output 2011-12-12 19:47:59 +13:00
Jan Larres 32d266a430 Add debugging functionality 2011-12-12 19:47:43 +13:00
Jan Larres 4cc123f3f2 Version 2.2 2011-11-26 17:45:08 +13:00
Jan Larres 81b16888fb Add simple info file 2011-11-25 22:48:02 +13:00
Jan Larres 5c50b77a5a Work around a statusline bug in Vim < 7.1.097 2011-11-25 19:50:48 +13:00
Jan Larres 4bc7555b80 Mention existing configurations 2011-11-25 16:26:13 +13:00
Jan Larres bccf3d3473 Update credits 2011-11-25 01:37:51 +13:00
Jan Larres 555be533a4 Display 'kind' headers inside of scopes 2011-11-24 19:22:31 +13:00
Jan Larres 20ff7303a6 Update tagbar when filetype changes 2011-11-24 01:27:54 +13:00
Jan Larres e9aa349d10 Make TagbarOpen command more flexible 2011-11-23 19:56:31 +13:00
Jan Larres c07e878249 Update on save for smaller files, closes #40 2011-11-17 22:17:59 +13:00
Jan Larres 7cc9789d63 Locally disable cursorline/column, closes #49 2011-11-15 18:29:54 +13:00
Jan Larres 960332efb1 Don't jump do the tagbar window on TagbarOpen if already open 2011-11-03 04:29:12 +13:00
Jan Larres 4c907e56c1 Set foldcolumn to 0 locally, closes #46 2011-10-23 02:23:58 +13:00
Jan Larres 4b8cc056bf Add .gitattributes file to avoid exporting superfluous files 2011-10-17 02:23:40 +13:00
Jan Larres f03011b955 Temporarily reset 'wildignore' when calling expand() 2011-10-15 18:48:29 +13:00
Jan Larres fef95d7167 Accept ctags development versions 2011-10-15 18:40:27 +13:00
Jan Larres 22b2329720 Always jump to previous window when closing tagbar, closes #44 2011-10-14 17:39:27 +13:00
Jan Larres 849fcbcd5a Simplify some wincmd calls 2011-10-14 17:33:52 +13:00
Jan Larres 7163f4e4fa Check for ctags in default locations of homebrew and macports 2011-10-03 01:57:33 +13:00
Jan Larres 9a6e21e44d Don't highlight the same tag again, closes #36 2011-10-02 22:39:39 +13:00
Jan Larres 3c075654d4 Update line info when jumping to a tag, closes #26 2011-08-14 18:11:54 +12:00
Jan Larres 3b389aed00 Ignore events when jumping to a tag and opening the window, closes #17 2011-07-16 22:14:46 +12:00
Jan Larres 96d0050ea4 Move some tests to autoload 2011-07-15 17:34:47 +12:00
Kien N 4920be4438 move basic init & autocmd back to plugin/ 2011-07-03 16:14:56 +07:00
Kien N 49ad69c41a Pass arguments to autoload/tagbar.vim 2011-06-29 04:09:52 +07:00
Kien N 889a0d5b88 Move most of script to autoload 2011-06-29 03:59:49 +07:00
Jan Larres d17c2dd227 Some improvements to the documentation 2011-06-24 14:47:26 +12:00
Jan Larres e979e9abcd Delete empty lines silently, closes #27 2011-06-24 12:37:01 +12:00
Jan Larres 5da16328b6 Check for out of sync configurations 2011-06-20 16:30:09 +12:00
Jan Larres e84efc3366 Also set scriptencoding in syntax file 2011-06-18 18:54:53 +12:00
Jan Larres 20ea53630b Add "scriptencoding" directive to avoid encoding issues 2011-06-18 18:46:04 +12:00
Jan Larres a0939108d2 Try to jump to the correct line after a file has been changed but not saved, closes #20 2011-06-18 18:10:44 +12:00
Jan Larres 58d16c1a62 Allow mouse clicks in insert mode, closes #21 2011-06-06 19:18:32 +12:00
Jan Larres 23e2f22b04 Merge pull request #19 from freitass/ignore-tags
Ignore /doc/tags
2011-06-05 23:55:56 -07:00
Jan Larres 7aa936dc9c Allow single-click for jumping to a tag, closes #16 2011-06-06 18:42:35 +12:00
Leandro Freitas 24344115b5 Ignore /doc/tags 2011-05-31 16:45:27 -03:00
Jan Larres 9d5af93a5b Version 2.1 2011-05-29 19:19:03 +12:00
Jan Larres 8662779deb Properly restore Tagbar after a session got loaded 2011-05-25 15:18:26 +12:00
Jan Larres 397e1741f8 Check version of exuberant ctags 2011-05-23 22:43:47 +12:00
Jan Larres 8cde134333 Return an empty string when encoding conversion fails 2011-05-22 17:23:11 +12:00
Jan Larres 5b819914b9 Test for Vim >= 7.0 2011-05-19 01:42:18 +12:00
Jan Larres 8d1ba9fc11 Clarify that type definitions have to be put into vimrc 2011-05-16 00:00:06 +12:00
Jan Larres cd188c6669 Locally reset foldmethod and foldexpr in case it's set to something expensive globally 2011-05-15 18:26:10 +12:00
Jan Larres e84eda8437 Ignore autocmds when printing just in case 2011-05-15 18:26:10 +12:00
Jan Larres 49c15b92d8 Properly resize window when pressing 'q', closes #15 2011-05-13 16:06:34 +12:00
Jan Larres 845754bdad Don't check ctags on each 'window open' 2011-05-12 20:50:14 +12:00
Jan Larres 7a06b1615f Make the ctags execution work in (hopefully) all cases under Windows 2011-05-09 23:40:07 +12:00
Jan Larres d8122efcc6 Extract ctags execution into separate function 2011-05-08 23:08:15 +12:00
Jan Larres e28eab7945 Explain some jsctags issues 2011-05-07 18:48:59 +12:00
Jan Larres c33b0409cd Check whether filetype detection is turned on 2011-05-07 18:13:00 +12:00
Jan Larres 1a77a1e9c6 Add additional ctags binary name 2011-05-07 18:06:29 +12:00
Jan Larres 804aa3b170 Small cleanup 2011-05-07 18:04:01 +12:00
Jan Larres 8b539ad91c Explicitly check for Exuberant Ctags 2011-05-07 18:02:03 +12:00
Jan Larres 33d5a5e84f Fix bug with empty filetype 2011-05-07 04:17:26 +12:00
Jan Larres eb10c1d05c Fix bug with subtypes not being properly recognized 2011-05-07 03:46:56 +12:00
Jan Larres 1916c55b7c Handle cases where 'encoding' is different from system encoding 2011-05-05 21:27:47 +12:00
Jan Larres 98fe5ec994 Make sure to jump to the correct buffer/window on tag jump 2011-04-27 15:48:07 +12:00
Jan Larres a76d07cfeb Version 2.0.1 2011-04-27 01:03:04 +12:00
Jan Larres 40d8edf505 Fix sorting bug when 'ignorecase' is set 2011-04-27 01:01:27 +12:00
Jan Larres 1f4713d4ab Typo 2011-04-26 23:46:10 +12:00
7 changed files with 3419 additions and 2622 deletions
+4
View File
@@ -0,0 +1,4 @@
.gitignore export-ignore
.gitattributes export-ignore
README export-ignore
.info export-ignore
+1
View File
@@ -0,0 +1 @@
/doc/tags
+2
View File
@@ -0,0 +1,2 @@
tagbar
3465
+3099
View File
File diff suppressed because it is too large Load Diff
+223 -57
View File
@@ -3,7 +3,7 @@
Author: Jan Larres <jan@majutsushi.net>
Licence: Vim licence, see |license|
Homepage: http://majutsushi.github.com/tagbar/
Version: 2.0
Version: 2.3
==============================================================================
Contents *tagbar* *tagbar-contents*
@@ -21,7 +21,7 @@ Contents *tagbar* *tagbar-contents*
Highlight colours ............. |tagbar-highlight|
Automatically opening Tagbar .. |tagbar-autoopen|
6. Extending Tagbar ................ |tagbar-extend|
7. Bugs and limitations ............ |tagbar-bugs|
7. Troubleshooting & Known issues .. |tagbar-issues|
8. History ......................... |tagbar-history|
9. Todo ............................ |tagbar-todo|
10. Credits ......................... |tagbar-credits|
@@ -113,6 +113,8 @@ 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.
==============================================================================
2. Requirements *tagbar-requirements*
@@ -223,9 +225,22 @@ displayed when the cursor stays on a tag for 'updatetime' milliseconds.
------------------------------------------------------------------------------
COMMANDS *tagbar-commands*
:TagbarOpen
Open the Tagbar if it is closed. In case it is already open jump to it.
:TagbarOpen [{flags}]
Open the Tagbar window if it is closed.
Additional behaviour can be specified with the optional {flags} argument.
It is a string which can contain these character flags:
'f' Jump to Tagbar window when opening (just as if |g:tagbar_autofocus|
were set to 1)
'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')
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
(unless |g:tagbar_autoclose| is set): >
:TagbarOpen fj
<
:TagbarClose
Close the Tagbar window if it is open.
@@ -233,11 +248,11 @@ COMMANDS *tagbar-commands*
Open the Tagbar window if it is closed or close it if it is open.
:TagbarOpenAutoClose
Open the Tagbar window and close it on tag selection, regardless of the
setting of |g:tagbar_autoclose|. If it was already open jump to it.
Open the Tagbar window, jump to it and close it on tag selection. This is
an alias for ":TagbarOpen fc".
:TagbarSetFoldlevel [number]
Set the foldlevel of the tags of the current file to [number]. The
:TagbarSetFoldlevel {number}
Set the foldlevel of the tags of the current file to {number}. The
foldlevel of tags in other files remains unaffected. Works in the same way
as 'foldlevel'.
@@ -245,10 +260,18 @@ COMMANDS *tagbar-commands*
Open the parent folds of the current tag in the file window as much as
needed for the tag to be visible in the Tagbar window.
:TagbarDebug [logfile]
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!
:TagbarDebugEnd
End debug mode, debug messages will no longer be written to the logfile.
------------------------------------------------------------------------------
KEY MAPPINGS *tagbar-keys*
These mappings are valid in the Tagbar window:
The following mappings are valid in the Tagbar window:
<F1> Display key mapping help.
<CR>/<Enter> Jump to the tag under the cursor. Doesn't work for pseudo-tags
@@ -256,7 +279,8 @@ These mappings are valid in the Tagbar window:
p Jump to the tag under the cursor, but stay in the Tagbar window.
<LeftMouse> When on a fold icon, open or close the fold depending on the
current state.
<2-LeftMouse> Same as <CR>.
<2-LeftMouse> Same as <CR>. See |g:tagbar_singleclick| if you want to use a
single- instead of a double-click.
<Space> Display the prototype of the current tag (i.e. the line defining
it) in the command line.
+/zo Open the fold under the cursor.
@@ -315,7 +339,7 @@ g:tagbar_autoclose~
Default: 0
If you set this option the Tagbar window will automatically close when you
jump to a tag.
jump to a tag. This implies |g:tagbar_autofocus|.
Example:
>
@@ -339,7 +363,9 @@ g:tagbar_sort~
Default: 1
If this option is set the tags are sorted according to their name. If it is
unset they are sorted according to their order in the source file.
unset they are sorted according to their order in the source file. Note that
in the second case Pseudo-tags are always sorted before normal tags of the
same kind since they don't have a real position in the file.
Example:
>
@@ -371,6 +397,18 @@ Example:
let g:tagbar_expand = 1
<
*g:tagbar_singleclick*
g:tagbar_singleclick~
Default: 0
If this option is set then a single- instead of a double-click is used to jump
to the tag definition.
Example:
>
let g:tagbar_singleclick = 1
<
*g:tagbar_foldlevel*
g:tagbar_foldlevel~
Default: 99
@@ -383,21 +421,22 @@ Example:
let g:tagbar_foldlevel = 2
<
*g:tagbar_usearrows*
g:tagbar_usearrows~
{Windows only}
Default: 0
*g:tagbar_iconchars*
g:tagbar_iconchars~
Tagbar can display nice Unicode arrows instead of +/- characters as fold icons.
However, Windows doesn't seem to be able to substitute in characters from
other fonts if the current font doesn't support them. This means that you have
to use a font that supports those arrows. Unfortunately there is no way to
detect whether specific characters are supported in the current font. So if
your font supports those arrows you have to set this option to make it work.
Since the display of the icons used to indicate open or closed folds depends
on the actual font used, different characters may be optimal for different
fonts. With this variable you can set the icons to characters of your liking.
The first character in the list specifies the icon to use for a closed fold,
and the second one for an open fold.
Example:
Examples (don't worry if some the characters aren't displayed correctly, just
choose other characters in that case):
>
let g:tagbar_usearrows = 1
let g:tagbar_iconchars = ['▶', '▼'] (default on Linux and Mac OS X)
let g:tagbar_iconchars = ['▾', '▸']
let g:tagbar_iconchars = ['▷', '◢']
let g:tagbar_iconchars = ['+', '-'] (default on Windows)
<
*g:tagbar_autoshowtag*
@@ -415,6 +454,37 @@ Example:
let g:tagbar_autoshowtag = 1
<
*g:tagbar_updateonsave_maxlines*
g:tagbar_updateonsave_maxlines~
Default: 5000
If the current file has fewer lines than the value of this variable, Tagbar
will update immediately after saving the file. If it is longer then the update
will only happen on the |CursorHold| event and when switching buffers (or
windows). This is to prevent the time it takes to save a large file from
becoming annoying in case you have a slow computer. If you have a fast
computer you can set it to a higher value.
Example:
>
let g:tagbar_updateonsave_maxlines = 10000
<
*g:tagbar_systemenc*
g:tagbar_systemenc~
Default: value of 'encoding'
This variable is for cases where the character encoding of your operating
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".
Example:
>
let g:tagbar_systemenc = 'cp936'
<
------------------------------------------------------------------------------
HIGHLIGHT COLOURS *tagbar-highlight*
@@ -427,6 +497,9 @@ TagbarComment
TagbarKind
The header of generic "kinds" like "functions" and "variables".
TagbarNestedKind
The "kind" headers in square brackets inside of scopes.
TagbarScope
Tags that define a scope like classes, structs etc.
@@ -464,19 +537,32 @@ See |:highlight| for more information.
------------------------------------------------------------------------------
AUTOMATICALLY OPENING TAGBAR *tagbar-autoopen*
If you want Tagbar to open automatically, for example on Vim startup or for
specific filetypes, there are various ways to do it. For example, to always
open Tagbar on Vim startup you can put this into your vimrc file:
>
autocmd VimEnter * nested TagbarOpen
<
If you want to have it start for specific filetypes put
>
TagbarOpen
<
into a corresponding filetype plugin (see |filetype-plugin|).
Since there are several different situations in which you might want to open
Tagbar automatically there is no single option to enable automatic opening.
Instead, autocommands can be used together with a convenience function that
opens Tagbar only if a supported file is open(ed).
Check out |autocmd.txt| if you want it to automatically open in more
If you want to open Tagbar automatically on Vim startup no matter what put
this into your vimrc:
>
autocmd VimEnter * nested :TagbarOpen
<
If you want to open it only if you're opening Vim with a supported file/files
use this instead:
>
autocmd VimEnter * nested :call tagbar#autoopen()
<
For opening Tagbar also if you open a supported file in an already running
Vim:
>
autocmd FileType * nested :call tagbar#autoopen()
<
And if you only want to open Tagbar only for specific filetypes, not for all
of the supported ones:
>
autocmd FileType c,cpp nested :TagbarOpen
<
Check out |autocmd.txt| if you want it to open automatically in more
complicated cases.
==============================================================================
@@ -484,7 +570,15 @@ complicated cases.
Tagbar has a flexible mechanism for extending the existing file type (i.e.
language) definitions. This can be used both to change the settings of the
existing types and to add completely new types.
existing types and to add completely new types. A complete configuration
consists of a type definition for Tagbar in your |vimrc| and optionally a
language definition for ctags in case you want to add a new language.
Before writing your own extension have a look at the wiki
(https://github.com/majutsushi/tagbar/wiki/Support-for-additional-filetypes)
or try googling for existing ones. If you do end up creating your own
extension please consider adding it to the wiki so that others will be able to
use it, too.
Every type definition in Tagbar is a dictionary with the following keys:
@@ -510,7 +604,7 @@ kinds: A list of the "language kinds" that should be listed in Tagbar,
< would list all the function definitions in a file under the header
"functions" and fold them.
sro: The scope resolution operator. For example, in C++ it is "::" and
in Java it is ".". If in doubt run ctags as shown above and check
in Java it is ".". If in doubt run ctags as shown below and check
the output.
kind2scope: A dictionary describing the mapping of tag kinds (in their
one-character representation) to the scopes their children will
@@ -527,8 +621,8 @@ kind2scope: A dictionary describing the mapping of tag kinds (in their
private:
int var;
};
< We then run ctags in the followin way: >
ctags -f - --format=2 --excmd=pattern --fields=nksazSmt --extra= test.cpp
< We then run ctags in the following way: >
ctags -f - --format=2 --excmd=pattern --extra= --fields=nksaSmt test.cpp
< Then the output for the variable "var" would look like this: >
var tmp.cpp /^ int var;$/;" kind:m line:11 class:Foo access:private
< This shows that the scope name for an entry in a C++ class is
@@ -566,21 +660,22 @@ deffile: The path to a file with additional ctags definitions (see the
ctagsbin: The path to a filetype-specific ctags-compatible program like
{optional} jsctags. Set it in the same way as |g:tagbar_ctags_bin|. jsctags is
used automatically if found in your $PATH and does not have to be
set in that case. If it is not in your path you have to provide the
complete configuration and use the "replace" key (see the
Tagbar source code for the suggested configuration).
set in that case. If it is not in your path you have to set this
key, the rest of the configuration should not be necessary (unless
you want to change something, of course).
ctagsargs: The arguments to be passed to the filetype-specific ctags program
{optional} (without the filename). Make sure you set an option that makes the
program output its data on stdout. Not used for the normal ctags
program.
You then have to assign this dictionary to a variable with the name
You then have to assign this dictionary to a variable in your vimrc with the
name
>
g:tagbar_type_{vim filetype}
<
For example, for C++ the name would be "g:tagbar_type_cpp". If you don't know
the vim file type run the following command:
the vim file type then run the following command:
>
:set filetype?
<
@@ -588,7 +683,8 @@ and vim will display the file type of the current buffer.
Example: C++~
Here is a complete example that shows the default configuration for C++ as
used in Tagbar.
used in Tagbar. This is just for illustration purposes since user
configurations will usually be less complicated.
>
let g:tagbar_type_cpp = {
\ 'ctagstype' : 'c++',
@@ -650,7 +746,7 @@ the order of enums and typedefs, you would do it like this:
\ ]
\ }
<
Compare with the complete example above to see the exact change.
Compare with the complete example above to see the difference.
Adding a definition for a new language/file type~
In order to be able to add a new language to Tagbar you first have to create a
@@ -730,14 +826,38 @@ Tagbar should now be able to show the sections and other tags from LaTeX
files.
==============================================================================
7. Bugs and limitations *tagbar-bugs*
7. Troubleshooting & Known issues *tagbar-issues*
As a general rule, if the tag information displayed by Tagbar is wrong (for
example, a method doesn't show up or is in the wrong place) you should first
try running ctags manually to see whether ctags reports the wrong information
or whether that information is correct and Tagbar does something wrong. To run
ctags manually execute the following command in a terminal:
>
ctags -f - --format=2 --excmd=pattern --extra= --fields=nksaSmt myfile
<
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.
- 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
moment (especially regarding line numbers), so if you notice some strange
behaviour with it please run it manually in a terminal to check whether
the bug is in jsctags or Tagbar.
- Nested pseudo-tags cannot be properly parsed since only the direct parent
scope of a tag gets assigned a type, the type of the grandparents is not
reported by ctags (assuming the grandparents don't have direct, real
children).
For example, if we have a C++ with the following content:
For example, if we have a C++ file with the following content:
>
foo::Bar::init()
{
@@ -778,10 +898,56 @@ files.
==============================================================================
8. History *tagbar-history*
2.3 (2011-12-24)
- Add a convenience function that allows more flexible ways to
automatically open Tagbar.
- Replace option tagbar_usearrows with tagbar_iconchars to allow custom
characters to be specified. This helps with fonts that don't display the
default characters properly.
- Remove the need to provide the complete jsctags configuration if jsctags
is not found in $PATH, now only the concrete path has to be specified.
- Add debugging functionality.
2.2 (2011-11-26)
- Small incompatible change: TagbarOpen now doesn't jump to the Tagbar
window anymore if it is already open. Use "TagbarOpen j" instead or see
its documentation for more options.
- Tags inside of scopes now have a header displaying their "kind".
- The Tagbar contents are now immediately updated on save for files
smaller than a configurable size.
- Tagbar can now be configured to jump to a tag with only a single-click
instead of a double-click.
- Most of the script has been moved to the |autoload| directory, so Vim
startup should be faster (thanks to Kien N).
- Jumping to tags should work most of the time even if the file has been
modified and not saved.
- If Ctags has been installed into the default location using Homebrew or
MacPorts it should now be found automatically.
- Several bugfixes.
2.1 (2011-05-29)
- Make Tagbar work in (hopefully) all cases under Windows
- Handle cases where 'encoding' is different from system encoding, for
example on a Chinese Windows with 'encoding' set to "utf-8" (see manual
for details in case it doesn't work out-of-the-box)
- Fixed a bug with the handling of subtypes like "python.django"
- If a session got saved with Tagbar open it now gets restored properly
- Locally reset foldmethod/foldexpr in case foldexpr got set to something
expensive globally
- Tagbar now tries hard to go to the correct window when jumping to a tag
- Explain some possible issues with the current jsctags version in the
manual
- Explicitly check for some possible configuration problems to be able to
give better feedback
- A few other small fixes
2.0.1 (2011-04-26)
- Fix sorting bug when 'ignorecase' is set
2.0 (2011-04-26)
- Folding now works correctly. Folds will be preserved when leaving the
Tagbar window and when switching between files. Also tag types can be
configured to be folded by default, which is usefult for things like
configured to be folded by default, which is useful for things like
includes and imports.
- DoctorJS/jsctags and other compatible programs are now supported.
- All of the highlight groups can now be overridden.
@@ -838,13 +1004,13 @@ software.
The folding technique was inspired by NERDTree by Martin Grenfell.
Taybin Rutkin:
- Contributed tagbar_autofocus option
Seth Milliken:
- Contributed folding keybindings that resemble the built-in ones
Thanks to the following people for feature suggestions etc: Jan Christoph
Ebersbach, pielgrzym
Thanks to the following people for code contributions, feature suggestions etc:
Jan Christoph Ebersbach
Leandro Freitas
Seth Milliken
Kien N
pielgrzym
Taybin Rutkin
==============================================================================
vim: tw=78 ts=8 sw=8 sts=8 noet ft=help
+46 -2524
View File
File diff suppressed because it is too large Load Diff
+44 -41
View File
@@ -3,58 +3,61 @@
" Author: Jan Larres <jan@majutsushi.net>
" Licence: Vim licence
" Website: http://majutsushi.github.com/tagbar/
" Version: 2.0
" Version: 2.3
scriptencoding utf-8
if exists("b:current_syntax")
finish
endif
if has('multi_byte') && has('unix') && &encoding == 'utf-8' &&
\ (empty(&termencoding) || &termencoding == 'utf-8')
syntax match TagbarKind '\([▶▼] \)\@<=[^-+: ]\+[^:]\+$'
syntax match TagbarScope '\([▶▼][-+# ]\)\@<=[^*]\+\(\*\?\(([^)]\+)\)\? :\)\@='
syntax match TagbarFoldIcon '[▶▼]\([-+# ]\)\@='
syntax match TagbarAccessPublic '\([▶▼ ]\)\@<=+\([^-+# ]\)\@='
syntax match TagbarAccessProtected '\([▶▼ ]\)\@<=#\([^-+# ]\)\@='
syntax match TagbarAccessPrivate '\([▶▼ ]\)\@<=-\([^-+# ]\)\@='
elseif has('multi_byte') && (has('win32') || has('win64')) && g:tagbar_usearrows
syntax match TagbarKind '\([▷◢] \)\@<=[^-+: ]\+[^:]\+$'
syntax match TagbarScope '\([▷◢][-+# ]\)\@<=[^*]\+\(\*\?\(([^)]\+)\)\? :\)\@='
syntax match TagbarFoldIcon '[▷◢]\([-+# ]\)\@='
syntax match TagbarAccessPublic '\([▷◢ ]\)\@<=+\([^-+# ]\)\@='
syntax match TagbarAccessProtected '\([▷◢ ]\)\@<=#\([^-+# ]\)\@='
syntax match TagbarAccessPrivate '\([▷◢ ]\)\@<=-\([^-+# ]\)\@='
else
syntax match TagbarKind '\([-+] \)\@<=[^-+: ]\+[^:]\+$'
syntax match TagbarScope '\([-+][-+# ]\)\@<=[^*]\+\(\*\?\(([^)]\+)\)\? :\)\@='
syntax match TagbarFoldIcon '[-+]\([-+# ]\)\@='
syntax match TagbarAccessPublic '\([-+ ]\)\@<=+\([^-+# ]\)\@='
syntax match TagbarAccessProtected '\([-+ ]\)\@<=#\([^-+# ]\)\@='
syntax match TagbarAccessPrivate '\([-+ ]\)\@<=-\([^-+# ]\)\@='
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
syntax match TagbarComment '^".*'
syntax match TagbarType ' : \zs.*'
syntax match TagbarSignature '(.*)'
syntax match TagbarPseudoID '\*\ze :'
let s:pattern = '\([' . s:ic . s:io . '] \)\@<=[^-+: ]\+[^:]\+$'
execute "syntax match TagbarKind '" . s:pattern . "'"
highlight default link TagbarComment Comment
highlight default link TagbarKind Identifier
highlight default link TagbarScope Title
highlight default link TagbarType Type
highlight default link TagbarSignature SpecialKey
highlight default link TagbarPseudoID NonText
highlight default link TagbarFoldIcon Statement
highlight default link TagbarHighlight Search
let s:pattern = '\([' . s:ic . s:io . '][-+# ]\)\@<=[^*]\+\(\*\?\(([^)]\+)\)\? :\)\@='
execute "syntax match TagbarScope '" . s:pattern . "'"
let s:pattern = '[' . s:ic . s:io . ']\([-+# ]\)\@='
execute "syntax match TagbarFoldIcon '" . s:pattern . "'"
let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=+\([^-+# ]\)\@='
execute "syntax match TagbarAccessPublic '" . s:pattern . "'"
let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=#\([^-+# ]\)\@='
execute "syntax match TagbarAccessProtected '" . s:pattern . "'"
let s:pattern = '\([' . s:ic . s:io . ' ]\)\@<=-\([^-+# ]\)\@='
execute "syntax match TagbarAccessPrivate '" . s:pattern . "'"
unlet s:pattern
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 TagbarKind Identifier
highlight default link TagbarNestedKind TagbarKind
highlight default link TagbarScope Title
highlight default link TagbarType Type
highlight default link TagbarSignature SpecialKey
highlight default link TagbarPseudoID NonText
highlight default link TagbarFoldIcon Statement
highlight default link TagbarHighlight Search
highlight default TagbarAccessPublic guifg=Green ctermfg=Green
highlight default TagbarAccessProtected guifg=Blue ctermfg=Blue
highlight default TagbarAccessPrivate guifg=Red ctermfg=Red
let b:current_syntax = "tagbar"
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1