1
0
mirror of https://github.com/gryf/tagbar.git synced 2026-05-11 00:42:59 +02:00

67 Commits

Author SHA1 Message Date
gryf 7404b43c62 Display the kind (type) of the tag on the status bar
Using different method than the first attempt.
2016-02-14 17:09:00 +01:00
gryf 8d8550cf5d Display the kind (type) of the tag on the status bar.
Besides the usual tag hierarchy, type of the tag would be provided.
2016-02-14 14:51:09 +01:00
Jan Larres 7b36c46d17 Change mentions of GNU ctags to BSD ctags 2015-06-19 11:42:35 +12:00
Jan Larres 91566e6c0b Merge pull request #274 from UmkaDK/universal-ctags
Fixed compatibility with Universal Ctags
2015-06-19 11:30:42 +12:00
Dmytro Konstantinov d01d7e7546 Fixed compatibility with Universal Ctags
This commit fixes tagbar compatibility issues with the
[universal-ctags](/universal-ctags/ctags), which is the most active and
consistently updated fork of the old exuberant ctags.
2015-06-11 11:31:08 +01:00
Jan Larres 399b75256a Merge pull request #264 from h3xx/master
Fix vim-airline: Suppress status-line output when executing shell
2015-05-10 18:40:25 +12:00
Dan Church 40be9a2e5f Suppress status-line output when executing shell
Failing to suppress output can cause problems in some environments,
especially if the shell command fails or does something else spooky.

Example where failing to suppress the shell command causes issues with
[vim-airline](https://github.com/bling/vim-airline) with the tagbar
extension enabled:

![](http://i.imgur.com/ciigs8C.png)

Here's another example:

![](http://i.imgur.com/cl96sI8.png)

Both were taken using uxterm in Linux.
2015-04-24 17:44:58 -05:00
Jan Larres c6b473f559 Handle wrong rtp more gracefully
If the runtimepath has been set incorrectly and the autoload file is
getting loaded by something, then the code won't be able to load the
"plugin" file. Print a warning message and stop loading the file instead
of throwing lots of errors.
2015-04-05 20:14:56 +12:00
Jan Larres 8a8e85436d Merge pull request #258 from michaeltanner/master
Adds CUDA support (identical to C++)
2015-04-05 19:30:24 +12:00
Jan Larres 1773059756 Mention :messages command in troubleshooting section 2015-04-05 18:56:08 +12:00
Jan Larres 3634e7ab4f Support 'kind' field with name, ref #254 2015-03-17 19:35:42 +13:00
Jan Larres eb392a4502 Check for fish instead of resetting shell unconditionally 2015-02-23 15:14:35 +13:00
Jan Larres a284cd0091 Always log ctags output when execution fails 2015-02-16 18:49:07 +13:00
Michael Tanner c21176d8da Adds CUDA support (identical to C++) 2015-02-08 21:27:38 +00:00
Jan Larres 00dfa82b00 Fix prefix for tags with both access and file fields 2015-02-02 16:30:10 +13:00
Yecheng Fu e62d3444e9 add '-' flag before static functions in c 2015-02-02 16:21:10 +13:00
Jan Larres 04bb728039 Replace help mapping in short help, closes #245 2015-01-26 12:37:53 +13:00
Jan Larres fcac7f2936 Don't try to jump to winnr 0, ref #244 2015-01-13 22:32:30 +13:00
Jan Larres bfc121dc38 Setup options and keymaps in functions to avoid global variables 2014-12-10 16:19:14 +13:00
Jan Larres 4fa15349c5 Small cleanups 2014-12-10 15:34:14 +13:00
Jan Larres f9c5f24576 Don't skip over closed folds with zk 2014-11-26 14:52:54 +13:00
Jan Larres a084e47eb4 Rephrase compatible programs a bit 2014-11-10 12:03:43 +13:00
Jan Larres df09799372 Add mappings for moving through folds, closes #224 2014-11-09 17:33:42 +13:00
Jan Larres f933907afa Add option to arrange Tagbar window vertically 2014-11-08 21:30:17 +13:00
Jan Larres 5283bc834a Reprocess files if filetype changes, closes #228 2014-11-02 17:44:38 +13:00
Jan Larres 5d1ae684a1 Better JavaScript ctags config, courtesy of David Fishburn 2014-10-28 16:49:16 +13:00
Jan Larres e1eec86934 Small doc fix 2014-10-27 22:39:31 +13:00
Jan Larres 5c33e09d68 Add simple inspect() debug function 2014-10-27 22:38:59 +13:00
Jan Larres 251c774431 Don't assume all types define 'ctagstype' 2014-10-27 22:37:17 +13:00
Jan Larres 37400d9950 Make errors less fatal, closes #215
Instead of using 'echoerr' and essentially breaking the plugin after
that problems are now reported as warnings with 'echomsg'. They will
also only be shown once for a particular problem.
2014-10-27 22:35:19 +13:00
Jan Larres 64e935fe58 Small preview window improvements, ref #161 2014-10-14 15:59:29 +13:00
Jan Larres b54d8d64f1 Handle unloaded buffers when getting prototype, closes #222 2014-10-14 11:19:08 +13:00
Jan Larres 76f16f891b Return pattern for prototype if linenr is not available, closes #219 2014-10-11 18:37:21 +13:00
Jan Larres 4e5e0ebe59 Small doc improvement for pause, closes #199 2014-10-11 17:11:55 +13:00
Jan Larres 032fd1fbb3 Reset 'shell' to improve compatibility 2014-10-09 11:31:19 +13:00
Jan Larres f3a369c31d Use prettier screenshots, just because. 2014-10-01 20:52:40 +13:00
Jan Larres f46ba1a41f Update README 2014-10-01 12:36:51 +13:00
Jan Larres 9ee516ee6f Fix typo 2014-08-23 19:44:45 +12:00
Jan Larres 59c9b7ce1c Don't skip over unmodifiable buffers, closes #213
Skipping over unmodifiable buffers when checking for Tagbar being the
last window got introduced in #117, but I don't think it is actually
necessary.
2014-06-25 18:43:09 +12:00
Jan Larres 5e392c1b8d Add inline help for toggleautoclose mapping 2014-06-25 17:58:36 +12:00
Jan Larres ca1c9ee2e2 Add mapping to toggle autoclose option
The current tagbar_autoclose state will be displayed in the statusline.
Also change the "hide nonpublic" flag to "v" to match the mapping and
properly document the statusline flags.
2014-06-25 17:52:43 +12:00
Jan Larres 9bf4fd99e4 Merge pull request #206 from hachibeeDI/fix/disable_appendmode
Make sure that ctags is not called in append mode
2014-05-02 16:29:09 +12:00
dogura a9ec78aa5b specify a option is disable append mode
Because append mode is not allow that to output result on stdout.
2014-05-01 14:33:31 +09:00
Jan Larres ae46cc025b Better mapping init, closes #203
If someone already has a function that includes "JumpToTag" in its name
then the current method of detecting whether mappings should be
initialized would fail. Use a buffer-local variable instead.
2014-04-05 19:09:09 +13:00
Jan Larres 87d0111bd3 Clarify debug instructions 2014-04-04 18:54:13 +13:00
Jan Larres 0181f1d0cd Log typeinfo of newly processed file 2014-04-04 18:37:47 +13:00
Jan Larres a5220adc9a Better fileinfo removal logging 2014-04-04 01:08:12 +13:00
Jan Larres fabae6a11d Log fileinfo removal 2014-04-04 01:01:53 +13:00
Jan Larres 2bc6e96ae4 Rename debug log function 2014-04-04 00:39:26 +13:00
Jan Larres 8a139e0576 Better timestamps 2014-04-04 00:31:27 +13:00
Jan Larres be46ee5988 Don't remove fileinfo on BufUnload
If 'hidden' is not set then BufUnload is called every time a buffer
would get hidden, removing the fileinfo. This causes unnecessary ctags
processing of files.
2014-04-01 00:53:18 +13:00
Jan Larres b2c5f0b928 Keep cursor on current tag when sorting, closes #200 2014-03-22 01:09:30 +13:00
Jan Larres 07b7e9b68e Add LICENSE file, closes #197 2014-03-21 13:54:30 +13:00
Jan Larres c251265edf Document common way to run debug command 2014-03-18 19:03:49 +13:00
Jan Larres fdceb4ea71 Add ? as help key, closes #194 2014-02-28 13:51:48 +13:00
Jan Larres 614b5b244f Change default hide_nonpublic mapping 2014-02-10 17:25:32 +13:00
Jan Larres 3fdefbaa47 Add documentation for hide_nonpublic
Also indicate in the statusline if non-public tags are currently hidden.
2014-02-10 17:10:43 +13:00
Jan Larres 368d37ed45 Allow hiding non-public tags, closes #186 2014-02-05 18:08:04 +13:00
Jan Larres 13d4cfcc2c Remove some duplication 2014-02-05 15:30:19 +13:00
Jan Larres 42ce2919a3 Allow configuring zoom, closes #189 2014-02-04 18:00:27 +13:00
Jan Larres 836a39af8f Jump to correct window even after opening preview window 2014-02-01 21:17:00 +13:00
Jan Larres 0ead3332a9 Extract GetFileWinnr() function 2014-02-01 20:49:11 +13:00
Jan Larres e872e67641 Version 2.6.1 2014-01-23 23:17:00 +13:00
Jan Larres b610fb2f5d Restore previous window, closes #190 2014-01-21 15:59:51 +13:00
Jan Larres ace45adc51 Don't let ctags sort tags, closes #187
Ctags seems to call an external 'sort' which can apparently fail in some
cases with Cygwin. Since we sort the tags ourselves anyway just disable
it.
2013-12-25 19:07:31 +13:00
Jan Larres 88d7464079 Close prevwin when jumping to tag, closes #184 2013-12-19 11:54:59 +13:00
Jan Larres dbc05b24a3 Fix getCurrent() call for kind headers, closes #185 2013-12-09 16:30:38 +13:00
6 changed files with 973 additions and 360 deletions
+82
View File
@@ -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.
+81 -11
View File
@@ -1,19 +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.io/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.
# Support for additional filetypes
## What Tagbar is not
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.
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).
# Important: If the file structure is displayed wrong
## Dependencies
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.
[Vim 7.0](http://www.vim.org/) (But see note below)
[Exuberant ctags 5.5](http://ctags.sourceforge.net/)
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!
## Installation
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
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
![screenshot1](https://i.imgur.com/Sf9Ls2r.png)
![screenshot2](https://i.imgur.com/n4bpPv3.png)
## License
Vim license, see LICENSE
## Maintainer
Jan Larres <[jan@majutsushi.net](mailto:jan@majutsushi.net)>
+620 -268
View File
File diff suppressed because it is too large Load Diff
+126 -33
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.6
Version: 2.6.1
==============================================================================
Contents *tagbar* *tagbar-contents*
@@ -108,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*
@@ -133,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
@@ -196,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
@@ -251,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
@@ -311,7 +311,7 @@ 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.
@@ -331,6 +331,9 @@ P Open the tag in a |preview-window|.
<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
@@ -343,8 +346,14 @@ o/za Toggle the fold under the cursor or the current one if there is
Map option: tagbar_map_openallfolds
=/zM Close all folds by setting foldlevel to 0.
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.
@@ -382,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
@@ -398,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:
>
@@ -490,6 +535,20 @@ 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
@@ -553,7 +612,7 @@ Default: 0
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 insided a closed fold,
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.
@@ -566,7 +625,7 @@ Example:
*g:tagbar_previewwin_pos*
g:tagbar_previewwin_pos~
Default: topleft
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
@@ -609,8 +668,8 @@ 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:
>
@@ -624,11 +683,13 @@ 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 three arguments:
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
@@ -637,9 +698,13 @@ error it is recommended to add an additional vararg to the signature (see
Here is an example that, when put into your vimrc, will emulate Tagbar's
default statusline:
>
function! TagbarStatusFunc(current, sort, fname, ...) abort
function! TagbarStatusFunc(current, sort, fname, flags, ...) abort
let colour = a:current ? '%#StatusLine#' : '%#StatusLineNC#'
return colour . '[' . a:sort . '] ' . a:fname
let flagstr = join(flags, '')
if flagstr != ''
let flagstr = '[' . flagstr . '] '
endif
return colour . '[' . sort . '] ' . flagstr . fname
endfunction
let g:tagbar_status_func = 'TagbarStatusFunc'
<
@@ -763,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] ','')}
@@ -1137,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.
@@ -1172,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
@@ -1231,6 +1315,13 @@ 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.
@@ -1403,10 +1494,12 @@ 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
+63 -47
View File
@@ -4,7 +4,7 @@
" Author: Jan Larres <jan@majutsushi.net>
" Licence: Vim licence
" Website: http://majutsushi.github.com/tagbar/
" Version: 2.6
" 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.
"
@@ -48,29 +48,39 @@ function! s:init_var(var, value) abort
endif
endfunction
let s:options = [
\ ['autoclose', 0],
\ ['autofocus', 0],
\ ['autopreview', 0],
\ ['autoshowtag', 0],
\ ['compact', 0],
\ ['expand', 0],
\ ['foldlevel', 99],
\ ['indent', 2],
\ ['left', 0],
\ ['previewwin_pos', 'topleft'],
\ ['show_visibility', 1],
\ ['show_linenumbers', 0],
\ ['singleclick', 0],
\ ['sort', 1],
\ ['systemenc', &encoding],
\ ['width', 40],
\ ]
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],
\ ]
for [opt, val] in s:options
call s:init_var(opt, val)
endfor
unlet s:options
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' &&
@@ -81,31 +91,37 @@ if !exists('g:tagbar_iconchars')
endif
endif
let s:keymaps = [
\ ['jump', '<CR>'],
\ ['preview', 'p'],
\ ['previewwin', 'P'],
\ ['nexttag', '<C-N>'],
\ ['prevtag', '<C-P>'],
\ ['showproto', '<Space>'],
\
\ ['openfold', ['+', '<kPlus>', 'zo']],
\ ['closefold', ['-', '<kMinus>', 'zc']],
\ ['togglefold', ['o', 'za']],
\ ['openallfolds', ['*', '<kMultiply>', 'zR']],
\ ['closeallfolds', ['=', 'zM']],
\
\ ['togglesort', 's'],
\ ['zoomwin', 'x'],
\ ['close', 'q'],
\ ['help', '<F1>'],
\ ]
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>', '?']],
\ ]
for [map, key] in s:keymaps
call s:init_var('map_' . map, key)
unlet key
endfor
unlet s:keymaps
for [map, key] in keymaps
call s:init_var('map_' . map, key)
unlet key
endfor
endfunction
call s:setup_keymaps()
augroup TagbarSession
autocmd!
+1 -1
View File
@@ -3,7 +3,7 @@
" Author: Jan Larres <jan@majutsushi.net>
" Licence: Vim licence
" Website: http://majutsushi.github.com/tagbar/
" Version: 2.6
" Version: 2.6.1
scriptencoding utf-8