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

61 Commits

Author SHA1 Message Date
Jan Larres 44ecd8d315 Fix for missing shellescape() in < 7.0.111 2014-10-04 18:40:53 +13:00
Jan Larres 5dfb7cc2ab Work around bug in Vim < 7.0.167 2011-11-26 18:07:02 +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 3371 additions and 2566 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
+3154
View File
File diff suppressed because it is too large Load Diff
+162 -30
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.2
==============================================================================
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'.
@@ -248,7 +263,7 @@ COMMANDS *tagbar-commands*
------------------------------------------------------------------------------
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 +271,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 +331,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 +355,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 +389,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
@@ -415,6 +445,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 +488,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.
@@ -484,7 +548,19 @@ 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 try googling for already existing ones. For
example, here is one for Scala:
http://latestbuild.net/scala-ctags-and-vim-tagbar
Since those aren't "canonical" configurations and are somewhat subjective they
probably won't be included in Tagbar, but it is easy enough to just copy&paste
them into your own setup. Note that you don't have to modify Tagbar directly
like the article suggests, you can just put the configuration into your
|vimrc| (see below for more details).
Every type definition in Tagbar is a dictionary with the following keys:
@@ -510,7 +586,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 +603,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
@@ -575,12 +651,13 @@ ctagsargs: The arguments to be passed to the filetype-specific ctags program
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 +665,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 +728,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 +808,32 @@ 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".
- 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 +874,46 @@ files.
==============================================================================
8. History *tagbar-history*
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 +970,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
+29 -2523
View File
File diff suppressed because it is too large Load Diff
+19 -13
View File
@@ -3,7 +3,9 @@
" Author: Jan Larres <jan@majutsushi.net>
" Licence: Vim licence
" Website: http://majutsushi.github.com/tagbar/
" Version: 2.0
" Version: 2.2
scriptencoding utf-8
if exists("b:current_syntax")
finish
@@ -39,22 +41,26 @@ else
syntax match TagbarAccessPrivate '\([-+ ]\)\@<=-\([^-+# ]\)\@='
endif
syntax match TagbarComment '^".*'
syntax match TagbarType ' : \zs.*'
syntax match TagbarSignature '(.*)'
syntax match TagbarPseudoID '\*\ze :'
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 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 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