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

705 Commits

Author SHA1 Message Date
Alexey Radkov 0243b19920 Allow autocmds in the host window when s:JumpToTag() leaves the tagbar (#820)
This fixes cursor splashing in wrong places when plugin
https://github.com/DanilaMihailov/beacon.nvim is enabled.
2022-06-09 09:03:47 -05:00
Han a577ee4d65 Add 'on' for mixin to dart tag map (#816) 2022-05-02 13:52:48 +03:00
Caleb Maclennan ccee72f1d1 Correct variable name in help docs, closes #809 2022-04-07 21:05:38 +03:00
David Hegland 2137c14370 Fixes #811, #799: Add language specific regex support for custom tag kinds (#812)
* Add language specific regex support for custom tag kinds

* Fix typo in example
2022-03-28 08:56:27 -05:00
zharmany 69659cfc9d Don't show errors when opening preview window (#810)
* Don't show errors when opening preview window (occurs when buffer has unsaved changes).

* Update autoload/tagbar.vim

Co-authored-by: David Hegland <darth.gerbil@gmail.com>

Co-authored-by: David Hegland <darth.gerbil@gmail.com>
2022-03-15 07:06:21 -05:00
Dexter Gaon-Shatford a0343f0090 Use tagbar_iconchars not present in emoji (#807) 2022-02-06 10:18:01 +03:00
Mark Woods 88242397b4 Only set ballooneval while in tagbar window (#805)
ballooneval is a global option, so setting it while initialising tagbar
permanently enables ballooneval functionality for the GUI, overriding
the vim default (disabled) or a user explicitly setting noballooneval.

To address this, only set ballooneval when entering the tagbar window,
and restore the original ballooneval setting when leaving the window.

This is not perfect, but there is precedent, Netrw behaves like this.
2022-01-20 10:51:39 -06:00
magras 3188ab1ee8 use g:tagbar_highlight_method as default in tagbar#currenttag and forward search method from :TagbarCurrentTag (#803)
* allow to specify {search-method} in :TagbarCurrentTag command

* tagbar#currenttag now uses g:tagbar_highlight_method as default search method
2022-01-11 10:41:32 -06:00
as 0441c1c6d9 Add support of TagbarOpen arguments for TagbarToggle (#800) 2021-12-08 16:49:40 -06:00
Fred Yeadon dd2f46af80 Add support for powershell (#798) 2021-11-27 00:52:28 +03:00
David Hegland 253b6f2628 Fix for #783 - set colorcolumn to empty string (default) for local tagbar window (#797) 2021-11-23 14:36:33 -06:00
Michael van der Kamp b6669c7c9d Clear old TagbarCleanupAutoCmds before redefining (#791) 2021-09-28 07:08:51 +03:00
Daniel J. Perry bb8ca482a5 Highlight key-map options in help file (#788)
Signed-off-by: Daniel J. Perry <dperry45@gatech.edu>
2021-08-24 09:16:57 -05:00
Damir Sharipov ab6f2d5a68 feature: Add basic Crystal support (#787) 2021-08-06 07:23:55 -05:00
David Hegland cd74f18d10 Add JumpToNearbyTag functionality (#780)
* Add JumpToNearbyTag functionality

Closes #779

Updated functions:

`s:GetNearbyTag()` - Allow for a direction parameter to be passed into
the routine. This will allow for a forward or backward search. It will
default to a backward search line the current behavior if the
`a:direction` parameter is not used.

`s:JumpToTag()` - Allow for an optional parameter to be passed in to
specify the tag instead of using the tag under the cursor on the current
line. This also allows this routine to be executed from the file window
instead of the tagbar window. Assume `autoclose=0` if passing in the tag.

Add new functions:

`s:JumpToNearbyTag()` - This routine will do a forward or backward search
for the nearst tag using the `GetNearbyTag()` with the new direction
field, then call the `JumpToTag()` with the tag we found.

`tagbar#jumpToNextTag()` - New public facing wrapper routine around the
`JumpToNearbyTag()` routine. Optionally take in `a:lnum` and
`a:search_method` to be used in other routines. If `a:lnum` is not
present, then the line number will search from the next or previous line
depending on the `a:direction` value.

TODO:
- [ ] Still need to write up the documentation for this.
- [ ] Possibly look at providing default keymap. Currently this can be
  done using a custom definition in `.vimrc`.

* Add documentation and fix lazy scroll

Added documentation for this feature
Corrected the lazy scroll behavior when the next/prev tag is visible
Use the existing `w:autoclose` if set, else default to 0.

* Fix argument ordering

Correct the argument ordering and numbering for the jumpToNearbyTag()
routine.
Add documentation example for the 'nearest' search-method.
Rename jumpToNextTag() to jumpToNearbyTag() to be more inline with the
other routines.

* remove debug

* Fix current line processing

In the event there is a tag on the immediately previous/next line, then
the GetNearbyTag will return that tag even if the scoped-stl
search-method is set.

* Cleanup optional argument initialization

* Update tagbar#jumpToNearbyTag() - remove lnum and add flags parameter

Changes to the tagbar#jumpToNearbyTag() routine to allow more
flexibility. Removing the optional lnum parameter as this likely will
not be needed and could actually cause confusion in its use. Add a flags
field so different options can be set such as the 's':'scroll_offset'
option.
2021-08-04 09:26:06 -05:00
David Hegland 23ea1961b9 Fix for #784 - add additional option for g:tagbar_wrap (#785)
Adding additional setting to `g:tagbar_wrap` to allow for more granular
control of the `linebreak` functionality. If set to 1, linebreak will
also be set. If set to 2, linebreak will be disabled.
2021-08-02 09:59:38 -05:00
David Hegland a0a5714910 Add ability to fold/unfold headers on <CR> in tagbar window (#781)
Closes #778

Add to the `JumpToTag()` routine so if the current line does not contain
a valid tag, then it will check if the line is foldable, and if so will
either call the `OpenFold()` or `CloseFold()` as necessary. This allows
the `<Enter>` key to be used to toggle a foldable header in the tagbar
window.
2021-07-27 08:01:05 -05:00
David Hegland 2da3443f5f Better handling for typeinfo.deffile (#777)
Closes #776

Change the ordering of the --options field when executing ctags. This
allows overrides of things like the --<lang>-kinds definitions to omit
certain kinds.

Also add check to ensure the typeinfo.deffile exists before attempting
to use it in the ctags arguments.
2021-06-24 09:37:26 -05:00
David Hegland 285afffc47 Fix perl definitions (#775)
Closes #774
2021-06-23 07:39:14 -05:00
David Hegland 225e6530c2 Fix for #750 to cleanup files once tagbar window closed (#769)
Fixes #750

Once the tagbar window is opened and a file is registered, that file
stays in memory even if the tagbar window is closed. This allows tagbar
to cache the info so if the tagbar window is opened again, it doesn't
have to rescan the file and rerun ctags on the file.

However if this buffer is wiped out using `:bwipe <file>`, then the
buffer is completely unloaded from vim memory and also needs to be
unloaded from tagbar memory. This works if the tagbar window is open,
but in the event the tagbar window is closed, all autocmds are
unregistered, so tagbar never gets the BufWipeout notification. This
results in tagbar leaving the buffer in active memory even though the
buffer doesn't exist anymore.

This fix will leave the BufWipeout and BufDelete autocmds active even if
the tagbar window is closed. This allows the buffer cleanup to occur on
a `:bwipe` command even if the tagbar window is closed.
2021-05-27 09:33:59 -05:00
Caleb Maclennan 19c0078f76 Merge pull request #767 from preservim/contributors 2021-05-25 10:38:07 +03:00
David Hegland 84afd8e802 Remove open buffer from known files on bdelete or bwipe (#768)
Closes #750

On `:bdelete` or `:bwipe` of a file, remove the file from the known file
listing even if the tagbar window is not open. Previously was only
removing the file if the tagbar window was open.
2021-05-24 09:28:01 -05:00
Caleb Maclennan 4265c61aa1 Include Paypal link to tip @raven42 in sponsor config 2021-05-21 18:47:56 +03:00
Caleb Maclennan 0e832c54a6 Callout @raven42 as active maintainer 2021-05-21 18:47:19 +03:00
Caleb Maclennan 1919ee66df Update ballpark contributor count 2021-05-21 15:59:38 +03:00
Caleb Maclennan 3fa6c4e266 Add GitHub funding spec, add Caleb's preferred tipping channels 2021-05-21 15:58:36 +03:00
prizelk fd4bc0f0e4 Add html tags (#763)
* Added html tags in uctags.vim

* Added html tags in uctags.vim
2021-05-17 07:20:51 -05:00
Stefan Huber bafd7c51e0 README: Name the recommended ctags impl first (#761)
Clearly steer users away from Exuberant Ctags and be more explicit that
it is less well supported and will be deprecated. Rephrase sentence on
additional providers because an exemplary enumeration (such as) does not
redundantly need to add (or others).
2021-05-15 23:03:12 +03:00
Henrik Holst f6012cb65d Improve Markdown and add reStructured text support (#756)
Closes #754

Co-authored-by: Henrik Holst <hholst80@users.noreply.github.com>
2021-03-23 13:47:06 +03:00
Caleb Maclennan 51ff7a0540 Fix CI runs to actually run nvim instead of just claiming to (#616)
* Actually run CI tests using Neovim instead of just pretending

* Overhaul CI check workflow
2021-02-18 10:20:33 +03:00
Caleb Maclennan ac8eafc9c0 Overhaul CI check workflow 2021-02-18 10:17:16 +03:00
Caleb Maclennan 83c573c0ec Actually run CI tests using Neovim instead of just pretending 2021-02-18 10:08:43 +03:00
沈育霖 45581e021c Add new language: CMake (#747) 2021-02-18 09:08:44 +03:00
Caleb Maclennan 77d7ddd683 Split PR review from branch check workflows 2021-02-18 09:01:03 +03:00
Mukund Mauji 2fb3171ed7 Fix incorrect example for g:tagbar_status_func (#752) 2021-02-12 12:24:27 -06:00
Vivian De Smedt 7e8aeb6970 Use utf8 encoding to read ctags output, fixes #748 (#749)
Co-authored-by: Vivian De Smedt <Vivian.De-Smedt@tatasteeleurope.com>
2021-02-01 08:12:54 +03:00
Linwei 7a968502d7 Fix CJK character decoding problem (#745) 2021-01-25 07:12:19 +03:00
Caleb Maclennan 16f3f9b77b Accommodate packagers with tagged release; using HEAD still recommended 2021-01-21 07:54:15 +03:00
raven42 59eef1364d Correct the name to properly escape out any special chars for the substitution (#740) 2021-01-15 06:14:27 -06:00
lasorda a52610c009 add a new language (#738)
* Update ctags.vim

* update uctags.vim with lpc
2021-01-14 08:30:49 -06:00
沈育霖 c7e7d5e565 Escape special characters in pattern searching (#737) 2021-01-12 20:45:53 +03:00
raven42 e6e6582739 Add g:tagbar_no_autocmds option to disable almost all autocmds (#688)
* Closed #578 - Add `g:tagbar_no_autocmds` option to disable almost all autocommands

* Rework to be more streamlined
2021-01-12 07:41:38 -06:00
Valter Sundström 2a36ad79a7 Add TagbarJump (#515)
Co-authored-by: Sundström Valter <mail@valter.nu>
Co-authored-by: David Hegland <david.hegland@broadcom.com>
2021-01-12 07:41:44 +03:00
pacien 6f02f1f852 Add g:tagbar_highlight_follow_insert option (#725)
This adds an option making the highlight in the Tagbar follow the cursor
in insert mode as well. This feature is guarded behind an option because
it may introduce some delay in the input.

GitHub: closes #724
2021-01-11 07:24:49 -06:00
沈育霖 778d41f437 Improve tag highlighting and signature matching (#735)
1. Correctly highlight tags that contain spaces.
2. Match function signature on special case: operator()(...).
2021-01-11 07:23:42 -06:00
沈育霖 978e1fe761 Fix the problem that the data type was unexpectedly displayed in the C++ destructor's tag. (#734)
* Fix the problem that the data type was unexpectedly displayed in the C++ destructor's tag.

* Update autoload/tagbar/prototypes/normaltag.vim

Co-authored-by: Caleb Maclennan <caleb@alerque.com>
2021-01-07 07:31:45 -06:00
raven42 4c1a1a1bc6 Use universal_newlines for Popen call (#733)
Closes #629
2021-01-06 07:34:09 -06:00
raven42 f8e8f8cfb4 Add support for frames kind in tex file definition (#730)
Closes #654
2021-01-06 15:25:57 +03:00
raven42 5dd1102552 Add support for kotlin type (#731)
Closes #632

Support for kotlin type was recently added into universal ctags
(https://github.com/universal-ctags/ctags/pull/2769)

Currently there is no scope information in the ctags definition. So the
`scope2kind` and `kind2scope` settings are not functional. If support is
added, then these definitions can be updated to include that info.

Note: these kind definitions are based on the output from `ctags
--list-kinds=kotlin` which is slightly different than the definitions
provided in #632. So this may not be fully compatible with the custom
ctags configuration from that issue. The default definition for
univercal ctags should be used instead.
2021-01-06 15:25:33 +03:00
raven42 52ec4e03f3 Feature Request: Ignore anonymous option (#727)
Closes #726

New option `g:tagbar_ignore_anonymous` to ignore any tags with __anon in
the tag name. CTAGS will print any unlabeled tags with the __anon###
name with a custom hash. This option will ignore those tags and they
will not be visible in the tagbar window. This could potentially result
in unknown behavior when a parent object has been ignored in this way.
However these tags should then fall under the default hierarchy for that
particular kind.
2021-01-06 15:24:33 +03:00
raven42 7cf83a4330 Check for tilde in cpp destructor (#732) 2021-01-06 15:24:14 +03:00
raven42 5f912e6ad0 Add tagbar#IsOpen() helper routine (#728)
Closes #717

Add a `tagbar#IsOpen()` helper routine to check if the tagbar window is open or not.
2021-01-06 15:23:55 +03:00
raven42 eaadf90b61 Add mapping for arduino filetypes (#722)
Closes #721
2020-12-21 13:25:16 -06:00
Caleb Maclennan b63e8cb83f Merge pull request #638 from jrc2139/dart-ctags 2020-11-30 21:31:45 +03:00
Pascal Bakker ed1bbe554d Use the same example hotkey in docs as in README.md (#712) 2020-11-23 12:55:24 +03:00
Chi Cao Minh 9b8619bab5 Fix typo in help (#711) 2020-11-20 11:20:11 +03:00
raven42 68a77323cb Add option for g:tagbar_highlight_method (#709)
* Add option for g:tagbar_highlight_current_tag

Closes #708

Add option for g:tagbar_highlight_current_tag which will allow
highlighting of tags on the current line in addition to highlighting the
scoped tags. Reverts the behavior added in #638 to the default from
before that commit

* Rework to allow direct configuration of highlight method

* Address review comments
2020-11-13 07:29:07 -06:00
David P. Sicilia 6eadc15054 Add g:tagbar_jump_lazy_scroll option. (#705)
* Add g:tagbar_jump_lazy_scroll option.

When this option is on, a jump to a tag will only cause the
window to scroll if the tag line is not already visible on
the window.  If it is visible, the cursor will simply move
to that line without scrolling the window.  If the tagline
is not visible then the window will be scrolled as in current
behavior (according to the g:tagbar_jump_offset option).

Fixes #703

* Factor our new logic into a function.

* Add jump target line to doc.
2020-11-10 16:07:57 -06:00
raven42 10a4a9bc38 Add linenr protection into getPrototype (#707)
* Add linenr protection into getPrototype
Closes #706

Add protection to not go beyond the last line in the file when calling the `s:getPrototype()` routine. This occurs when there is an `=` character in the tag prototype. For example in a python tag with a parameter line this: `some_function(arg1, optional_arg_2=False)`

* Fix issue with python prototypes that can include `=` character in the argument list
2020-11-10 07:49:36 -06:00
raven42 53c8e19676 Cleanup the PrintHelp() routine (#702)
Closes #681
2020-11-03 11:33:33 +03:00
Caleb Maclennan 92e2a0c5a8 Merge pull request #701 from Shane-XB-Qian/master 2020-11-03 11:15:37 +03:00
shane.xb.qian 7261ab5f92 Update .gitignore 2020-11-03 11:12:13 +03:00
shane.xb.qian bd0c32242d Setup syntax highlighting group for tag line numbers 2020-11-03 11:12:13 +03:00
raven42 55b8ffa85c Scoped kinds (#696)
* Add support for scope
Closes #508, #516

Add --fields=e (end) to the ctags field types to look for the end of the scope.
Update the `s:GetNearbyTag()` routine to use this scope to look for the correct tag.

* Update comment to call out exuberant ctags not supporting the -e option

* Update autoload/tagbar.vim

Co-authored-by: Caleb Maclennan <caleb@alerque.com>

* Optimize nearesttag search, add option for scoped-stl search method

Co-authored-by: Caleb Maclennan <caleb@alerque.com>
2020-11-02 15:15:55 -06:00
raven42 601b5c0073 Add tag datatype (#698)
Closes #680

Add `g:tagbar_show_data_type` field to show the tag datatype next to the tag in the tagbar window
This uses the `--fields=t` field to get the datatype from ctags. If not found, then it will attempt to derive the datatype by extracting all the output from the `pattern` preceeding the tag name.

More testing is needed on other languages. So far this has been stable with C / C++ files parsing the datatype from ctags output. It has also been tested with Java files for the inferred datatype by parsing the pattern line and pulling out everything prior to the tag.
2020-11-02 15:06:40 -06:00
raven42 99c22f1bb2 Fix the scrolloff local setting in RenderKeepView (#697) 2020-10-30 23:56:36 +03:00
raven42 30b20fc87d Fix issue with tagbar changing the global scrolloff value. (#694)
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
2020-10-29 21:21:52 +03:00
raven42 d55c16e875 Add g:tagbar_jump_offset configuration (#695)
Closes #504

Add a new `g:tagbar_jump_offset` value which will control the tag jump location relative to the center of the screen.
2020-10-29 12:58:17 -05:00
raven42 00841836b4 Add g:tagbar_scrolloff configuration (#692)
* Add g:tagbar_scroll_offset configuration
Closes #564

Add option for `g:tagbar_scrolloff` to issue a `setlocal scrolloff=#` during tagbar window init

* Address review comments
2020-10-29 10:36:47 -05:00
raven42 7a54a7d4ae Document how to use relative sizes in g:tagbar_width (#689) 2020-10-28 22:24:17 +03:00
Shane-XB-Qian 8efec2509b shane: compact tag line# should be good enough if user set it (#687) 2020-10-28 10:17:50 -05:00
raven42 aa8c592201 Help visibility (#686)
Closes #410

Add `g:tagbar_help_visibility` option to always show the help dialog
2020-10-27 14:14:39 -05:00
raven42 469c4b3188 Add g:tagbar_show_tag_count option (#685)
* Add g:tagbar_show_tag_count option

Closes #290

This option will show the tag kind count next to the kind label in the
tagbar window.

* Address review comments
2020-10-27 09:18:30 -05:00
raven42 0d1c6442d9 Add option to print the tag linenumber in the tagbar window (#684)
* Add option to print the tag linenumber in the tagbar window

* Update documentation markup

* Change variable name to g:tagbar_show_tag_linenumbers to be more consistent with other variables

* Fix documentation
2020-10-27 08:37:33 -05:00
raven42 bc48b8b84b Scoped Highlighting (#683)
* Scoped highlighting fix
Attempt to change the scoped highlighting of the tagbar window. This
will now look only for 'stl' tag types when looking for the nearby tag
when looking to highlight. It does however take into account if the
cursor is on the same line as the tag and highlights it then as well.

* Add additional documentation

* Add documentation for tagbar#printfileinfo() debug routine
2020-10-26 10:19:14 -05:00
Shane-XB-Qian 2a9270cb24 sq: would mess if set key mapping to '' (#675)
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
2020-10-24 10:17:11 +03:00
raven42 c26bf78a61 Merge pull request #676 from raven42/unknown-kinds
Add protection for unknown kinds
2020-10-20 07:54:10 -05:00
raven42 877561b727 Merge pull request #677 from diegok/master
Add missing attributes and methods kinds on perl type #672
2020-10-20 07:53:49 -05:00
diegok 353701eb8c Undone changes on legacy exuberant-ctags types file 2020-10-20 12:01:37 +02:00
diegok f9012df43b Add missing attributes and methods kinds on perl type 2020-10-20 11:11:29 +02:00
raven42 34a95983ed Add protection for unknown kinds
Perform a has_key() check prior to referencing the dictionary to ensure
the dictionary has a valid key for the specified kind.
Note: When an unknown kind is found, it can mess up the tag highlighting
in the tagbar window. Not sure why this is occurring.
2020-10-19 12:16:36 -05:00
Caleb Maclennan 0838f3c101 Merge pull request #674 from maujim/feature/compact-option 2020-10-16 22:28:20 +03:00
maujim 05bc912c76 Update doc to reflect new possible values for tagbar_compact. 2020-10-16 14:16:54 -04:00
maujim f5abcd6f46 Allow more granular control of tagbar_compact option. 2020-10-16 14:16:19 -04:00
raven42 55f3513d10 Merge pull request #669 from joshfrench/add-typescript-mappings
Add typescript mappings for universal ctags
2020-10-01 15:58:08 -05:00
Josh French 5fc8a7a209 enumerators -> enumerations 2020-10-01 16:52:36 -04:00
Josh French edb5d15f4d Add typescript mappings for universal ctags 2020-10-01 16:03:37 -04:00
Wenxuan a1e0e7a571 Hide signcolumn in tagbar window (#666) 2020-09-29 13:01:42 +03:00
raven42 98efae9899 vim 7.4 compatibility for variable init (#665) 2020-09-28 22:33:07 +03:00
raven42 6099093050 Merge pull request #656 from raven42/large-file-handling
Add option to not trigger update on large files
2020-09-23 12:17:50 -05:00
raven42 9e2e5d93b4 Merge branch 'master' into large-file-handling 2020-09-23 11:47:24 -05:00
David Hegland 64730d27a9 Added fsize calculation in fileinfo so better tracking can be used to display in tagbar window 2020-09-23 11:45:02 -05:00
Caleb Maclennan 259b47a691 Fix vimscript snafu from #660, closes #662 2020-09-23 17:09:39 +03:00
Luis Piloto 8d17340295 Add g:tagbar_visibility_symbols (#660) 2020-09-23 13:43:05 +03:00
Luis Piloto 5339b4e8bd Add g:tagbar_scopestrs (#661)
Allows mapping scope suffixes (e.g. 'function') to user-defined values.
2020-09-23 13:02:34 +03:00
raven42 1caa71aca3 Merge pull request #659 from raven42/line-wrap
Fix for #647: Add g:tagbar_wrap option
2020-09-21 10:09:18 -05:00
raven42 88be6d9a4c Fix syntax in example text for new option 2020-09-21 08:25:57 -05:00
raven42 22df1b87af Fix for #647: Add g:tagbar_wrap option 2020-09-21 08:24:01 -05:00
raven42 6cb336d014 Update variable name 2020-09-16 12:17:21 -05:00
raven42 14a86de04b Update to use file size instead of line count 2020-09-16 12:15:48 -05:00
raven42 be67ff7ae7 Add option to not trigger update on large files 2020-09-14 15:15:39 -05:00
Caleb Maclennan 30fb229937 Update URLs to reflect repository migration (Closes #651) 2020-09-13 10:22:09 +03:00
raven42 e1c2c98922 Fixes #650 Correct window positioning defaults (#652)
* Fix for window positioning
With default case having multiple vertically split windows, the tagbar
window should open on the far right of the screen. When the feature in
pull-request 630 was added, this behavior changed to open the tagbar
window relative to the current window. This commit will fix that by
allowing direct usage of the vim split options.

Validated the following cases for the old default values. These all
still behave the same way as prior to pull-request 630 when the tagbar
is activated in the `active` window shown in the below examples:
```
	" No options
	+-----------------------------------+
	| preview                           |
	+--------+--------+--------+--------+
	| edit   | edit   | edit   | tagbar |
	|        | active |        |        |
	+--------+--------+--------+--------+

	" tagbar on left, preview above
	let g:tagbar_left = 1
	+-----------------------------------+
	| preview                           |
	+--------+--------+--------+--------+
	| tagbar | edit   | edit   | edit   |
	|        |        | active |        |
	+--------+--------+--------+--------+

	" tagbar on bottom, preview to right of tagbar
	let g:tagbar_vertical = 10
	+--------+---------------+--------+
	| edit   | edit          | edit   |
	|        | active        |        |
	|        +-----+---------+        |
	|        | tag | preview |        |
	+--------+-----+---------+--------+

	" tagbar on top, preview to the right of tagbar
	let g:tagbar_left = 1
	let g:tagbar_vertical = 10
	+--------+-----+---------+--------+
	| edit   | tag | preview | edit   |
	|        +-----+---------+        |
	|        | edit          |        |
	|        | active        |        |
	+--------+---------------+--------+

```

New values also all validated using the following:
```
" Behaves the same as no options
let g:tagbar_position = 'right'

" Behaves the same as g:tagbar_left = 1
let g:tagbar_position = 'left'

" Behaves the same as g:tagbar_vertical = <#>
let g:tagbar_position = 'bottom'

" Behaves the same as g:tagbar_left = 1 | g:tagbar_vertical = <#>
let g:tagbar_position = 'top'
```

* #650 - Fix typo in doc/tagbar.txt for g:tagbar_height option
2020-09-01 16:59:16 +03:00
bravestarr e5c864738d Fix issue with jumping to a tag with special characters (#649)
In C++, the name of the destructor of a class starts with a
tidle(~) which is special when the option 'magic' is set. This
will cause an error when jumping to a destructor. Call search()
in "very nomagic" environment can solve this problem no matter the
option 'magic' is set or not.
2020-08-29 17:59:53 +03:00
John Castronuovo 7dddde55b4 feat(dart_ctags): add inheritance tags 2020-08-27 09:54:54 +02:00
John Castronuovo 5e27cdb70b feat(dart_ctags): create scope for imports for dart, pub. local package
tags
2020-08-26 21:55:51 +02:00
John Castronuovo 78c1612106 refactor(dart_ctags): improve tag order 2020-08-26 20:26:13 +02:00
John Castronuovo 29e3cef248 Merge branch 'master' into dart-ctags 2020-08-26 20:18:52 +02:00
John Castronuovo 183300ea3a feat(dart_ctags): add tag for mixins 2020-08-26 20:16:37 +02:00
raven42 40413d8760 Add user facing function to get tag near line number (#643) 2020-08-26 12:18:05 +03:00
embear 600fb4255f Correct last contribution that contained an syntax error (#639) 2020-08-26 12:16:59 +03:00
zhmars 86b268471b Fix --file-scope option warning (#648) 2020-08-26 12:14:15 +03:00
gryf bcc32b42b5 Fix has_key() parameters in currenttagtype function. (#645) 2020-08-24 11:23:17 +03:00
Danilo Luvizotto a81c01c294 Fix maximized state track on close (#642) 2020-08-17 08:33:00 +03:00
John Castronuovo f52dadd162 feat(dart_ctags): add tags for enum, export, library, part, and part of 2020-08-05 21:42:02 +02:00
raven42 a5090717dd Add function tabgar:Update() to manually trigger AutoUpdate() (#633)
Co-authored-by: David Hegland <david.hegland@broadcom.com>
2020-08-03 15:30:13 +03:00
raven42 88bdb86325 Remove debug statement left in 4e7e199 causing screen flicker (#634) 2020-08-03 12:13:03 +03:00
embear 3fe9d8e13b Check for existence of key in dictionary before using it (#631) 2020-07-30 20:36:07 +03:00
raven42 5bb0ef3576 Add more flexible options for window positioning (#630)
New configuration option for g:tagbar_position that will supercede g:tagbar_left. This option allows for new values for 'top', 'bottom', 'left' and 'right' (default:'right') to position the Tagbar window.

New configuration option for g:tagbar_height that will supercede g:tagbar_vertical. This option is used to set the Tagbar window height when the window is split using the 'top' or 'bottom' position.

New configuration option for g:tagbar_no_status_line. This option will disable any Tagbar status line updates in the event another plugin is controlling the status line. This prevents Tagbar from changing the status line when Tagbar is not the active window.

Co-authored-by: David Hegland <david.hegland@broadcom.com>
2020-07-29 21:18:17 +03:00
tanhuacheng d7063c7484 Reset window after jump to tag if zoomed (#625) 2020-06-25 00:01:58 +03:00
Aaron Toderash 56399f446c Document extra languages supported by universal-ctags (#621)
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
2020-06-12 00:04:31 +03:00
Hedy Li fcabc99ca6 Add link to docs and how to open docs in README.md (#619)
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
2020-06-06 16:36:02 +03:00
Linwei a36880be22 Prevent temporary window creation on Windows (#611)
Co-authored-by: skywind3000 <skywind3000@163.com>
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
2020-05-30 11:51:45 +03:00
Caleb Maclennan f1bea00e5b Merge pull request #610 from majutsushi/no-cache 2020-05-29 22:42:31 +03:00
Caleb Maclennan e8d127bf40 Catch error message from u/e ctags variants
Co-authored-by: Steven Engler <sengler@uwaterloo.ca>
2020-05-29 21:56:48 +03:00
Caleb Maclennan 92752b89ce Add option to disable use of tmp file cache 2020-05-29 21:02:31 +03:00
cridemichel 2a1486447a Play nicely with popup windows (#604) 2020-05-05 15:47:01 +03:00
Felix Strobel 1e50ea8536 Fix license link in readme file (#599) 2020-04-24 18:37:42 +03:00
cridemichel 679a9d9ac9 Block ProcessFile from processing unloaded or nonexistant buffers (#589) 2020-01-23 18:06:44 +02:00
Caleb Maclennan 6dafb3dfe8 Merge pull request #308 from gryf/show_tag_kind2
Additional function for displaying type of a current tag.
2020-01-17 13:59:59 +02:00
PiotrProkop f3b76f9832 Fix for embedded interfaces 2020-01-17 10:27:11 +01:00
PiotrProkop 175f5053a1 Add package to singular_types dict to make it work for Golang 2020-01-17 10:27:11 +01:00
gryf d864a44a3d Additional function for displaying type of a current tag.
Introducing small function for displaying type (kind) of a current tag.
Useful for putting it in the status bar.
2020-01-17 10:26:47 +01:00
Caleb Maclennan db6f884fc7 Update information amout contributors 2020-01-16 13:18:53 +03:00
zhmars 86ab45aba7 Fix document syntax highlight (#587) 2020-01-16 11:41:04 +02:00
Caleb Maclennan 65e014e5a3 Revert incorrect function argument handling 'fix'
This reverts commit 2e952fb336 (#585).

This reverts commit bdcdd8d0d7 (#584).
2020-01-15 12:20:16 +03:00
cridemichel 2e952fb336 Fix bug in function 'put', was parsing wrong number of args (#585) 2020-01-14 16:56:21 +02:00
cridemichel bdcdd8d0d7 Fix argument handling bug in AutoUpdate function (#584) 2020-01-14 12:11:37 +02:00
dave 3bd3ba403d gotags: kinds support ``e:embedded` and `w:fields`` (#583)
fix Unknown tag kind encountered: "e".
2020-01-08 08:34:21 +02:00
jrc2139 c876263e47 feat(dart_ctags): Support dart if dart_ctags is installed (#581) 2020-01-06 16:29:08 +03:00
Caleb Maclennan 3753b235a1 Merge pull request #580 from jrc2139/gotags
feat(gotags): override ctags for go if gotags is installed
2020-01-04 10:10:50 +03:00
John Castronuovo 0a8a22e34d feat(gotags): override ctags for go if gotags is installed 2020-01-03 23:48:19 +01:00
mars 524aa93372 Add g:tagbar_show_balloon option 2020-01-03 10:53:56 +03:00
Caleb Maclennan ccc0d64e59 Merge pull request #575 from majutsushi/termencoding
Test whether &termencoding even exists before use
2020-01-02 21:43:01 +03:00
Caleb Maclennan 3c4c8af4b4 Test whether &termencoding even exists before use
Fixes #574

See also:

* https://github.com/neovim/neovim/pull/2631
* https://github.com/neovim/neovim/issues/7445
* https://github.com/vim/vim/commit/ac360bf2ca293735fc7c6654dc2b3066f4c62488
2020-01-02 08:01:14 +03:00
Caleb Maclennan d1c3f516ea Use Reviewdog to run Vint for nicer PR feedback (#572) 2019-12-31 07:43:56 +03:00
Adam Jimerson ce30e3f0d1 Fall back to using bourne shell if $SHELL is Elvish (#571)
If vim is launched from the Elvish shell, then fall back to using the
bourne shell (sh) or a bourne compatible shell when calling
{universal/exuberant-}ctags.

Signed-off-by: Adam Jimerson <vendion@gmail.com>
2019-12-22 08:28:44 +03:00
Caleb Maclennan a0f51bd5a6 Arrange (u)ctag argument order to not clobber others (#560) 2019-10-25 21:44:37 +03:00
Caleb Maclennan ede158656a Merge pull request #557 from alerque/master
Test for basic functionality in (n)vim using CI job
2019-10-23 18:24:36 +03:00
Caleb Maclennan d7f6ec1f8e Use --headless for Neovim test, install from universe 2019-10-23 17:28:43 +03:00
Caleb Maclennan f5a4932ed8 Add badge for CI check workflow 2019-10-23 16:18:51 +03:00
Caleb Maclennan c62eaf944b Test for basic functionality in (n)vim using CI job 2019-10-23 16:18:51 +03:00
Caleb Maclennan dcd5f446c3 Clarify ctag version compatibility, closes #556 2019-10-23 14:12:40 +03:00
Caleb Maclennan e718c189e6 Merge pull request #555 from alerque/master
Add vimscript linter config and CI job
2019-10-23 08:05:24 +03:00
Caleb Maclennan 7e619b5f1c Add status badge for lint job, encourage good behavior 2019-10-22 18:10:44 +03:00
Caleb Maclennan 750b779ca3 Fix variable scope issues revealed by vint 2019-10-22 18:02:00 +03:00
Caleb Maclennan b607006c56 Fix syntax issues that are lint warnings 2019-10-22 17:53:08 +03:00
Caleb Maclennan 3c63890ce0 Setup GitHub Actions to lint vimscript 2019-10-22 17:23:55 +03:00
Caleb Maclennan 61bee90638 Add note to README so it is explicit this works with Neovim 2019-10-22 11:02:32 +03:00
Caleb Maclennan 0642b84cd4 Cleanup maintainer notice from README, closes #549
More contributors (and contributions) always welcome, but there are
a couple active maintainers now so I think we can call it settled.
2019-10-22 11:00:42 +03:00
Caleb Maclennan 4b51aa490e Use different argument for ctags vs. uctags, closes #552 2019-10-22 10:47:51 +03:00
Caleb Maclennan cf6eb2d9f7 Merge pull request #544 from aymanbagabas/aymanbagabas/markdown
Add uctags markdown support
2019-10-22 10:38:05 +03:00
Caleb Maclennan 22f8084a2a Merge pull request #537 from preslavmihaylov/master
added support for golang for exuberant ctags
2019-10-22 10:23:56 +03:00
Caleb Maclennan 10209ffd3f Merge pull request #531 from rtyler/patch-1
Discover the universal-ctags binary
2019-10-22 10:22:18 +03:00
Caleb Maclennan e471e57ea6 Merge pull request #530 from hupfdule/manpage-support
Add support for manpages
2019-10-22 10:19:23 +03:00
Caleb Maclennan b9e7f0a291 Revert emergency fix, not actually broken; closes #550
There is no spoon. My testing last night was flawed because I had a typo
in my RC file that was complicating matters. In seems the syntax fix was
all this needed to work okay, not disabling the feature
2019-10-22 10:15:31 +03:00
Caleb Maclennan 70b691efe1 Fix syntax bug introduced in merged PR #476 and emergency backtrack 2019-10-21 19:56:22 +03:00
Caleb Maclennan b7766a1693 Merge pull request #529 from hupfdule/asciidoc-support
Add asciidoc support
2019-10-21 19:44:48 +03:00
Caleb Maclennan bd810fd1a6 Merge pull request #502 from chocoladisco/master
fixed the deprecated --extra to --extras
2019-10-21 19:38:27 +03:00
Caleb Maclennan a8e050f448 Merge pull request #493 from fievel/master 2019-10-21 19:37:10 +03:00
Caleb Maclennan 6dfe6afacc Merge pull request #481 from blueyed/allow-reload
Use function! to allow for reloading
2019-10-21 19:12:35 +03:00
Caleb Maclennan 3b7d19e0a1 Merge pull request #476 from goerz/ctags_options
Add g:tagbar_ctags_options
2019-10-21 18:40:26 +03:00
Flemming Madsen a0526a6d5a Fix issue where --regex based file types can output duplicate lines when --sort=no (#471)
Fix issue where --regex based filetypes can output duplicate lines when --sort=no

Co-authored-by: Flemming Madsen <flemming@themadsens.dk>
2019-10-21 16:19:45 +03:00
Caleb Maclennan 23f148225b Merge pull request #470 from blueyed/add-StopAutoUpdate
Add tagbar#StopAutoUpdate
2019-10-21 16:14:15 +03:00
Caleb Maclennan 15431176a8 Merge pull request #423 from jolan78/master
compatibility with phpctags
2019-10-21 16:10:49 +03:00
Jan Larres 0c943cc1f1 Add note about looking for maintainers 2019-10-20 16:13:36 +13:00
Ayman Bagabas 231428ebcd Add uctags markdown support
This adds basic markdown headings support based on Universal ctags.
https://github.com/universal-ctags/ctags/pull/1727 #489

Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
2019-07-04 05:22:16 -04:00
PreslavMihaylov 1998a45805 added support for golang for exuberant ctags 2019-04-27 09:06:04 +03:00
R. Tyler Croy 5acba55275 Discover the universal-ctags binary
At least in the openSUSE package for `universal-ctags` it is not installed as `ctags`
2019-03-28 08:36:39 -07:00
Marco Herrn 7e53921d4d Add support for manpages 2019-03-26 16:31:26 +01:00
Marco Herrn a91422aae3 Add asciidoc support 2019-03-26 14:06:55 +01:00
chocoladisco db1b710289 fixed the deprecated --extra to --extras 2018-08-15 13:34:35 +02:00
fievel 44f114a7cb Add map to allow pausing/unpausing tagbar 2018-06-15 10:27:33 +02:00
fievel 877515b0d8 Merge remote-tracking branch 'upstream/master' 2018-06-15 10:20:56 +02:00
Daniel Hahler 42d2750c9a Use function! to allow for reloading
Fixes the following when reloading the file:

> E122: Function <SNR>188_ProcessTag already exists, add ! to replace it
2018-02-22 21:57:19 +01:00
Michael Goerz 9c60e7f6c6 Accept a list, allowing 'NONE' to avoid duplicates 2018-02-03 20:14:37 -05:00
Michael Goerz df960e8b9c Add g:tagbar_ctags_options 2018-02-03 17:54:44 -05:00
Daniel Hahler b8065cfee4 Add tagbar#StopAutoUpdate
This is useful to stop updating information, after using
`tagbar#currenttag` manually/temporarily only.
2018-01-11 17:13:51 +01:00
Jan Larres 387bbadda9 Highlight correctly if visibility disabled
The highlight pattern for the current tag didn't account for the fact
that the visibility symbol is optional.

Closes #463
2017-12-17 16:14:51 +13:00
Jan Larres c004652797 Only equalize windows after shrinking app window, closes #452 2017-12-03 16:21:34 +13:00
Jan Larres 8d2c44f6ac Merge pull request #458 from ithinuel/master
Rust: fix method kind from F to P for universal-ctags
2017-12-03 15:28:06 +13:00
Wilfried Chauveau 7f693a0cd4 Rust: fix method kind from F to P 2017-11-20 23:18:28 +01:00
Jan Larres dc155af2fd Merge pull request #451 from mathia4/master
Fixed typo in JavaScript uctags label
2017-10-19 16:40:45 +13:00
Mitesh Athia af94c07aea Formatting 2017-10-17 21:53:58 -04:00
Mitesh Athia c86ab1caa6 Update uctags.vim 2017-10-17 21:50:02 -04:00
Jan Larres 2261625e29 Merge pull request #450 from natfitz/patch-1
Fix typo in comment
2017-10-18 10:31:50 +13:00
natfitz e330124f6e Update tagbar.vim
fix typo
2017-10-17 14:14:14 -07:00
Jan Larres bef1fa4080 Merge pull request #447 from teto/debug
Ease debugging
2017-09-24 18:30:11 +13:00
Matthieu Coudron 72416b1c62 Ease debuggin
When debug is enabled
- add verbose flag to ctags
- don't remove temp files
- log the temporary file created
2017-09-23 22:19:26 +09:00
Jan Larres ad0e433674 Add Universal Ctags note to README
Closes #394
2017-09-20 20:33:27 +12:00
Jan Larres fb5b7f61d1 Update README with minimum required Vim version
Closes #442
2017-09-18 21:04:43 +12:00
Jan Larres a9fc0fc46b Log version info at beginning of logfile 2017-09-18 21:04:43 +12:00
Jan Larres 2329c95063 Merge pull request #444 from faster-mo/master
fixed encoding bug of balloon
2017-09-18 20:23:01 +12:00
wuhy cfabd89c0f fixed encoding bug of balloon 2017-09-18 14:53:48 +08:00
Jan Larres 3e417256e8 Clarify project-specific behaviour a bit in docs 2017-09-13 17:59:35 +12:00
Jan Larres 460f3c8f2e Use function references in prototypes
This makes it possible to actually see the function names in
stacktraces. It also means that the internal objects of some of the tag
prototypes don't need to be public any more.
2017-09-13 17:48:43 +12:00
Jan Larres d4a08c33e5 Add byte limit for look-behind pattern
The TagbarKind syntax match pattern has a zero-width look-behind atom
with unlimited length. This can slow down syntax highlighting. Since in
this case there can only be 1 or 2 characters that get matched, we can
set a limit for the match, thus speeding up the matching.

Since the limit unfortunately works with bytes instead of characters,
use 3 instead of 2 to account for double-width folding characters.
2017-09-12 13:40:46 +12:00
Jan Larres 7299257d77 Fix tag jumping if tag pattern is not actually a pattern
Closes #439
References jstemmer/gotags#31
2017-09-03 20:36:46 +12:00
Jan Larres 937354ebb5 Log individual user types being loaded 2017-09-03 20:34:54 +12:00
Jan Larres 7e4928c056 Log message when closing Tagbar due to QuitPre 2017-09-03 19:07:10 +12:00
Jan Larres b4643521ff Add support for various types for [u]ctags
Exuberant Ctags:
- ObjectiveC

Universal Ctags:
- Ada
- Autoconf
- Automake
- Ctags config
- D
- Elm (courtesy of @bitterjug)
- Go
- ObjectiveC
- Perl 6
- Protobuf (closes #437)
- R

Also various improvements to existing definitions based on changes in
Universal Ctags.
2017-09-03 19:01:16 +12:00
Jan Larres 59ea6d656a Merge branch 'wdv4758h-rust'
Closes #395
Closes #284
2017-08-22 23:45:44 +12:00
Chiu-Hsiang Hsu c6c88004c7 Add Rust support 2017-08-22 23:45:25 +12:00
Jan Larres 817d8a6bee Merge branch 'ruchee-master'
Closes #283
2017-08-22 23:37:36 +12:00
Ruchee c2af2173b5 Added CSS support with Universal Ctags 2017-08-22 23:36:46 +12:00
Jan Larres 83246ed59f Merge branch 'Mr-Oss-master'
Closes #372
2017-08-22 22:43:12 +12:00
Michael Rubanov c2ae24e7ab Clojure support improvement
Added kinds:

  * namespace
  * definition
  * function
  * private function
  * macro
  * inline
  * multimethod definition
  * multimethod instance
  * definition (once)
  * struct
  * intern
  * namespace
2017-08-22 22:37:24 +12:00
Jan Larres 886af9ddc1 Fix Ruby typedef for current uctags, closes #407 2017-08-21 22:57:46 +12:00
Jan Larres da87ee9439 Add missing ftype field to jsctags type def 2017-08-21 09:54:37 +12:00
Jan Larres d4c370cf0e Handle tags that cover multiple scopes correctly
References: #430
2017-08-20 20:07:34 +12:00
Jan Larres 02f8a922b1 Remove unused 'j' php kind 2017-08-20 18:08:31 +12:00
Jan Larres bbf15b039a Merge branch 'weirdan-php-scopes' 2017-08-20 18:07:53 +12:00
Bruce Weirdan 6e1f1b8c85 Added interface and trait scopes
* Added interface and trait scopes that were missing from the previous
commit.
 * Also restored fold status for classes kind to upstream value.
2017-08-20 17:24:26 +12:00
Bruce Weirdan 7ffec4539d Added php scopes and additional kinds
Added scopes, so tagbar will show the following hierarchy:
```
  namespace
    subnamespace
      ...
        class
	  property (variable)
	  ...
	  method
	  ...
```

Additional kinds added (basically the same as #283):
 * namespaces
 * use aliases (imports)
 * traits
2017-08-20 17:24:26 +12:00
Jan Larres f20edb5a56 Rename types autoload directory 2017-08-20 17:11:37 +12:00
Jan Larres 877a4a939c Extract debug functionality into separate file 2017-08-20 17:02:36 +12:00
Jan Larres 8a1bbcb420 Create kinddict for jsctags type def
Closes #431
Closes #432
2017-08-19 18:14:21 +12:00
Jan Larres fef0732394 Separate {ex,u}ctags definitions out into individual files 2017-08-14 21:18:02 +12:00
Jan Larres 2abcbf33f0 Extract prototypes to separate autoload files 2017-08-14 21:18:02 +12:00
Jan Larres d880bcc333 Merge pull request #426 from AdnoC/incrmental-fold-change
Add ability to open or close folds a single level
2017-07-31 20:55:26 +12:00
AdnoC 96275e3921 Reduce code dupication in ChangeFoldLevel 2017-07-30 12:11:31 -04:00
AdnoC e3732091bf Add ability to open or close folds a single level 2017-07-26 10:18:18 -04:00
Jolan b7890e27ca compatibility with phpctags 2017-06-27 15:15:46 +02:00
Jan Larres f5792732de Escape tag name when removing it from a pseudo tag's scope path 2017-06-15 17:36:38 +12:00
Jan Larres b1c6cbc2d8 Short-circuit parent searches if tag doesn't have line number 2017-06-15 17:36:38 +12:00
Jan Larres 41ee79fc0f Escape tag search pattern with \M instead of \V
This follows the Vim manual in |tag-search|, which says that searches
are executed as if 'magic' was off.
2017-06-15 17:36:38 +12:00
Jan Larres b9e7b51ea5 Fix jsctags config, closes #421
This seems to be different for the tern-based jsctags, and the old one
is deprecated anyway.
2017-06-15 17:35:38 +12:00
Jan Larres 87a1263f5d Don't try to restore session on 'loadview', closes #382
The view files created with the 'mkview' command run the
'SessionLoadPost' autocommand at the end, which creates problems if
Tagbar has alread been initialized. Add a new variable so that we can
detect this situation.
2017-06-05 17:24:55 +12:00
Jan Larres 959f487981 Functions create class scope in exctags, ref #397 2017-02-18 16:43:16 +13:00
Jan Larres e089b61e25 Don't error on incorrect ctags scope info, ref #397 2017-02-18 16:32:30 +13:00
Jan Larres 9d051c1e2d Handle cases where parent is below child tag, closes #396 2017-02-12 21:39:13 +13:00
Jan Larres aab5f214c5 Save ctags output in separate file when debugging 2017-02-11 17:40:24 +13:00
fievel 73cb823d09 Add note about Universal ctags 2017-02-06 15:54:07 +01:00
Jan Larres 68eebbb50c Update tags on CursorHold after writing
Currently the tags will always get updated immediately when writing a
file. However, for large files that can slow down the writing process
noticeably, leading to annoying pauses. This commit instead defers the
updating process to the first CursorHold/CursorHoldI event after writing
a file, which should make the process much less noticeable.

Closes #289
Closes #381
References SpaceVim/SpaceVim#129
2017-02-05 19:06:20 +13:00
Jan Larres 72a7ef378f Add name-indexed dicts of tags alongside lists
When constructing the tag tree it is often necessary to look up tags
with a certain name and other attributes at the current depth. This was
previously done with the filter() function on the list of all the
relevant tags. However, this filtering is very slow.

This commit changes the FileInfo and TagInfo objects to save added tags
in a dictionary indexed by the name of the tag in addition to the list
(which is still maintained in parallel since it is necessary for things
like sorting). This significatly speeds up tag lookup since most tags
have unique names.
2017-02-04 19:02:54 +13:00
Jan Larres 9ca422ce09 Rewrite tree construction algorithm
The current algorithm for contructing the tag tree works pretty well
even when pseudo-tags are encountered, but is quite complex, hard to
understand, and hard to tweak and optimize. This commit rewrites the
algorithm to a relatively straight-forward recursive algorithm that
makes use of placeholder pseudo-tags if required that will get replaced
if the actual tag is encountered later.
2017-02-04 18:59:06 +13:00
Jan Larres 2cc891747b Print tags in one go to improve performance
Assembling the tag information in a list and then printing it with one
":put" command is more efficient then calling :put for every line.
2017-01-29 18:23:15 +13:00
Jan Larres ebcf4df686 Small code cleanup 2017-01-10 18:24:32 +13:00
Jan Larres 53e9cb030e Version 2.7 2017-01-09 17:26:17 +13:00
Jan Larres 1c8feee61f Skip languages that are disabled in ctags 2017-01-05 17:12:33 +13:00
Jan Larres 6c60f85938 Fix typo 2017-01-05 16:49:40 +13:00
Jan Larres 18b536ce43 Save last alt bufnr before switching buffers, closes #385
When switching buffers during the handling of the BufDelete event the
saved buffer number of the last alternate buffer will change, so we have
to save a local copy to be able to properly unset the 'tagbar_ignore'
buffer variable.
2017-01-03 15:21:10 +13:00
Jan Larres 51e6e3b66a Merge pull request #384 from jpmv27/ignore_BufDelete_from_set_nobuflisted
HandleBufDelete: Ignore apparent 'set nobuflisted' events
2016-12-28 14:33:34 +13:00
Martin Vuille 9f6dce3351 HandleBufDelete: Use str2nr for conversion 2016-12-27 08:05:35 -05:00
Jan Larres 3a4ea1234f Clarify debug procedure in docs 2016-12-24 16:46:53 +13:00
Martin Vuille 5b563a0d2d HandleBufDelete: Ignore apparent 'set nobuflisted' events 2016-12-18 11:35:00 -05:00
Jan Larres 1374077676 Always log the ctags version output 2016-12-17 18:01:49 +13:00
Jan Larres 01f57ac564 Disable autocommands when deleting Tagbar buffer in HandleOnlyWindow
This prevents infinite recursion with nested autocommands when using a
BufEnter autocommand that calls autoopen().
2016-11-07 12:45:17 +13:00
Jan Larres e212be6a12 Resize window after opening, ref #246
This prevents an incorrect window size from being used in some edge
cases.
2016-11-05 19:22:23 +13:00
Jan Larres 3d208115fb Merge pull request #360 from ChesleyTan/master
Escape filename in ShowInPreviewWin()
2016-11-04 10:23:12 +13:00
Chesley Tan 8bbbb0530e Escape filename in ShowInPreviewWin() 2016-11-03 12:57:26 -04:00
Jan Larres 1287f63545 Display filetype-specific sort in statusline, closes #292 2016-10-31 17:52:36 +13:00
Jan Larres d2961a4677 Check for nonexistent variable, closes #357 2016-10-31 09:59:32 +13:00
Jan Larres 56bee63e17 Only jump to previous window if there is one, closes #355 2016-10-29 17:29:40 +13:00
Jan Larres 2d67896b06 Add debug statement with exit code after system() call 2016-10-24 18:13:27 +13:00
Jan Larres bcb042da56 Improve HTML support with Universal Ctags, closes #317 2016-10-23 20:31:35 +13:00
Jan Larres d16ec1198b Don't consider file as valid if its window is in diff mode 2016-10-23 20:09:46 +13:00
Jan Larres a1f416edde Define mappings with <nowait> if available, closes #299 2016-10-22 02:02:27 +13:00
Jan Larres 040e8400af Print exit code when failing to run ctags 2016-10-21 17:43:47 +13:00
Anmol Sethi b99e103258 Silent option
If the silent option is set, tagbar doesn't echo out information about
the tag the cursor is on in the tagbar window.
2016-10-19 12:58:40 +13:00
Jan Larres b6298c0ca0 Use window ID functionality if available, ref #351
When opening the Tagbar window the window numbers can change so that
restoring the window history is not possible. Use the new window ID
functionality if it is available to make that possible.
2016-10-17 23:08:18 +13:00
Jan Larres 4d513c8a68 Also restore window history when opening Tagbar, ref #319 2016-10-16 23:19:42 +13:00
Jan Larres 23557ef97a Always restore the window history, closes #319
When we have to go to the Tagbar window to update it the knowledge of
the previous window to the one we're coming from gets lost. Save it
before switching windows so we can restore it after returning from the
Tagbar window.
2016-10-16 23:02:18 +13:00
Jan Larres 2954e405bb Merge pull request #349 from vavaka/master
flags argument added to functions responsible for window toggling
2016-10-16 12:09:29 +13:00
Jan Larres 3566907b57 Only use QuitPre functionality if supported, closes #350
The QuitPre autocommand was introduced in Vim version 7.3.544. If Vim is
older than this then don't use the HandleOnlyWindow() functionality, so
in the case of closing the last window in a tab a user will have to
close the Tagbar window themselves.
2016-10-15 20:20:03 +13:00
Jan Larres a43068e418 Fix quit/bdelete cases properly
This commit should (hopefully) finally fix the case of users calling
':bdelete/:bwipeout' or ':quit' while Tagbar is open and just do the
right thing. See commit e4cfe8a for a more thorough description of how
it's supposed to work.
2016-10-15 20:13:28 +13:00
Jan Larres b6a0ec00cd Only suspend Tagbar during 'grep' qf commands, closes #347 2016-10-12 14:16:37 +13:00
vavaka 11cdebab2a flags argument added to functions responsible for window toggling 2016-10-11 13:41:01 +06:00
Jan Larres d81333e055 Merge pull request #315 from niloct/master
Fixed sentence about pseudo-tags
2016-10-10 22:20:34 +13:00
Jan Larres 0bb6499548 Rename QuitIfOnlyWindow since it's no longer accurate 2016-10-10 21:51:14 +13:00
Jan Larres e4cfe8add5 Properly handle closing the last file window, closes #345
When a window that is displaying a normal file gets closed with a :quit,
:bdelete or other command, Tagbar may end up as the only visible window
left, which isn't very useful. Previously Tagbar would just quit in such
a situation (unless there was more than one tab), but that is rather
non-intuitive.

The change in this commit introduces a mechanism that should hopefully
handle such a case properly based on which command was executed, and do
exactly what a user would expect:

- In the ':quit' case, it will close the current tabpage including
  Tagbar unless it was the only tabpage, in which case it will quit Vim.
- In the ':bdelete/:bwipeout' case, it will delete the Tagbar buffer and
  then reopen Tagbar once the buffer that Vim switched to is being
  displayed.
2016-10-09 21:03:01 +13:00
Jan Larres 497e963bc4 Separate buffer- and window-local options 2016-10-09 19:02:26 +13:00
Jan Larres d1c42db686 Merge pull request #342 from jpmv27/separate_tagbar_per_tab
Separate tagbar per tab
2016-10-08 18:21:20 +13:00
Martin Vuille 321fdd4fd1 Don't close new tab 2016-09-28 06:20:25 -04:00
Martin Vuille b1e1063b37 Clean-up for pull request 2016-09-24 18:40:44 -04:00
Martin Vuille 1e5b704e09 Give each tab its own tagbar instance data 2016-09-24 17:49:35 -04:00
Martin Vuille 7c56066685 Give each tab its own tagbar buffer 2016-09-24 17:48:52 -04:00
Martin Vuille 7e35a40715 Separate shared and per-tagbar instance data 2016-09-24 17:45:07 -04:00
Jan Larres 2955f71856 Try to jump to the right tag column, closes #326 2016-09-25 00:24:04 +12:00
Jan Larres d379913b9a Merge branch 'joegrasse-master' 2016-09-23 16:11:31 +12:00
Joe Grasse d61ca60d1c Verify that window number is valid before switching to it 2016-09-23 15:32:35 +12:00
Jan Larres 9a75c110b7 Don't choke when run from netrw, closes #291 2016-09-20 23:30:18 +12:00
Jan Larres b7f147aabc Remove redundant SetStatusLine argument, ref #335
Thank you to @jpmv27 for spotting this.
2016-09-19 23:10:10 +12:00
Jan Larres 61ba5ba578 Merge pull request #333 from jpmv27/case_insensitive_sort_option
Add case-insensitive sort option
2016-09-19 23:04:02 +12:00
Jan Larres 71e56f5ea4 Merge pull request #334 from jpmv27/restore_cursor_tag_toggle_hide
Keep cursor on same tag when toggle hide non-public
2016-09-17 20:40:43 +12:00
Jan Larres 03592c0112 Update the statusline at the end of AutoUpdate(), closes #330 2016-09-13 22:45:52 +12:00
Jan Larres 2438a92cb9 Merge pull request #338 from alejandrogallo/master
Add asymptote support as a c clone
2016-09-12 12:52:18 +12:00
Jan Larres d841db9f49 Fix file-scope tags in uctags, closes #314 2016-09-12 12:39:12 +12:00
Alejandro Gallo 61de1fe0d6 Add asymptote support as a c clone 2016-09-10 17:22:30 +02:00
Jan Larres 35ee5a91f9 Fix Python member functions with Universal Ctags, closes #306 2016-09-10 21:02:09 +12:00
Martin Vuille f8587f106c Keep cursor on same tag when toggle hide non-public 2016-08-27 18:21:06 -04:00
Martin Vuille 7fbd1ad375 Add case-insensitive sort option 2016-08-27 18:14:10 -04:00
Nilo César Teixeira 931cb37e6b Fixed sentence about pseudo-tags 2016-03-16 20:30:34 -03: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
Jan Larres 6d8770f949 Version 2.6 2013-12-06 00:27:08 +13:00
Jan Larres c4963e91cc Update credits 2013-12-06 00:26:00 +13:00
Jan Larres 87bbb46e95 Open previewwin relative to Tagbar win 2013-11-30 19:28:18 +13:00
Jan Larres b4a5800f72 Always centre preview window 2013-11-30 03:31:31 +13:00
Jan Larres ba3693f977 Properly open fold when jumping to tag 2013-11-30 03:18:39 +13:00
Jan Larres 528bdc6b8d Improve preview window handling
Use psearch instead of pedit since pedit essentially reloads the file
and creates an empty undo entry. This also makes it faster.
2013-11-29 18:43:00 +13:00
Jan Larres 2dcd5260b6 Equalize windows after shrinking if necessary, closes #182 2013-11-24 01:21:44 +13:00
Jan Larres 3f28e3b073 Add a note about autocmd timing, closes #180 2013-11-22 17:19:14 +13:00
Jan Larres 915b11bd1c Close preview window when closing Tagbar 2013-11-22 16:43:06 +13:00
Jan Larres e090fe73d1 Automatically open folds in preview window 2013-11-22 16:36:54 +13:00
Jan Larres 574376d165 Add Cython/Pyrex support, closes #181 2013-11-22 14:55:50 +13:00
Jan Larres 66c56b11a7 Clean up window switching 2013-11-15 16:21:12 +13:00
Jan Larres c57dd9f7a4 Make sure QuitIfOnlyWindow also works with prevwin open 2013-11-13 16:53:52 +13:00
Jan Larres f3250b2dd1 Make preview window position configurable 2013-11-13 16:29:42 +13:00
Jan Larres 0377f19d74 Add auto-previewing mode, closes #161 2013-11-11 18:23:22 +13:00
Jan Larres 2d650b96cf Ignore preview window when quitting 2013-11-11 17:39:48 +13:00
Jan Larres 290b71e2b7 Skip preview window when jumping to tag 2013-11-11 17:12:40 +13:00
Jan Larres 78a7eeecf3 Add key to show tag in preview window 2013-11-11 00:53:45 +13:00
Jan Larres 207b8520c2 Allow ignoring specific files, closes #169 2013-11-08 17:27:34 +13:00
Jan Larres 1a2c4ec958 Rework pause functionality, closes #177
The current pause functionality simply removes all the autocommands to
stop updating Tagbar. This has the problem that at the moment the
statusline functions immediately restore the commands so pausing doesn't
work, but even if that didn't happen it would stop the statusline
functionality from working which is not desirable. The solution is to
have a reference to the paused file which will get used by the Tagbar
window, but not the statusline functions.
2013-11-06 22:33:27 +13:00
Jan Larres 0fd09344c7 Don't update during window opening, closes #179
Plugins like MiniBufExplorer can trigger an update before window
initialization has finished, leading to errors. Skip processing until
that is done.
2013-11-06 17:06:39 +13:00
Jan Larres abffaba655 Fix stupid 'if' syntax mistake 2013-11-06 14:11:16 +13:00
Jan Larres 15f9ad6e88 Check for existence of qf var before deleting
Otherwise explicit calling of QuickFixCmdPost autocmds without a
preceding QuickFixCmdPre will generate an error.
2013-11-06 13:27:16 +13:00
Jan Larres b60d08c468 Add comment why BufReadPost is needed 2013-11-05 09:16:58 +13:00
Jan Larres e5408f740f Don't process quickfix-loaded files, closes #176
Certain quickfix-commands like vimgrep have to load all searched files
into Vim and will execute the BufReadPost autocmd for all of them. Since
Tagbar doesn't need to generate tags for those files pause processing
while the command is running.

There doesn't seem to be a better way to find out whether vimgrep is
running than to set a temporary variable with the QuickFixCmdPre/Post
autocmds, see also
https://groups.google.com/forum/#!topic/vim_use/sUj5MFGmwD8
2013-11-04 22:51:38 +13:00
Jan Larres 85c198ba57 Always properly shrink window, closes #172
Closing Tagbar with :q instead of the provided commands and mappings
would bypass the Vim application window shrinking logic. Install an
autocommand that checks for this situation.
2013-11-04 22:30:17 +13:00
Jan Larres 2e2ba2eab2 Use standard highlight group if syntax is disabled
This prevents an error message about a non-existent highlighting group
when trying to match the tag pattern.
2013-11-02 21:51:15 +13:00
Jan Larres fd79a17189 Merge pull request #175 from typekpb/patch-1
fix site url in README.md (com -> io)
2013-09-30 03:02:45 -07:00
Peter Butkovic ae4bbcdaaf fix site url in README.md (com -> io)
due to: https://github.com/blog/1452-new-github-pages-domain-github-io
2013-09-30 09:10:29 +02:00
Jan Larres 3c37ddcc14 Handle invalid ctags line numbers, closes #119 2013-09-19 12:36:41 +12:00
Jan Larres 5566cb34d5 Don't force processing on BufReadPost, closes #170
This prevents files being processed twice unnecessarily, once for
FileType and once for BufReadPost. All cases where BufReadPost is called
without FileType should be covered by the checks in AutoUpdate().
2013-09-18 17:44:52 +12:00
Jan Larres 97d7b04bdd Add xterm-resize reference 2013-08-30 17:20:51 +12:00
Jan Larres 4801c897f8 Try expanding a terminal if configured 2013-08-30 16:57:27 +12:00
Jan Larres 24efd12f50 Add option to show line numbers, closes #146 2013-08-24 21:45:10 +12:00
Jan Larres fec9b2a1ab Add status_func documentation 2013-08-24 21:25:54 +12:00
Jan Larres 56cd34830d Remove deprecated GenerateStatusline() function 2013-08-24 20:50:27 +12:00
Jan Larres 0b14e28719 Merge branch 'stltest' 2013-08-24 19:17:13 +12:00
Jan Larres 225fcaa3ce Log ctags version 2013-08-24 18:38:04 +12:00
Jan Larres dab8d99fb8 Print message if no tags have been found in file 2013-08-24 17:57:33 +12:00
Jan Larres a566f7141f Echo message if ctags output is empty 2013-08-24 17:40:12 +12:00
Jan Larres 7ef2dd0ef1 Log error messages with ctags output 2013-08-23 18:02:24 +12:00
Jan Larres 84d65042fa Remove commented out statusline calls 2013-08-22 19:06:28 +12:00
Jan Larres c37d783d4f Make keybindings configurable, closes #159 2013-08-22 17:38:31 +12:00
Jan Larres 7ec151a7a9 Better quickhelp syntax highlighting 2013-08-22 17:01:19 +12:00
Jan Larres e97d2c00ad Simplify option initialization 2013-08-22 13:16:46 +12:00
Jan Larres 57acb383b6 Statusline tweaks 2013-08-21 18:28:40 +12:00
Jan Larres 495e5fcb08 Allow customizing the statusline 2013-08-21 17:50:03 +12:00
Jan Larres 746771801c Log exact shell command for debug 2013-08-21 02:44:31 +12:00
Jan Larres 824767bc48 Small debug clarification in docs 2013-08-20 00:40:21 +12:00
Jan Larres 57ee79bd4c Mention the wiki in the README 2013-07-30 16:02:35 +12:00
Jan Larres a217435f50 Remove autocmds when not needed, closes #153
When the Tagbar window gets closed and the statusline functionality is
not in use, remove the autocommands to prevent unnecessary ctags calls.
2013-07-30 11:38:46 +12:00
Jan Larres 2bacadf716 Merge pull request #157 from mmcclimon/doc_fontchars
Fix for confusing font character example.
2013-07-22 16:29:36 -07:00
Michael McClimon e4fda667f9 Fix for confusing font character example. 2013-07-22 11:47:45 -04:00
Jan Larres 5732ce9bd6 Simplify sort method 2013-07-17 16:50:02 +12:00
Jan Larres f36e0d3d39 Always correctly show sort order 2013-07-17 16:49:22 +12:00
Jan Larres dacf4f273e Add Tagbar command as alias for TagbarToggle, closes #151 2013-06-25 18:12:25 +12:00
Jan Larres 82a932406f Make autoshowtag more flexible, closes #152 2013-06-25 16:33:36 +12:00
Jan Larres 2ebd2a1392 Escape quotes in path filters, closes #150 2013-06-03 17:38:02 +12:00
Jan Larres ca02374f40 Merge pull request #147 from zhaocai/master
Export tagbar#currentfile() function
2013-06-02 21:56:10 -07:00
Jan Larres a93fb868d8 Restore windows properly after zooming 2013-05-20 15:18:57 +12:00
Zhao Cai 070a75cb04 Export tagbar#currentfile() function 2013-05-15 08:00:08 -04:00
Jan Larres 24915dbe24 Handle non-existent project autocmds properly, closes #145 2013-05-06 18:49:19 +12:00
Jan Larres f5435678fb Expand deffile path 2013-04-30 10:12:02 +12:00
Jan Larres 3ecdb5028d Try to distinguish between equal alternative tags, closes #139 2013-04-29 16:49:17 +12:00
Jan Larres d0d307c9bd Convert remaining call to CreateTypeKinddict(), closes #142 2013-04-26 19:33:00 +12:00
Jan Larres f0f9d66465 Move tests into separate repository 2013-04-24 15:57:22 +12:00
Jan Larres e6e084e8b0 Re-enable BufReadPost event 2013-04-24 12:10:33 +12:00
Jan Larres cde257b1bc Merge branch 'inkarkat-enh-syntax' 2013-04-24 11:33:40 +12:00
Jan Larres 54b28e4988 Fix TagbarScope pattern 2013-04-24 11:33:30 +12:00
Jan Larres 7c0d8675b5 Make createKinddict() an instance method 2013-04-24 10:45:46 +12:00
Jan Larres acca348959 Allow project-specific type config 2013-04-24 10:45:46 +12:00
Jan Larres 1c605bd958 Merge pull request #135 from darcyparker/issue133_ctagsbin
Improved `s:EscapeCtagsCmd()` for windows `cmd.exe` to eliminate issues when `a:ctags_bin` calls a batch file that uses `%~dp0`.
2013-04-23 04:19:09 -07:00
Ingo Karkat 2665695f57 FIX: Avoid matching public / private methods as TagbarKind.
When g:tagbar_iconchars = ['+', '-'] (default on Windows), and viewing a filetype (e.g. java) that has visibility information (i.e. the [-+#] sigils), the method is mistakenly highlighted as TagbarKind. Restrict its matches to when the sigil is at the beginning of the line to avoid the false matches at the indented method tags.
2013-04-12 21:22:27 +02:00
Ingo Karkat 32b5b15b52 FIX: Avoid that the sigils used for highlighting match inside a tag.
When there's a tag e.g. "foo-bar", the "-bar" part is matched as TagbarKind. Add a zero-width condition to all sigil patterns that allow only whitespace characters before the sigil.
2013-04-12 21:14:23 +02:00
Ingo Karkat 87d293206b Simplify conversion of g:tagbar_iconchars into regexp.
With join() and escape(), the steps can be simplified.
2013-04-12 20:48:08 +02:00
Darcy Parker 93f2b68166 Removed unnecessary | around 'shell' 2013-04-08 09:21:15 -04:00
Jan Larres db9404ca1a Add tests to repository 2013-04-06 00:59:14 +13:00
Jan Larres b6f47e4020 Simplify getusertypes() function 2013-04-05 11:57:57 +13:00
Jan Larres ec0eb883dc Recognize racket as scheme, closes #134 2013-04-04 19:06:42 +13:00
Darcy Parker d0df97040b Improved s:EscapeCtagsCmd() for windows cmd.exe to eliminate issues when
a:ctags_bin calls a batch file that uses %~dp0. Changes include:
- Enable ctags_args to be a list
- Changed default ctags_args to be a list to improve robustness of
  s:EscapeCtagsCmd()
- Do not escape 0th argument of ctags_cmd for cmd.exe when it is not
  necessary because otherwise batch files may not return expected value
  for %~dp0
- Updated tagbar documentation about string and list value types for
  ctags_args
See https://github.com/majutsushi/tagbar/issues/133
2013-04-02 17:57:30 -04:00
Jan Larres dec1f840fb Version 2.5 2013-03-25 22:27:12 +13:00
Jan Larres 11f8479593 Return to the correct window after closing Tagbar, closes #132
Since the window numbers can change when opening and closing windows
Tagbar so far has used bufwinnr() to find the right window to jump back
to. However, this fails if the same file is being displayed in more than
one window. Save a window-local variable instead to detect the correct
window to jump back to.
2013-03-24 14:16:56 +13:00
Jan Larres 77a318b10e Don't disrupt the statusline if ctags fails 2013-03-23 19:46:38 +13:00
Jan Larres c1c7d962af Explain ctags bug issues in README.md 2013-03-21 16:30:38 +13:00
Jan Larres aa190a87fa Rename README to README.md 2013-03-21 16:12:08 +13:00
Jan Larres 80dfccf09d Don't restore window position if moved manually 2013-03-18 19:09:12 +13:00
Jan Larres be00efa703 Save and restore window position when expanding, closes #129 2013-03-18 18:51:54 +13:00
Jan Larres cc222f5d8c Run ctags even if previous run produced erros, closes #125
If a ctags-compatible program returns an error status code on a parsing
failure then it would never be run again on the same file, even if later
invocations would have returned normally (for example after fixing an
error in the current file). Therefore we need to execute the program on
updates as usual, but do not repeat error messages if the previous run
already did.
2013-02-26 21:56:12 +13:00
Jan Larres 852c6dac69 Better handling of switching to unsupported buffer 2013-02-19 00:02:32 +13:00
Jan Larres 0bce914578 Update credits 2013-02-18 21:56:32 +13:00
Jan Larres 59bb2a4355 Merge pull request #123 from jszakmeister/fix-currenttag-on-unsupported-file
When switching to a buffer that is unsupported, clear current.
2013-02-18 00:51:36 -08:00
Jan Larres 4ca7a0c636 Prevent update error when current file is empty 2013-02-18 21:51:16 +13:00
Jan Larres f801147c2e Fix header indentation 2013-02-13 23:34:17 +13:00
Jan Larres 9ec7d1db4c Merge pull request #118 from techlivezheng/feature/autoupdate-on-bufreadpost
Run auto-updating on BufReadPost event
2013-02-06 00:35:57 -08:00
Jan Larres 9bbd0098c5 Don't update when in previewwindow, closes #112 2013-02-06 21:21:18 +13:00
Jan Larres 5816ce0c5a Add abort() to NextNormalWindow function 2013-02-06 19:00:34 +13:00
Jan Larres 3f03aa3013 Small patch cleanup 2013-02-06 18:43:51 +13:00
Techlive Zheng 0224d32eb9 Only reset '0 mark when it is the last window
We only need to reset '0 mark when our tagbar window is the last one,
otherwise, just quit the window and let the other window handle the
error that might happen on quiting Vim.
2013-02-06 18:21:36 +13:00
Techlive Zheng 987569e7dd Only colse the tagbar window itself
If there are other plugin windows open, close tagbar window and handle
over the control to the other window.

If the last file in the Vim's file arguments list has not been edited
yet, normal Vim's behavior would be quit on ':q!' or twice ':q'. As our
plugin window is the last window now, previously quiting on the file
window will not trigger the "more files" check, but our window does.
We'd better to behave the same. Currently, twice ':q' quiting would work,
but ':q!' not. There is no easy way to determine whether the command
being executed with a "!" or not, so this is a flaw now and we need
to come up a better solution someday, but it is a progress than before.
2013-02-06 18:21:35 +13:00
Techlive Zheng a444c62066 Quit if no more normal window exists
There might be other plugin windows but no normal file window open, we
need to make sure tagbar window is closed at this situation.
2013-02-06 18:21:35 +13:00
Jan Larres 1181325968 Reinstate noautocmd when going to pprev window 2013-02-06 17:30:33 +13:00
Jan Larres 1f0c0a3a8e Small cleanup of last patch 2013-02-06 17:07:27 +13:00
Techlive Zheng ad8783961d Do not interfere window switching history
Many plugins rely on 'wincmd p' to work properly, we need to preserve
at least one-level backwards window switching history.
2013-02-06 17:00:09 +13:00
Jan Larres bccdc7a48d Improve out-of-sync error reporting 2013-02-04 15:10:06 +13:00
John Szakmeister 2b1f655063 When switching to a buffer that is unsupported, clear current. 2013-01-20 10:54:16 -05:00
Techlive Zheng 17d199f584 Run auto-updating on BufReadPost event
If 'autoread' is set and a buffer gets updated, tagbar need to be
triggerd to update itself too.
2012-11-30 08:17:58 +08:00
Jan Larres feebffcd2a Always colour signature correctly 2012-11-22 18:43:46 +13:00
Jan Larres 7d836e0c53 Make visibility symbols optional 2012-11-22 18:42:14 +13:00
Jan Larres 0ab07ac566 Use 'visibility' instead of 'access' everywhere exclusively 2012-11-22 18:05:59 +13:00
Jan Larres 576d6e6dea Update credits 2012-11-21 20:44:43 +13:00
Jan Larres df341841ec Small doc fix 2012-11-21 18:44:28 +13:00
kianryan 15eddce14f Updates to TagbarTogglePause
Changes requested by majutsushi.

Changed function to :TagbarTogglePause
Added documentation for function, including usage and defintion.
Changed autocommands_enable to autocommands_enabled.
2012-11-01 14:36:45 +00:00
kianryan e88b81c4f5 Merge branch 'master' of github.com:kianryan/tagbar 2012-10-01 14:24:46 +01:00
kianryan 19695b87b0 Pause autocmd functionality with :TagbarPause
tagbar#PauseAutocommands :TagbarPause

:TagbarPause pauses autocmds, effectively freezing Tagbar on the last
file.  Useful for keeping a tag reference for a file open whilst working
in a different file.
2012-10-01 14:22:35 +01:00
Jan Larres 568ef5fd25 Make the indent configurable, closes #110 2012-10-01 22:59:53 +13:00
Jan Larres e635a23cf5 Don't disable cursorline/column locally 2012-10-01 21:57:28 +13:00
Jan Larres 2fee7677d5 Handle invalid fields gracefully 2012-09-16 03:03:11 +12:00
Jan Larres cd0e20f93b Add TagbarCurrentTag command, closes #109 2012-09-15 17:03:43 +12:00
Jan Larres ee700817d5 Fix some TagbarShowTag bugs, closes #108 2012-09-15 16:49:28 +12:00
Jan Larres 67dc2a3b06 Typo 2012-09-13 23:29:39 +12:00
Jan Larres 63e689b647 Escape all cmd.exe reserved chars 2012-09-11 17:44:14 +12:00
Jan Larres ba6eb10e49 Don't use doautocmd 2012-09-09 22:55:57 +12:00
Jan Larres d39a767486 Allow prototype to be shown with currenttag 2012-09-09 20:17:44 +12:00
Jan Larres a34acf4f63 Merge pull request #106 from sethwoodworth/master
Remove space from statusline example
2012-09-04 06:13:57 -07:00
Jan Larres 6483a0edd1 Merge pull request #104 from zmx/patch-1
Support Clojure as LISP type
2012-09-04 05:48:31 -07:00
Jan Larres 757358349e Move some var inits outside of win init function 2012-09-05 00:29:28 +12:00
Seth Woodworth 04e40e09c1 fix example for statusline
vim funcs can't have spaces in arg lists
2012-09-03 19:07:52 -03:00
Zhong, Ming-Xun ba7d6b3e8e Support Clojure as LISP type 2012-08-31 18:42:25 +08:00
Jan Larres 4569779601 Only generate prototypes on-demand 2012-08-27 01:57:56 +12:00
Jan Larres 7d1ba97603 Typo in comment 2012-08-26 19:32:46 +12:00
Jan Larres b1c7f5f792 Improve prototype handling 2012-08-26 19:25:02 +12:00
Jan Larres b19c1d8524 Try to get complete prototype 2012-08-26 18:36:26 +12:00
Jan Larres 8b5ba2ad66 Tweak some debug messages 2012-08-23 01:47:59 +12:00
Jan Larres 25f43b9e88 Print debug message when executing ctags 2012-08-23 00:59:41 +12:00
Jan Larres f6acd740d7 Better debug message 2012-08-18 00:11:07 +12:00
Jan Larres bff765b957 Only determine extension once 2012-08-01 21:08:49 +12:00
Jan Larres f2c072dbb9 Add extension to temporary files 2012-07-31 16:50:55 +12:00
Jan Larres e321d85548 Don't open all folds when jumping to tag 2012-07-31 16:42:33 +12:00
Jan Larres f3c1a93017 Make 'open' commands a bit more intuitive 2012-07-31 16:42:18 +12:00
Jan Larres e690a5e97d Cache files locally for parsing
Files are now cached locally in a temporary file, and the parsing
happens on that file. This allows displaying tags for remote (Netrw)
files, and it will also make access to files on remote filesystems like
NFS and sshfs faster.

Additionally, tags are now always updated when the files are saved,
deprecating the tagbar_updateonsave_maxlines option. Otherwise checking
for changes in remote files would not have been possible.
2012-07-22 21:49:17 +12:00
Jan Larres 052bc7972b Correct latest stable ctags version for latex support 2012-07-22 18:14:14 +12:00
Jan Larres f1c6d8c780 Clarify LaTeX support in manual 2012-07-21 23:51:01 +12:00
Jan Larres 1757b33da7 Explain feature requirements in systemenc doc 2012-07-21 21:08:33 +12:00
Jan Larres 427d709f61 Only attempt encoding conversion if compiled with +multi_byte 2012-07-21 20:59:23 +12:00
Jan Larres 49d39cae6c Add 'abort' keyword to all functions 2012-07-20 01:24:16 +12:00
Jan Larres 6a7f155874 Version 2.4.1 2012-07-16 21:38:20 +12:00
Jan Larres 768cd6b908 Only check for ctags when a function is called
If ctags isn't installed, then until now most of the autoload script
would have been skipped, leaving functions like tagbar#currenttag()
undefined. Move the ctags check to the exuberant-ctags checking function
to prevent errors in this case.
2012-07-01 19:21:44 +12:00
Jan Larres 4981cf9896 Handle missing ctags more gracefully in currenttag
If tagbar#currenttag() was used in a statusline on a system that had
Tagbar installed, but not ctags, then an error was reported on every
statusline update. Change the ctags checking so that errors in
currenttag() fail silently while still reporting an error message if
Tagbar is opened normally.
2012-07-01 18:48:00 +12:00
Jan Larres fd9ac426e9 Clarification for custom tags programs 2012-06-29 02:08:01 +12:00
Jan Larres 4dabb96014 Update types for vim, sql and actionscript
Some of the type configurations were not up to date with the latest
ctags version. Thanks to David Fishburn for providing the information.
2012-06-24 18:57:50 +12:00
Jan Larres 7f95420284 Disable spellchecking in Tagbar window, closes #83 2012-06-23 16:39:07 +12:00
Jan Larres 44ce05fb5d Fix highlighting tags in closed folds
If a tag was in a closed fold that was itself in a closed fold, and
those folds existed since the initial display (for example by using the
g:tagbar_foldlevel option), then intermediate tags could have invalid
tline values which resulted in the search pattern failing.
2012-06-23 01:30:45 +12:00
Jan Larres 9ae2b2d818 Add highlight pattern debug message 2012-06-22 22:25:03 +12:00
Jan Larres 2e0d125b79 Explicitly load plugin file if necessary 2012-06-19 16:49:55 +12:00
Jan Larres 5ee3143b5a Version 2.4 2012-06-17 21:19:42 +12:00
Jan Larres c4b1d65c46 Explain highlighting update time 2012-06-16 22:01:55 +12:00
Jan Larres a2652b26a0 Add missing command help tags 2012-06-16 21:52:51 +12:00
Jan Larres c5f91a5b76 Add command for easy type customization 2012-06-16 21:46:54 +12:00
Jan Larres ee1c4e137e Always highlight current tag when using TagbarOpen, closes #73 2012-05-12 20:07:04 +12:00
Jan Larres 272e2e8478 Escape some special characters for cmd.exe 2012-04-30 16:40:28 +12:00
Jan Larres 814bb41ecf Highlight correct tag when opening tagbar 2012-04-22 04:28:28 +12:00
Jan Larres f14c81770b Fix small bug in RestoreSession 2012-04-15 23:10:58 +12:00
Jan Larres bbe5579c89 Allow the full hierarchy to be displayed in currenttag() 2012-04-15 23:10:34 +12:00
Jan Larres eab0e67d1b Make use of improved latex support in ctags if available 2012-04-02 18:30:18 +12:00
Jan Larres 497575a3a3 Highlight all tags instead of just stl-configured ones 2012-03-31 20:25:05 +13:00
Jan Larres 3a049c0f82 Mention that a pattern should be used in tag format 2012-03-16 23:56:26 +13:00
Jan Larres d29690005d Move default column definition into tag init function 2012-03-16 23:51:35 +13:00
Jan Larres 540472bcd3 Describe tag file format supported 2012-03-16 23:49:49 +13:00
Jan Larres f6a02c9e24 Use spaces instead of tabs in help file 2012-03-16 02:33:27 +13:00
Jan Larres f7d966c596 Support column: extension field 2012-03-14 23:10:31 +13:00
Jan Larres 86b49e6949 Make SetFoldlevel respect default-closed folds without '!', closes #61 2012-03-14 22:42:59 +13:00
Jan Larres 774c964f28 Use prototypes for the type information 2012-03-14 22:42:59 +13:00
Jan Larres dd84a57c6e Move parsing of user type defs into separate function 2012-03-08 18:06:51 +13:00
Jan Larres a9209b4367 Remove access info from currenttag() 2012-03-05 23:31:11 +13:00
Jan Larres 134207bc41 Allow types for tagbar#currenttag() to be configured 2012-03-04 20:52:15 +13:00
Jan Larres c0ed890b60 Disable debug mode by default, closes #67 2012-02-29 02:35:47 +13:00
Jan Larres c18599234e Align help tags better 2012-02-29 00:33:27 +13:00
Jan Larres d9857cf204 Add function that returns the current tag, closes #59 2012-02-29 00:21:50 +13:00
Jan Larres 091f6336c8 Save some unnecessary redrawings 2012-02-28 22:46:04 +13:00
Jan Larres 3e8e8775be Create sub-kind headers as base tags to allow folding of parents 2012-02-28 22:45:11 +13:00
Jan Larres 592dc6856a Update online help 2012-02-28 22:10:41 +13:00
Jan Larres 4eb89e4a53 Don't handle sub-kind headers as tags 2012-02-28 22:10:16 +13:00
Jan Larres efca11881d Remove unneeded function 2012-02-28 02:38:39 +13:00
Jan Larres 64b8bf7447 Reorder some functions 2012-02-28 02:34:01 +13:00
Jan Larres 42ef608aae Mention the Taglist behaviour in autoopen options 2012-02-27 23:19:50 +13:00
Jan Larres 2ba944b162 Correct focus on startup under certain circumstances, closes #60 2012-02-23 20:49:16 +13:00
Jan Larres 08b474b59f Add some more debugging messages 2012-02-23 20:43:13 +13:00
Jan Larres a69cb8ce0b Delete fileinfo also on BufUnload and BufWipeout 2012-02-23 00:00:24 +13:00
Jan Larres 4bf1d7024d Mention user types in ftplugins in documentation 2012-02-19 17:57:00 +13:00
Jan Larres ee389534e1 Allow loading type definitions from ftplugins, closes #62 2012-02-19 17:26:15 +13:00
Jan Larres 7e58b3fe23 Change kind header check in JumpToTag to proper function 2012-02-18 21:47:40 +13:00
Jan Larres 6eb2d65f41 Some clarifications in the documentation 2012-02-16 22:01:21 +13:00
Jan Larres 4d925ca324 Automatically detect ex-ctags as 'ectags' in OpenBSD 2012-02-12 19:21:37 +13:00
Jan Larres b56f2c0db2 Support Vala if anjuta-tags is available 2012-02-12 18:37:05 +13:00
Jan Larres 2149951be0 Check filetypes supported by ctags during init 2012-02-12 18:36:45 +13:00
Jan Larres 0f3cca5a84 Give more precise information if specified ctags not found 2012-02-12 18:35:54 +13:00
Jan Larres ba0123cc91 Fix bug when closing window before a valid files was seen 2012-02-02 21:07:13 +13:00
Jan Larres 392de7da25 Save new empty object for file if ctags output is empty, closes #57 2012-02-01 00:21:28 +13:00
Jan Larres cca0f7798e Add some debug messages 2012-01-31 20:59:06 +13:00
Jan Larres 8bb4a3c111 Abstract out window commands without autocommands 2012-01-31 20:58:49 +13:00
Jan Larres 52fe2b7c3a Try to jump to the correct window after closing, closes #56 2012-01-20 15:56:50 +13:00
Jan Larres 6a95bfbbc0 Only ignore BufEnter when jumping to tag 2012-01-18 18:38:34 +13:00
Jan Larres 2c2b3fb99e Use quitall in QuitIfOnlyWindow() 2012-01-14 19:35:50 +13:00
Jan Larres d48c6f83f5 Add 'always' parameter to autoopen() 2012-01-14 19:35:01 +13:00
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
Jan Larres b4ed33c4bc Version 2.0 2011-04-26 23:31:04 +12:00
Jan Larres 81f71d8c66 Update credits 2011-04-26 21:00:00 +12:00
Jan Larres 39a62ae9f4 Simplify some function signatures 2011-04-26 02:18:55 +12:00
Jan Larres 98270ed439 Doc configuration clarification 2011-04-26 02:07:03 +12:00
Jan Larres 25bbf9b889 Change TagbarScopeType highlight to TagbarType 2011-04-26 02:01:13 +12:00
Jan Larres 8490f6a5c2 Only highlight scopes that have children 2011-04-26 01:56:51 +12:00
Jan Larres b374ff5eab Support jsctags and other compatible programs 2011-04-25 19:32:19 +12:00
Jan Larres b25ab098da Allow jumping to a tag definition without leaving the Tagbar window 2011-04-25 16:09:40 +12:00
Jan Larres 28dcb9d290 Add functionality to automatically open parents of tags in closed folds 2011-04-24 22:53:07 +12:00
Jan Larres c2ad337c01 Delete fileinfo when deleting buffer 2011-04-24 20:15:02 +12:00
Jan Larres 3fe80bfbd6 Add ability to jump to next/previous top-level tag, closes #9 2011-04-24 13:58:06 +12:00
Jan Larres ef7aa33d7b Document ways of automatically opening Tagbar 2011-04-24 01:03:21 +12:00
Jan Larres 5fee41a7e1 Small doc clarifications 2011-04-24 00:50:02 +12:00
Jan Larres 8b378af5db Document highlight customization 2011-04-23 23:15:24 +12:00
Jan Larres d27c8b96bb Document new folding features 2011-04-23 22:51:45 +12:00
Jan Larres fb1025dcbc Make highlight syntax definition configurable 2011-04-14 03:59:13 +12:00
Jan Larres 42a87ec2d7 Update credits 2011-04-14 00:32:14 +12:00
Jan Larres 5458369ec6 Don't use internal folding stuff outside of members 2011-04-12 23:36:48 +12:00
Jan Larres f4f1dcbe3b Change default highlight for fold icons to make the background colours match 2011-04-09 22:00:00 +12:00
Jan Larres 4d5b30b1ce Fix statusline bug when opening Tagbar without having a valid file loaded 2011-04-09 03:33:59 +12:00
Jan Larres 3e4bd07b48 Fix displaying the filename in the statusbar 2011-04-09 02:09:19 +12:00
Jan Larres 1cc96abced Get rid of some 'git d' in ':silent' to be able to see errors 2011-04-08 13:17:50 +12:00
Jan Larres 8fd7c138ca Delete empty lines into the black hole register to avoid clobbering others 2011-04-08 12:53:50 +12:00
Jan Larres c3f41cb2ab Remove superfluous output line 2011-04-08 03:39:58 +12:00
Jan Larres df31cc81cd Delete empty lines at the end of the tagbar buffer 2011-04-08 03:15:52 +12:00
Jan Larres c9b43b665a Fix file update bug 2011-04-08 03:12:00 +12:00
Jan Larres fe4acfb1fb Fix bug with files with empty filetype 2011-04-08 02:42:08 +12:00
Jan Larres d123a8346e Fix bug with displaying files that don't have scopes 2011-04-08 01:18:01 +12:00
Jan Larres d2a39abd61 Only consider the main filetype, closes #10 2011-04-08 01:09:15 +12:00
Jan Larres 140c7c84c8 Refactor into a more object-oriented style and make folding more vim-like 2011-04-08 01:00:12 +12:00
Seth Milliken 649eead502 added more vim-like bindings for folding
- added zo alias to OpenFold()
- added za alias to ToggleFold()
- added zc alias to CloseFold()
- added zC alias to CloseParent()
- added zn alias to SetFoldLevel(99, 1)
- added zR alias to SetFoldLevel(99, 1)
- added zM alias to SetFoldLevel(0, 1)
- changed z zoom shortcut to zz to avoid delay caused by presence of new z-prefix bindings
- update s:PrintHelp() to reflect new bindings
2011-03-29 20:35:56 -07:00
Jan Larres e36d947b57 Don't call AutoUpdate() with ':silent' so that 'echo's will be printed 2011-03-29 02:18:38 +13:00
Jan Larres c581d048ca Fix fold marker bug on windows 2011-03-29 02:16:48 +13:00
Jan Larres efcf31ba74 Handle cases where the ctags binary is installed in a directory with spaces 2011-03-28 23:52:05 +13:00
Jan Larres 276fa842dc Allow using other arrows on windows 2011-03-28 23:02:29 +13:00
Jan Larres 4b7aca60a7 Fix bug with balloonexpr 2011-03-28 17:18:24 +13:00
Jan Larres 15d82f669c Fix bug with user-defined types that don't specify folds 2011-03-28 17:08:14 +13:00
Jan Larres fbeea744d2 expand() ctags path in case it is installed in home dir 2011-03-28 12:34:41 +13:00
Jan Larres 0cb1f55f6a Fold vim maps by default 2011-03-28 02:48:21 +13:00
Jan Larres 3fdfe14ddb Check for termencoding just in case 2011-03-28 01:49:51 +13:00
Jan Larres d256c9976b Display nice unicode fold icons if possible 2011-03-28 01:29:25 +13:00
Jan Larres 0c39715fa7 Support using the mouse for opening/closing folds 2011-03-28 00:34:50 +13:00
Jan Larres 17064c6978 Make foldlevel work like the built-in version 2011-03-27 19:47:56 +13:00
Jan Larres 96165b138b Extract PrintKinds() function 2011-03-27 16:46:41 +13:00
Jan Larres 7182f9640e Implement proper folding support 2011-03-27 03:32:31 +13:00
Jan Larres 151832d234 Save the view when redisplaying the same file to avoid distracting jumps (idea taken from NERDTree) 2011-03-22 01:37:18 +13:00
Jan Larres 3cd371910a Consolidate some parameters in scope-processing functions 2011-03-21 03:02:03 +13:00
Jan Larres ef91922190 Check if mappings exist when opening window, closes #7 2011-03-18 01:53:08 +13:00
Jan Larres 70cfb974a9 Revert "use redraw! instead of redraw"
This reverts commit 208413677f.
2011-03-11 19:29:27 +13:00
Taybin Rutkin 208413677f use redraw! instead of redraw 2011-03-10 15:50:25 -05:00
Jan Larres 518b07de12 Version 1.5 2011-03-06 23:47:27 +13:00
Jan Larres a9c352c134 Ensure that as much content as possible is shown in the Tagbar window 2011-03-06 23:00:13 +13:00
Jan Larres b176c930d0 Get rid of unneeded type def field 'scopes' 2011-03-06 19:52:54 +13:00
Jan Larres e84bffb6df Allow for extra ctags definition files in type definitions 2011-03-06 19:12:21 +13:00
Taybin Rutkin 07997460d1 update documentation for tagbar_autofocus 2011-03-05 19:29:52 +13:00
Taybin Rutkin eb1ccae17e Add g:tagbar_autofocus option to always move cursor to tagbar window when it opens 2011-03-05 19:29:26 +13:00
Taybin Rutkin d86d93dbf1 remove redundant code 2011-03-05 19:25:47 +13:00
Jan Larres a532d7c445 Make sure the whole Tagbar content is shown if it is shorter than the window height 2011-03-04 02:59:40 +13:00
Jan Larres 38a6c9f6a1 Make sure jumps to the Tagbar window don't end up at the bottom after file loading 2011-03-04 02:58:48 +13:00
Jan Larres 82eebf945e Don't do any highlighting if there's no tag above the cursor 2011-03-02 23:31:58 +13:00
Jan Larres f847c4631b Add 'redraw' in some places since auto-redraw doesn't always work 2011-03-02 23:29:36 +13:00
Jan Larres 84121aac7d Version 1.2 2011-02-28 18:12:36 +13:00
Jan Larres be86180c88 Small optimization 2011-02-28 18:08:47 +13:00
Jan Larres 9eb5ff5e1f Fix typo in Ruby definition 2011-02-28 18:08:31 +13:00
Jan Larres c67610eba3 Add history entry for 1.1 2011-02-26 22:48:39 +13:00
27 changed files with 9421 additions and 2074 deletions
+4
View File
@@ -0,0 +1,4 @@
.gitignore export-ignore
.gitattributes export-ignore
README export-ignore
.info export-ignore
+2
View File
@@ -0,0 +1,2 @@
github: [alerque]
custom: ['https://paypal.me/alerque', 'https://paypal.me/dhegland42']
+30
View File
@@ -0,0 +1,30 @@
name: Check
on: [push, pull_request]
jobs:
check:
strategy:
fail-fast: false
matrix:
vimFlavor: ["vim", "nvim"]
tagsProvider: ["exuberant-ctags", "universal-ctags"]
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Enable Universe package repository
run: |
sudo add-apt-repository universe
sudo apt-get update
- name: Install ${{ matrix.tagsProvider }}
run: |
sudo apt-get install ${{ matrix.tagsProvider }}
- name: Install ${{ matrix.vimFlavor }}
run: |
sudo apt-get install ${{ matrix.vimFlavor == 'nvim' && 'neovim' || 'vim' }}
- name: Review versions
run: |
ctags --version
${{ matrix.vimFlavor }} --version
- name: "Try tagbar#OpenWindow()"
run: |
${{ matrix.vimFlavor == 'nvim' && 'nvim -u /dev/null --headless' || 'vim' }} -i NONE "+set rtp+=$(pwd)" "+call tagbar#OpenWindow() | q" "+cq" plugin/tagbar.vim
+13
View File
@@ -0,0 +1,13 @@
name: Reviewdog
on: [pull_request]
jobs:
vint:
name: vint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: vint
uses: reviewdog/action-vint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
+15
View File
@@ -0,0 +1,15 @@
name: Vint
on: [push]
jobs:
vint:
name: vint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Setup dependencies
run: pip install vim-vint
- name: Lint Vimscript
run: vint .
+1
View File
@@ -0,0 +1 @@
tags
+2
View File
@@ -0,0 +1,2 @@
tagbar
3465
+5
View File
@@ -0,0 +1,5 @@
cmdargs:
severity: style_problem
color: true
env:
neovim: false
+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
preservim.github.io/tagbar and/or github.com/preservim/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.
-7
View File
@@ -1,7 +0,0 @@
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.
Check out the homepage at http://majutsushi.github.com/tagbar/ for more
information.
+100
View File
@@ -0,0 +1,100 @@
# Tagbar: a class outline viewer for Vim
[![Vint](https://github.com/preservim/tagbar/workflows/Vint/badge.svg)](https://github.com/preservim/tagbar/actions?workflow=Vint)
[![Check](https://github.com/preservim/tagbar/workflows/Check/badge.svg)](https://github.com/preservim/tagbar/actions?workflow=Check)
## What Tagbar is
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
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).
## Dependencies
* [Vim](http://www.vim.org/) >= 7.3.1058
or any version of [NeoVim](https://neovim.io/).
* A ctags implementation: We _highly recommend_ any version of [Universal
Ctags](https://ctags.io). It is a maintained fork of Exuberant Ctags with
many bugfixes, support for many more formats, and proper Unicode support.
[Exuberant Ctags](http://ctags.sourceforge.net/) 5.5 or higher works to some
degree but will be deprecated eventually.
Some additional formats can also be handled by other providers such as
[jsctags](https://github.com/sergioramos/jsctags) or
[phpctags](https://github.com/vim-php/phpctags).
## 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`.
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](https://github.com/majutsushi/tagbar/blob/master/doc/tagbar.txt) using `:help tagbar`.
## Support for additional filetypes
For filetypes that are not supported by Exuberant Ctags check out [the
wiki](https://github.com/preservim/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/preservim/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
Tagbar is distributed under the terms of the *Vim license*, see the included [LICENSE](LICENSE) file.
## Contributors
Tagbar was originally written by [Jan Larres](https://github.com/majutsushi).
It is actively maintained by [Caleb Maclennan](https://github.com/alerque) and [David Hegland](https://github.com/raven42).
At least [75 others have contributed](https://github.com/preservim/tagbar/graphs/contributors) features and bug fixes over the years.
Please document [issues](https://github.com/preservim/tagbar/issues) or submit [pull requests](https://github.com/preservim/tagbar/issues) on Github.
+4097
View File
File diff suppressed because it is too large Load Diff
+62
View File
@@ -0,0 +1,62 @@
function! tagbar#debug#start_debug(...) abort
let filename = a:0 > 0 ? a:1 : ''
if empty(filename)
let s:debug_file = 'tagbardebug.log'
else
let s:debug_file = filename
endif
" Clear log file and start it with version info
exe 'redir! > ' . s:debug_file
silent version
redir END
" Check whether the log file could be created
if !filewritable(s:debug_file)
echomsg 'Tagbar: Unable to create log file ' . s:debug_file
let s:debug_file = ''
return
endif
let s:debug_enabled = 1
endfunction
function! tagbar#debug#stop_debug() abort
let s:debug_enabled = 0
let s:debug_file = ''
endfunction
function! tagbar#debug#log(msg) abort
if s:debug_enabled
execute 'redir >> ' . s:debug_file
silent echon s:gettime() . ': ' . a:msg . "\n"
redir END
endif
endfunction
function! tagbar#debug#log_ctags_output(output) abort
if s:debug_enabled
exe 'redir! > ' . s:debug_file . '.ctags_out'
silent echon a:output
redir END
endif
endfunction
function! tagbar#debug#enabled() abort
return s:debug_enabled
endfunction
if has('reltime')
function! s:gettime() abort
let time = split(reltimestr(reltime()), '\.')
return strftime('%Y-%m-%d %H:%M:%S.', time[0]) . time[1]
endfunction
else
function! s:gettime() abort
return strftime('%Y-%m-%d %H:%M:%S')
endfunction
endif
let s:debug_enabled = 0
let s:debug_file = ''
+248
View File
@@ -0,0 +1,248 @@
let s:visibility_symbols = {
\ 'public' : '+',
\ 'protected' : '#',
\ 'private' : '-'
\ }
if exists('g:tagbar_visibility_symbols') && !empty(g:tagbar_visibility_symbols)
let s:visibility_symbols = g:tagbar_visibility_symbols
endif
function! tagbar#prototypes#basetag#new(name) abort
let newobj = {}
let newobj.name = a:name
let newobj.fields = {}
let newobj.fields.line = 0
let newobj.fields.column = 0
let newobj.fields.end = 0
let newobj.prototype = ''
let newobj.data_type = ''
let newobj.path = ''
let newobj.fullpath = a:name
let newobj.depth = 0
let newobj.parent = {}
let newobj.tline = -1
let newobj.fileinfo = {}
let newobj.typeinfo = {}
let newobj._childlist = []
let newobj._childdict = {}
let newobj.isNormalTag = function(s:add_snr('s:isNormalTag'))
let newobj.isPseudoTag = function(s:add_snr('s:isPseudoTag'))
let newobj.isSplitTag = function(s:add_snr('s:isSplitTag'))
let newobj.isKindheader = function(s:add_snr('s:isKindheader'))
let newobj.getPrototype = function(s:add_snr('s:getPrototype'))
let newobj.getDataType = function(s:add_snr('s:getDataType'))
let newobj._getPrefix = function(s:add_snr('s:_getPrefix'))
let newobj.initFoldState = function(s:add_snr('s:initFoldState'))
let newobj.getClosedParentTline = function(s:add_snr('s:getClosedParentTline'))
let newobj.isFoldable = function(s:add_snr('s:isFoldable'))
let newobj.isFolded = function(s:add_snr('s:isFolded'))
let newobj.openFold = function(s:add_snr('s:openFold'))
let newobj.closeFold = function(s:add_snr('s:closeFold'))
let newobj.setFolded = function(s:add_snr('s:setFolded'))
let newobj.openParents = function(s:add_snr('s:openParents'))
let newobj.addChild = function(s:add_snr('s:addChild'))
let newobj.getChildren = function(s:add_snr('s:getChildren'))
let newobj.getChildrenByName = function(s:add_snr('s:getChildrenByName'))
let newobj.removeChild = function(s:add_snr('s:removeChild'))
return newobj
endfunction
" s:isNormalTag() {{{1
function! s:isNormalTag() abort dict
return 0
endfunction
" s:isPseudoTag() {{{1
function! s:isPseudoTag() abort dict
return 0
endfunction
" s:isSplitTag {{{1
function! s:isSplitTag() abort dict
return 0
endfunction
" s:isKindheader() {{{1
function! s:isKindheader() abort dict
return 0
endfunction
" s:getPrototype() {{{1
function! s:getPrototype(short) abort dict
return self.prototype
endfunction
" s:getDataType() {{{1
function! s:getDataType() abort dict
return self.data_type
endfunction
" s:_getPrefix() {{{1
function! s:_getPrefix() abort dict
let fileinfo = self.fileinfo
if !empty(self._childlist)
if fileinfo.tagfolds[self.fields.kind][self.fullpath]
let prefix = g:tagbar#icon_closed
else
let prefix = g:tagbar#icon_open
endif
else
let prefix = ' '
endif
" Visibility is called 'access' in the ctags output
if g:tagbar_show_visibility
if has_key(self.fields, 'access')
let prefix .= get(s:visibility_symbols, self.fields.access, ' ')
elseif has_key(self.fields, 'file')
let prefix .= s:visibility_symbols.private
else
let prefix .= ' '
endif
endif
return prefix
endfunction
" s:initFoldState() {{{1
function! s:initFoldState(known_files) abort dict
let fileinfo = self.fileinfo
if a:known_files.has(fileinfo.fpath) &&
\ has_key(fileinfo, '_tagfolds_old') &&
\ has_key(fileinfo._tagfolds_old[self.fields.kind], self.fullpath)
" The file has been updated and the tag was there before, so copy its
" old fold state
let fileinfo.tagfolds[self.fields.kind][self.fullpath] =
\ fileinfo._tagfolds_old[self.fields.kind][self.fullpath]
elseif self.depth >= fileinfo.foldlevel
let fileinfo.tagfolds[self.fields.kind][self.fullpath] = 1
else
let fileinfo.tagfolds[self.fields.kind][self.fullpath] =
\ fileinfo.kindfolds[self.fields.kind]
endif
endfunction
" s:getClosedParentTline() {{{1
function! s:getClosedParentTline() abort dict
let tagline = self.tline
" Find the first closed parent, starting from the top of the hierarchy.
let parents = []
let curparent = self.parent
while !empty(curparent)
call add(parents, curparent)
let curparent = curparent.parent
endwhile
for parent in reverse(parents)
if parent.isFolded()
let tagline = parent.tline
break
endif
endfor
return tagline
endfunction
" s:isFoldable() {{{1
function! s:isFoldable() abort dict
return !empty(self._childlist)
endfunction
" s:isFolded() {{{1
function! s:isFolded() abort dict
return self.fileinfo.tagfolds[self.fields.kind][self.fullpath]
endfunction
" s:openFold() {{{1
function! s:openFold() abort dict
if self.isFoldable()
let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = 0
endif
endfunction
" s:closeFold() {{{1
function! s:closeFold() abort dict
let newline = line('.')
if !empty(self.parent) && self.parent.isKindheader()
" Tag is child of generic 'kind'
call self.parent.closeFold()
let newline = self.parent.tline
elseif self.isFoldable() && !self.isFolded()
" Tag is parent of a scope and is not folded
let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = 1
let newline = self.tline
elseif !empty(self.parent)
" Tag is normal child, so close parent
let parent = self.parent
let self.fileinfo.tagfolds[parent.fields.kind][parent.fullpath] = 1
let newline = parent.tline
endif
return newline
endfunction
" s:setFolded() {{{1
function! s:setFolded(folded) abort dict
let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = a:folded
endfunction
" s:openParents() {{{1
function! s:openParents() abort dict
let parent = self.parent
while !empty(parent)
call parent.openFold()
let parent = parent.parent
endwhile
endfunction
" s:addChild() {{{1
function! s:addChild(tag) abort dict
call add(self._childlist, a:tag)
if has_key(self._childdict, a:tag.name)
call add(self._childdict[a:tag.name], a:tag)
else
let self._childdict[a:tag.name] = [a:tag]
endif
endfunction
" s:getChildren() {{{1
function! s:getChildren() dict abort
return self._childlist
endfunction
" s:getChildrenByName() {{{1
function! s:getChildrenByName(tagname) dict abort
return get(self._childdict, a:tagname, [])
endfunction
" s:removeChild() {{{1
function! s:removeChild(tag) dict abort
let idx = index(self._childlist, a:tag)
if idx >= 0
call remove(self._childlist, idx)
endif
let namelist = get(self._childdict, a:tag.name, [])
let idx = index(namelist, a:tag)
if idx >= 0
call remove(namelist, idx)
endif
endfunction
" s:add_snr() {{{1
function! s:add_snr(funcname) abort
if !exists('s:snr')
let s:snr = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeget_snr$')
endif
return s:snr . a:funcname
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
+156
View File
@@ -0,0 +1,156 @@
function! tagbar#prototypes#fileinfo#new(fname, ftype, typeinfo) abort
let newobj = {}
" The complete file path
let newobj.fpath = a:fname
let newobj.bufnr = bufnr(a:fname)
" File modification time
let newobj.mtime = getftime(a:fname)
" Get file size
let newobj.fsize = getfsize(a:fname)
" Get the number of lines in the file
let newobj.lnum = line('$')
" The vim file type
let newobj.ftype = a:ftype
" List of the tags that are present in the file, sorted according to the
" value of 'g:tagbar_sort'
let newobj._taglist = []
let newobj._tagdict = {}
" Dictionary of the tags, indexed by line number in the file
let newobj.fline = {}
" Dictionary of the tags, indexed by line number in the tagbar
let newobj.tline = {}
" Dictionary of the folding state of 'kind's, indexed by short name
let newobj.kindfolds = {}
let newobj.typeinfo = a:typeinfo
" copy the default fold state from the type info
for kind in a:typeinfo.kinds
let newobj.kindfolds[kind.short] =
\ g:tagbar_foldlevel == 0 ? 1 : kind.fold
endfor
" Dictionary of dictionaries of the folding state of individual tags,
" indexed by kind and full path
let newobj.tagfolds = {}
for kind in a:typeinfo.kinds
let newobj.tagfolds[kind.short] = {}
endfor
" The current foldlevel of the file
let newobj.foldlevel = g:tagbar_foldlevel
let newobj.addTag = function(s:add_snr('s:addTag'))
let newobj.getTags = function(s:add_snr('s:getTags'))
let newobj.getTagsByName = function(s:add_snr('s:getTagsByName'))
let newobj.removeTag = function(s:add_snr('s:removeTag'))
let newobj.reset = function(s:add_snr('s:reset'))
let newobj.clearOldFolds = function(s:add_snr('s:clearOldFolds'))
let newobj.sortTags = function(s:add_snr('s:sortTags'))
let newobj.openKindFold = function(s:add_snr('s:openKindFold'))
let newobj.closeKindFold = function(s:add_snr('s:closeKindFold'))
" This is used during file processing. If the limit is exceeded at that
" point, then mark this flag for displaying to the tagbar window
let newobj.fsize_exceeded = 0
return newobj
endfunction
" s:addTag() {{{1
function! s:addTag(tag) abort dict
call add(self._taglist, a:tag)
if has_key(self._tagdict, a:tag.name)
call add(self._tagdict[a:tag.name], a:tag)
else
let self._tagdict[a:tag.name] = [a:tag]
endif
endfunction
" s:getTags() {{{1
function! s:getTags() dict abort
return self._taglist
endfunction
" s:getTagsByName() {{{1
function! s:getTagsByName(tagname) dict abort
return get(self._tagdict, a:tagname, [])
endfunction
" s:removeTag() {{{1
function! s:removeTag(tag) dict abort
let idx = index(self._taglist, a:tag)
if idx >= 0
call remove(self._taglist, idx)
endif
let namelist = get(self._tagdict, a:tag.name, [])
let idx = index(namelist, a:tag)
if idx >= 0
call remove(namelist, idx)
endif
endfunction
" s:reset() {{{1
" Reset stuff that gets regenerated while processing a file and save the old
" tag folds
function! s:reset() abort dict
let self.mtime = getftime(self.fpath)
let self._taglist = []
let self._tagdict = {}
let self.fline = {}
let self.tline = {}
let self._tagfolds_old = self.tagfolds
let self.tagfolds = {}
for kind in self.typeinfo.kinds
let self.tagfolds[kind.short] = {}
endfor
endfunction
" s:clearOldFolds() {{{1
function! s:clearOldFolds() abort dict
if exists('self._tagfolds_old')
unlet self._tagfolds_old
endif
endfunction
" s:sortTags() {{{1
function! s:sortTags(compare_typeinfo) abort dict
if get(a:compare_typeinfo, 'sort', g:tagbar_sort)
call tagbar#sorting#sort(self._taglist, 'kind', a:compare_typeinfo)
else
call tagbar#sorting#sort(self._taglist, 'line', a:compare_typeinfo)
endif
endfunction
" s:openKindFold() {{{1
function! s:openKindFold(kind) abort dict
let self.kindfolds[a:kind.short] = 0
endfunction
" s:closeKindFold() {{{1
function! s:closeKindFold(kind) abort dict
let self.kindfolds[a:kind.short] = 1
endfunction
" s:add_snr() {{{1
function! s:add_snr(funcname) abort
if !exists('s:snr')
let s:snr = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeget_snr$')
endif
return s:snr . a:funcname
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
@@ -0,0 +1,61 @@
function! tagbar#prototypes#kindheadertag#new(name) abort
let newobj = tagbar#prototypes#basetag#new(a:name)
let newobj.isKindheader = function(s:add_snr('s:isKindheader'))
let newobj.getPrototype = function(s:add_snr('s:getPrototype'))
let newobj.isFoldable = function(s:add_snr('s:isFoldable'))
let newobj.isFolded = function(s:add_snr('s:isFolded'))
let newobj.openFold = function(s:add_snr('s:openFold'))
let newobj.closeFold = function(s:add_snr('s:closeFold'))
let newobj.toggleFold = function(s:add_snr('s:toggleFold'))
return newobj
endfunction
" s:isKindheader() {{{1
function! s:isKindheader() abort dict
return 1
endfunction
" s:getPrototype() {{{1
function! s:getPrototype(short) abort dict
return self.name . ': ' .
\ self.numtags . ' ' . (self.numtags > 1 ? 'tags' : 'tag')
endfunction
" s:isFoldable() {{{1
function! s:isFoldable() abort dict
return 1
endfunction
" s:isFolded() {{{1
function! s:isFolded() abort dict
return self.fileinfo.kindfolds[self.short]
endfunction
" s:openFold() {{{1
function! s:openFold() abort dict
let self.fileinfo.kindfolds[self.short] = 0
endfunction
" s:closeFold() {{{1
function! s:closeFold() abort dict
let self.fileinfo.kindfolds[self.short] = 1
return line('.')
endfunction
" s:toggleFold() {{{1
function! s:toggleFold(fileinfo) abort dict
let a:fileinfo.kindfolds[self.short] = !a:fileinfo.kindfolds[self.short]
endfunction
" s:add_snr() {{{1
function! s:add_snr(funcname) abort
if !exists('s:snr')
let s:snr = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeget_snr$')
endif
return s:snr . a:funcname
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
+181
View File
@@ -0,0 +1,181 @@
function! s:maybe_map_scope(scopestr) abort
if !empty(g:tagbar_scopestrs)
if has_key(g:tagbar_scopestrs, a:scopestr)
return g:tagbar_scopestrs[a:scopestr]
endif
endif
return a:scopestr
endfunction
function! tagbar#prototypes#normaltag#new(name) abort
let newobj = tagbar#prototypes#basetag#new(a:name)
let newobj.isNormalTag = function(s:add_snr('s:isNormalTag'))
let newobj.strfmt = function(s:add_snr('s:strfmt'))
let newobj.str = function(s:add_snr('s:str'))
let newobj.getPrototype = function(s:add_snr('s:getPrototype'))
let newobj.getDataType = function(s:add_snr('s:getDataType'))
return newobj
endfunction
" s:isNormalTag() {{{1
function! s:isNormalTag() abort dict
return 1
endfunction
" s:strfmt() {{{1
function! s:strfmt() abort dict
let typeinfo = self.typeinfo
let suffix = get(self.fields, 'signature', '')
if has_key(self.fields, 'type')
let suffix .= ' : ' . self.fields.type
elseif has_key(get(typeinfo, 'kind2scope', {}), self.fields.kind)
let scope = s:maybe_map_scope(typeinfo.kind2scope[self.fields.kind])
if !g:tagbar_show_data_type
let suffix .= ' : ' . scope
endif
endif
let prefix = self._getPrefix()
if g:tagbar_show_data_type && self.getDataType() !=# ''
let suffix .= ' : ' . self.getDataType()
endif
if g:tagbar_show_tag_linenumbers == 1
let suffix .= ' [' . self.fields.line . ']'
elseif g:tagbar_show_tag_linenumbers == 2
let prefix .= '[' . self.fields.line . '] '
endif
return prefix . self.name . suffix
endfunction
" s:str() {{{1
function! s:str(longsig, full) abort dict
if a:full && self.path !=# ''
let str = self.path . self.typeinfo.sro . self.name
else
let str = self.name
endif
if has_key(self.fields, 'signature')
if a:longsig
let str .= self.fields.signature
else
let str .= '()'
endif
endif
return str
endfunction
" s:getPrototype() {{{1
function! s:getPrototype(short) abort dict
if self.prototype !=# ''
let prototype = self.prototype
else
let bufnr = self.fileinfo.bufnr
if self.fields.line == 0 || !bufloaded(bufnr)
" No linenumber available or buffer not loaded (probably due to
" 'nohidden'), try the pattern instead
return substitute(self.pattern, '^\\M\\^\\C\s*\(.*\)\\$$', '\1', '')
endif
let line = getbufline(bufnr, self.fields.line)[0]
" If prototype includes declaration, remove the '=' and anything after
" FIXME: Need to remove this code. This breaks python prototypes that
" can include a '=' in the function paramter list.
" ex: function(arg1, optional_arg2=False)
" let line = substitute(line, '\s*=.*', '', '')
let list = split(line, '\zs')
let start = index(list, '(')
if start == -1
return substitute(line, '^\s\+', '', '')
endif
let opening = count(list, '(', 0, start)
let closing = count(list, ')', 0, start)
if closing >= opening
return substitute(line, '^\s\+', '', '')
endif
let balance = opening - closing
let prototype = line
let curlinenr = self.fields.line + 1
while balance > 0 && curlinenr < line('$')
let curline = getbufline(bufnr, curlinenr)[0]
let curlist = split(curline, '\zs')
let balance += count(curlist, '(')
let balance -= count(curlist, ')')
let prototype .= "\n" . curline
let curlinenr += 1
endwhile
let self.prototype = prototype
endif
if a:short
" join all lines and remove superfluous spaces
let prototype = substitute(prototype, '^\s\+', '', '')
let prototype = substitute(prototype, '\_s\+', ' ', 'g')
let prototype = substitute(prototype, '(\s\+', '(', 'g')
let prototype = substitute(prototype, '\s\+)', ')', 'g')
" Avoid hit-enter prompts
let maxlen = &columns - 12
if len(prototype) > maxlen
let prototype = prototype[:maxlen - 1 - 3]
let prototype .= '...'
endif
endif
return prototype
endfunction
" s:getDataType() {{{1
function! s:getDataType() abort dict
if self.data_type !=# ''
let data_type = self.data_type
else
" This is a fallthrough attempt to derive the data_type from the line
" in the event ctags doesn't return the typeref field
let bufnr = self.fileinfo.bufnr
if self.fields.line == 0 || !bufloaded(bufnr)
" No linenumber available or buffer not loaded (probably due to
" 'nohidden'), try the pattern instead
return substitute(self.pattern, '^\\M\\^\\C\s*\(.*\)\\$$', '\1', '')
endif
let line = getbufline(bufnr, self.fields.line)[0]
let data_type = substitute(line, '\s*' . escape(self.name, '~') . '.*', '', '')
" Strip off the path if we have one along with any spaces prior to the
" path
if self.path !=# ''
let data_type = substitute(data_type, '\s*' . self.path . self.typeinfo.sro, '', '')
endif
" Strip off leading spaces
let data_type = substitute(data_type, '^\s\+', '', '')
let self.data_type = data_type
endif
return data_type
endfunction
" s:add_snr() {{{1
function! s:add_snr(funcname) abort
if !exists('s:snr')
let s:snr = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeget_snr$')
endif
return s:snr . a:funcname
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
+43
View File
@@ -0,0 +1,43 @@
function! tagbar#prototypes#pseudotag#new(name) abort
let newobj = tagbar#prototypes#basetag#new(a:name)
let newobj.isPseudoTag = function(s:add_snr('s:isPseudoTag'))
let newobj.strfmt = function(s:add_snr('s:strfmt'))
return newobj
endfunction
" s:isPseudoTag() {{{1
function! s:isPseudoTag() abort dict
return 1
endfunction
" s:strfmt() {{{1
function! s:strfmt() abort dict
let typeinfo = self.typeinfo
let suffix = get(self.fields, 'signature', '')
if has_key(typeinfo.kind2scope, self.fields.kind)
let suffix .= ' : ' . typeinfo.kind2scope[self.fields.kind]
endif
let prefix = self._getPrefix()
if g:tagbar_show_tag_linenumbers == 1
let suffix .= ' [' . self.fields.line . ']'
elseif g:tagbar_show_tag_linenumbers == 2
let prefix .= '[' . self.fields.line . '] '
endif
return prefix . self.name . '*' . suffix
endfunction
" s:add_snr() {{{1
function! s:add_snr(funcname) abort
if !exists('s:snr')
let s:snr = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeget_snr$')
endif
return s:snr . a:funcname
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
+26
View File
@@ -0,0 +1,26 @@
" A tag that was created because of a tag name that covers multiple scopes
" Inherits the fields of the "main" tag it was split from.
" May be replaced during tag processing if it appears as a normal tag later,
" just like a pseudo tag.
function! tagbar#prototypes#splittag#new(name) abort
let newobj = tagbar#prototypes#normaltag#new(a:name)
let newobj.isSplitTag = function(s:add_snr('s:isSplitTag'))
return newobj
endfunction
function! s:isSplitTag() abort dict
return 1
endfunction
function! s:add_snr(funcname) abort
if !exists('s:snr')
let s:snr = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeget_snr$')
endif
return s:snr . a:funcname
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
+43
View File
@@ -0,0 +1,43 @@
function! tagbar#prototypes#typeinfo#new(...) abort
let newobj = {}
let newobj.kinddict = {}
if a:0 > 0
call extend(newobj, a:1)
endif
let newobj.getKind = function(s:add_snr('s:getKind'))
let newobj.createKinddict = function(s:add_snr('s:createKinddict'))
return newobj
endfunction
" s:getKind() {{{1
function! s:getKind(kind) abort dict
"let idx = self.kinddict[a:kind]
let idx = has_key(self.kinddict, a:kind) ? self.kinddict[a:kind] : -1
return self.kinds[idx]
endfunction
" s:createKinddict() {{{1
" Create a dictionary of the kind order for fast access in sorting functions
function! s:createKinddict() abort dict
let i = 0
for kind in self.kinds
let self.kinddict[kind.short] = i
let i += 1
endfor
let self.kinddict['?'] = i
endfunction
" s:add_snr() {{{1
function! s:add_snr(funcname) abort
if !exists('s:snr')
let s:snr = matchstr(expand('<sfile>'), '<SNR>\d\+_\zeget_snr$')
endif
return s:snr . a:funcname
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
+63
View File
@@ -0,0 +1,63 @@
" Script-local variable needed since compare functions can't
" take additional arguments
let s:compare_typeinfo = {}
function! tagbar#sorting#sort(tags, compareby, compare_typeinfo) abort
let s:compare_typeinfo = a:compare_typeinfo
let comparemethod =
\ a:compareby ==# 'kind' ? 's:compare_by_kind' : 's:compare_by_line'
call sort(a:tags, comparemethod)
for tag in a:tags
if !empty(tag.getChildren())
call tagbar#sorting#sort(tag.getChildren(), a:compareby,
\ a:compare_typeinfo)
endif
endfor
endfunction
function! s:compare_by_kind(tag1, tag2) abort
let typeinfo = s:compare_typeinfo
if !has_key(typeinfo.kinddict, a:tag1.fields.kind)
return -1
endif
if !has_key(typeinfo.kinddict, a:tag2.fields.kind)
return 1
endif
if typeinfo.kinddict[a:tag1.fields.kind] <#
\ typeinfo.kinddict[a:tag2.fields.kind]
return -1
elseif typeinfo.kinddict[a:tag1.fields.kind] >#
\ typeinfo.kinddict[a:tag2.fields.kind]
return 1
else
" Ignore '~' prefix for C++ destructors to sort them directly under
" the constructors
if a:tag1.name[0] ==# '~'
let name1 = a:tag1.name[1:]
else
let name1 = a:tag1.name
endif
if a:tag2.name[0] ==# '~'
let name2 = a:tag2.name[1:]
else
let name2 = a:tag2.name
endif
let ci = g:tagbar_case_insensitive
if (((!ci) && (name1 <=# name2)) || (ci && (name1 <=? name2)))
return -1
else
return 1
endif
endif
endfunction
function! s:compare_by_line(tag1, tag2) abort
return a:tag1.fields.line - a:tag2.fields.line
endfunction
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
+51
View File
@@ -0,0 +1,51 @@
function! tagbar#state#get_current_file(force_current) abort
return s:get().getCurrent(a:force_current)
endfunction
function! tagbar#state#set_current_file(fileinfo) abort
call s:get().setCurrentFile(a:fileinfo)
endfunction
function! tagbar#state#set_paused() abort
call s:get().setPaused()
endfunction
function! s:get() abort
if !exists('t:tagbar_state')
let t:tagbar_state = s:State.New()
endif
return t:tagbar_state
endfunction
let s:State = {
\ '_current' : {},
\ '_paused' : {},
\ }
" s:state.New() {{{1
function! s:State.New() abort dict
return deepcopy(self)
endfunction
" s:state.getCurrent() {{{1
function! s:State.getCurrent(force_current) abort dict
if !tagbar#is_paused() || a:force_current
return self._current
else
return self._paused
endif
endfunction
" s:state.setCurrentFile() {{{1
function! s:State.setCurrentFile(fileinfo) abort dict
let self._current = a:fileinfo
endfunction
" s:state.setPaused() {{{1
function! s:State.setPaused() abort dict
let self._paused = self._current
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
+789
View File
@@ -0,0 +1,789 @@
" Type definitions for standard Exuberant Ctags
function! tagbar#types#ctags#init(supported_types) abort
let types = {}
" Ant {{{1
let type_ant = tagbar#prototypes#typeinfo#new()
let type_ant.ctagstype = 'ant'
let type_ant.kinds = [
\ {'short' : 'p', 'long' : 'projects', 'fold' : 0, 'stl' : 1},
\ {'short' : 't', 'long' : 'targets', 'fold' : 0, 'stl' : 1}
\ ]
let types.ant = type_ant
" Asm {{{1
let type_asm = tagbar#prototypes#typeinfo#new()
let type_asm.ctagstype = 'asm'
let type_asm.kinds = [
\ {'short' : 'm', 'long' : 'macros', 'fold' : 0, 'stl' : 1},
\ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1},
\ {'short' : 'd', 'long' : 'defines', 'fold' : 0, 'stl' : 1},
\ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}
\ ]
let types.asm = type_asm
" ASP {{{1
let type_aspvbs = tagbar#prototypes#typeinfo#new()
let type_aspvbs.ctagstype = 'asp'
let type_aspvbs.kinds = [
\ {'short' : 'd', 'long' : 'constants', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}
\ ]
let types.aspvbs = type_aspvbs
" Asymptote {{{1
" Asymptote gets parsed well using filetype = c
let type_asy = tagbar#prototypes#typeinfo#new()
let type_asy.ctagstype = 'c'
let type_asy.kinds = [
\ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
\ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0},
\ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
\ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
\ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0},
\ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
\ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
\ ]
let type_asy.sro = '::'
let type_asy.kind2scope = {
\ 'g' : 'enum',
\ 's' : 'struct',
\ 'u' : 'union'
\ }
let type_asy.scope2kind = {
\ 'enum' : 'g',
\ 'struct' : 's',
\ 'union' : 'u'
\ }
let types.asy = type_asy
" Awk {{{1
let type_awk = tagbar#prototypes#typeinfo#new()
let type_awk.ctagstype = 'awk'
let type_awk.kinds = [
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
\ ]
let types.awk = type_awk
" Basic {{{1
let type_basic = tagbar#prototypes#typeinfo#new()
let type_basic.ctagstype = 'basic'
let type_basic.kinds = [
\ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 1},
\ {'short' : 'g', 'long' : 'enumerations', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
\ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}
\ ]
let types.basic = type_basic
" BETA {{{1
let type_beta = tagbar#prototypes#typeinfo#new()
let type_beta.ctagstype = 'beta'
let type_beta.kinds = [
\ {'short' : 'f', 'long' : 'fragments', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'slots', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'patterns', 'fold' : 0, 'stl' : 1}
\ ]
let types.beta = type_beta
" C {{{1
let type_c = tagbar#prototypes#typeinfo#new()
let type_c.ctagstype = 'c'
let type_c.kinds = [
\ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
\ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0},
\ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
\ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
\ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0},
\ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
\ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
\ ]
let type_c.sro = '::'
let type_c.kind2scope = {
\ 'g' : 'enum',
\ 's' : 'struct',
\ 'u' : 'union'
\ }
let type_c.scope2kind = {
\ 'enum' : 'g',
\ 'struct' : 's',
\ 'union' : 'u'
\ }
let types.c = type_c
let types.lpc = type_c
" C++ {{{1
let type_cpp = tagbar#prototypes#typeinfo#new()
let type_cpp.ctagstype = 'c++'
let type_cpp.kinds = [
\ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
\ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0},
\ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
\ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
\ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0},
\ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
\ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}
\ ]
let type_cpp.sro = '::'
let type_cpp.kind2scope = {
\ 'g' : 'enum',
\ 'n' : 'namespace',
\ 'c' : 'class',
\ 's' : 'struct',
\ 'u' : 'union'
\ }
let type_cpp.scope2kind = {
\ 'enum' : 'g',
\ 'namespace' : 'n',
\ 'class' : 'c',
\ 'struct' : 's',
\ 'union' : 'u'
\ }
let types.cpp = type_cpp
let types.cuda = type_cpp
" C# {{{1
let type_cs = tagbar#prototypes#typeinfo#new()
let type_cs.ctagstype = 'c#'
let type_cs.kinds = [
\ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
\ {'short' : 'f', 'long' : 'fields', 'fold' : 0, 'stl' : 1},
\ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
\ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
\ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 1},
\ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1},
\ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
\ {'short' : 'E', 'long' : 'events', 'fold' : 0, 'stl' : 1},
\ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
\ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 1}
\ ]
let type_cs.sro = '.'
let type_cs.kind2scope = {
\ 'n' : 'namespace',
\ 'i' : 'interface',
\ 'c' : 'class',
\ 's' : 'struct',
\ 'g' : 'enum'
\ }
let type_cs.scope2kind = {
\ 'namespace' : 'n',
\ 'interface' : 'i',
\ 'class' : 'c',
\ 'struct' : 's',
\ 'enum' : 'g'
\ }
let types.cs = type_cs
" COBOL {{{1
let type_cobol = tagbar#prototypes#typeinfo#new()
let type_cobol.ctagstype = 'cobol'
let type_cobol.kinds = [
\ {'short' : 'd', 'long' : 'data items', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'file descriptions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'g', 'long' : 'group items', 'fold' : 0, 'stl' : 1},
\ {'short' : 'p', 'long' : 'paragraphs', 'fold' : 0, 'stl' : 1},
\ {'short' : 'P', 'long' : 'program ids', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1}
\ ]
let types.cobol = type_cobol
" Crystal {{{1
let type_crystal = tagbar#prototypes#typeinfo#new()
let type_crystal.ctagstype = 'crystal'
let type_crystal.kinds = [
\ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'd', 'long' : 'defs', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'M', 'long' : 'macros', 'fold' : 0, 'stl' : 1},
\ {'short' : 'l', 'long' : 'libs', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
\ {'short' : 'a', 'long' : 'aliases', 'fold' : 0, 'stl' : 1}
\ ]
let type_crystal.sro = '::'
let types.crystal = type_crystal
" DOS Batch {{{1
let type_dosbatch = tagbar#prototypes#typeinfo#new()
let type_dosbatch.ctagstype = 'dosbatch'
let type_dosbatch.kinds = [
\ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}
\ ]
let types.dosbatch = type_dosbatch
" Eiffel {{{1
let type_eiffel = tagbar#prototypes#typeinfo#new()
let type_eiffel.ctagstype = 'eiffel'
let type_eiffel.kinds = [
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'features', 'fold' : 0, 'stl' : 1}
\ ]
let type_eiffel.sro = '.' " Not sure, is nesting even possible?
let type_eiffel.kind2scope = {
\ 'c' : 'class',
\ 'f' : 'feature'
\ }
let type_eiffel.scope2kind = {
\ 'class' : 'c',
\ 'feature' : 'f'
\ }
let types.eiffel = type_eiffel
" Erlang {{{1
let type_erlang = tagbar#prototypes#typeinfo#new()
let type_erlang.ctagstype = 'erlang'
let type_erlang.kinds = [
\ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
\ {'short' : 'd', 'long' : 'macro definitions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'r', 'long' : 'record definitions', 'fold' : 0, 'stl' : 1}
\ ]
let type_erlang.sro = '.' " Not sure, is nesting even possible?
let type_erlang.kind2scope = {
\ 'm' : 'module'
\ }
let type_erlang.scope2kind = {
\ 'module' : 'm'
\ }
let types.erlang = type_erlang
" Flex {{{1
" Vim doesn't support Flex out of the box, this is based on rough
" guesses and probably requires
" http://www.vim.org/scripts/script.php?script_id=2909
" Improvements welcome!
let type_as = tagbar#prototypes#typeinfo#new()
let type_as.ctagstype = 'flex'
let type_as.kinds = [
\ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0},
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
\ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'x', 'long' : 'mxtags', 'fold' : 0, 'stl' : 0}
\ ]
let type_as.sro = '.'
let type_as.kind2scope = {
\ 'c' : 'class'
\ }
let type_as.scope2kind = {
\ 'class' : 'c'
\ }
let types.mxml = type_as
let types.actionscript = type_as
" Fortran {{{1
let type_fortran = tagbar#prototypes#typeinfo#new()
let type_fortran.ctagstype = 'fortran'
let type_fortran.kinds = [
\ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
\ {'short' : 'p', 'long' : 'programs', 'fold' : 0, 'stl' : 1},
\ {'short' : 'k', 'long' : 'components', 'fold' : 0, 'stl' : 1},
\ {'short' : 't', 'long' : 'derived types and structures', 'fold' : 0,
\ 'stl' : 1},
\ {'short' : 'c', 'long' : 'common blocks', 'fold' : 0, 'stl' : 1},
\ {'short' : 'b', 'long' : 'block data', 'fold' : 0, 'stl' : 0},
\ {'short' : 'e', 'long' : 'entry points', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1},
\ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
\ {'short' : 'n', 'long' : 'namelists', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}
\ ]
let type_fortran.sro = '.' " Not sure, is nesting even possible?
let type_fortran.kind2scope = {
\ 'm' : 'module',
\ 'p' : 'program',
\ 'f' : 'function',
\ 's' : 'subroutine'
\ }
let type_fortran.scope2kind = {
\ 'module' : 'm',
\ 'program' : 'p',
\ 'function' : 'f',
\ 'subroutine' : 's'
\ }
let types.fortran = type_fortran
" Go {{{1
let type_go = tagbar#prototypes#typeinfo#new()
let type_go.ctagstype = 'go'
let type_go.kinds = [
\ {'short' : 'p', 'long' : 'packages', 'fold' : 0, 'stl' : 0},
\ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 0},
\ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0},
\ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
\ {'short' : 'm', 'long' : 'struct members', 'fold' : 0, 'stl' : 0},
\ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}
\ ]
let type_go.sro = '.'
let type_go.kind2scope = {
\ 's' : 'struct'
\ }
let type_go.scope2kind = {
\ 'struct' : 's'
\ }
let types.go = type_go
" HTML {{{1
let type_html = tagbar#prototypes#typeinfo#new()
let type_html.ctagstype = 'html'
let type_html.kinds = [
\ {'short' : 'f', 'long' : 'JavaScript functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'a', 'long' : 'named anchors', 'fold' : 0, 'stl' : 1}
\ ]
let types.html = type_html
" Java {{{1
let type_java = tagbar#prototypes#typeinfo#new()
let type_java.ctagstype = 'java'
let type_java.kinds = [
\ {'short' : 'p', 'long' : 'packages', 'fold' : 1, 'stl' : 0},
\ {'short' : 'f', 'long' : 'fields', 'fold' : 0, 'stl' : 0},
\ {'short' : 'g', 'long' : 'enum types', 'fold' : 0, 'stl' : 1},
\ {'short' : 'e', 'long' : 'enum constants', 'fold' : 0, 'stl' : 0},
\ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}
\ ]
let type_java.sro = '.'
let type_java.kind2scope = {
\ 'g' : 'enum',
\ 'i' : 'interface',
\ 'c' : 'class'
\ }
let type_java.scope2kind = {
\ 'enum' : 'g',
\ 'interface' : 'i',
\ 'class' : 'c'
\ }
let types.java = type_java
" JavaScript {{{1
let type_javascript = tagbar#prototypes#typeinfo#new()
let type_javascript.ctagstype = 'javascript'
let type_javascript.kinds = [
\ {'short': 'v', 'long': 'global variables', 'fold': 0, 'stl': 0},
\ {'short': 'c', 'long': 'classes', 'fold': 0, 'stl': 1},
\ {'short': 'p', 'long': 'properties', 'fold': 0, 'stl': 0},
\ {'short': 'm', 'long': 'methods', 'fold': 0, 'stl': 1},
\ {'short': 'f', 'long': 'functions', 'fold': 0, 'stl': 1},
\ ]
let type_javascript.sro = '.'
let type_javascript.kind2scope = {
\ 'c' : 'class',
\ 'f' : 'function',
\ 'm' : 'method',
\ 'p' : 'property',
\ }
let type_javascript.scope2kind = {
\ 'class' : 'c',
\ 'function' : 'f',
\ }
let types.javascript = type_javascript
" Lisp {{{1
let type_lisp = tagbar#prototypes#typeinfo#new()
let type_lisp.ctagstype = 'lisp'
let type_lisp.kinds = [
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
\ ]
let types.lisp = type_lisp
let types.clojure = type_lisp
" Lua {{{1
let type_lua = tagbar#prototypes#typeinfo#new()
let type_lua.ctagstype = 'lua'
let type_lua.kinds = [
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
\ ]
let types.lua = type_lua
" Make {{{1
let type_make = tagbar#prototypes#typeinfo#new()
let type_make.ctagstype = 'make'
let type_make.kinds = [
\ {'short' : 'm', 'long' : 'macros', 'fold' : 0, 'stl' : 1}
\ ]
let types.make = type_make
" Matlab {{{1
let type_matlab = tagbar#prototypes#typeinfo#new()
let type_matlab.ctagstype = 'matlab'
let type_matlab.kinds = [
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
\ ]
let types.matlab = type_matlab
" ObjectiveC {{{1
let type_objc = tagbar#prototypes#typeinfo#new()
let type_objc.ctagstype = 'objectivec'
let type_objc.kinds = [
\ {'short' : 'M', 'long' : 'preprocessor macros', 'fold' : 1, 'stl' : 0},
\ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0},
\ {'short' : 'i', 'long' : 'class interfaces', 'fold' : 0, 'stl' : 1},
\ {'short' : 'I', 'long' : 'class implementations', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'class methods', 'fold' : 0, 'stl' : 1},
\ {'short' : 'F', 'long' : 'object fields', 'fold' : 0, 'stl' : 0},
\ {'short' : 'm', 'long' : 'object methods', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'type structures', 'fold' : 0, 'stl' : 1},
\ {'short' : 't', 'long' : 'type aliases', 'fold' : 0, 'stl' : 1},
\ {'short' : 'e', 'long' : 'enumerations', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 0},
\ ]
let type_objc.sro = ':'
let type_objc.kind2scope = {
\ 'i' : 'interface',
\ 'I' : 'implementation',
\ 's' : 'struct',
\ }
let type_objc.scope2kind = {
\ 'interface' : 'i',
\ 'implementation' : 'I',
\ 'struct' : 's',
\ }
let types.objc = type_objc
let types.objcpp = type_objc
" Ocaml {{{1
let type_ocaml = tagbar#prototypes#typeinfo#new()
let type_ocaml.ctagstype = 'ocaml'
let type_ocaml.kinds = [
\ {'short' : 'M', 'long' : 'modules or functors', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0},
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'C', 'long' : 'constructors', 'fold' : 0, 'stl' : 1},
\ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
\ {'short' : 'e', 'long' : 'exceptions', 'fold' : 0, 'stl' : 1},
\ {'short' : 't', 'long' : 'type names', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'r', 'long' : 'structure fields', 'fold' : 0, 'stl' : 0}
\ ]
let type_ocaml.sro = '.' " Not sure, is nesting even possible?
let type_ocaml.kind2scope = {
\ 'M' : 'Module',
\ 'c' : 'class',
\ 't' : 'type'
\ }
let type_ocaml.scope2kind = {
\ 'Module' : 'M',
\ 'class' : 'c',
\ 'type' : 't'
\ }
let types.ocaml = type_ocaml
" Pascal {{{1
let type_pascal = tagbar#prototypes#typeinfo#new()
let type_pascal.ctagstype = 'pascal'
let type_pascal.kinds = [
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1}
\ ]
let types.pascal = type_pascal
" Perl {{{1
let type_perl = tagbar#prototypes#typeinfo#new()
let type_perl.ctagstype = 'perl'
let type_perl.kinds = [
\ {'short' : 'p', 'long' : 'packages', 'fold' : 1, 'stl' : 0},
\ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0},
\ {'short' : 'f', 'long' : 'formats', 'fold' : 0, 'stl' : 0},
\ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}
\ ]
let types.perl = type_perl
" PHP {{{1
let type_php = tagbar#prototypes#typeinfo#new()
let type_php.ctagstype = 'php'
let type_php.kinds = [
\ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'd', 'long' : 'constant definitions', 'fold' : 0, 'stl' : 0},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
\ {'short' : 'j', 'long' : 'javascript functions', 'fold' : 0, 'stl' : 1}
\ ]
let types.php = type_php
" Python {{{1
let type_python = tagbar#prototypes#typeinfo#new()
let type_python.ctagstype = 'python'
let type_python.kinds = [
\ {'short' : 'i', 'long' : 'imports', 'fold' : 1, 'stl' : 0},
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}
\ ]
let type_python.sro = '.'
let type_python.kind2scope = {
\ 'c' : 'class',
\ 'f' : 'function',
\ 'm' : 'function'
\ }
let type_python.scope2kind = {
\ 'class' : 'c',
\ 'function' : 'f'
\ }
let types.python = type_python
let types.pyrex = type_python
let types.cython = type_python
" REXX {{{1
let type_rexx = tagbar#prototypes#typeinfo#new()
let type_rexx.ctagstype = 'rexx'
let type_rexx.kinds = [
\ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}
\ ]
let types.rexx = type_rexx
" Ruby {{{1
let type_ruby = tagbar#prototypes#typeinfo#new()
let type_ruby.ctagstype = 'ruby'
let type_ruby.kinds = [
\ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
\ {'short' : 'F', 'long' : 'singleton methods', 'fold' : 0, 'stl' : 1}
\ ]
let type_ruby.sro = '.'
let type_ruby.kind2scope = {
\ 'c' : 'class',
\ 'm' : 'class',
\ 'f' : 'class'
\ }
let type_ruby.scope2kind = {
\ 'class' : 'c'
\ }
let types.ruby = type_ruby
" Scheme {{{1
let type_scheme = tagbar#prototypes#typeinfo#new()
let type_scheme.ctagstype = 'scheme'
let type_scheme.kinds = [
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'sets', 'fold' : 0, 'stl' : 1}
\ ]
let types.scheme = type_scheme
let types.racket = type_scheme
" Shell script {{{1
let type_sh = tagbar#prototypes#typeinfo#new()
let type_sh.ctagstype = 'sh'
let type_sh.kinds = [
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
\ ]
let types.sh = type_sh
let types.csh = type_sh
let types.zsh = type_sh
" SLang {{{1
let type_slang = tagbar#prototypes#typeinfo#new()
let type_slang.ctagstype = 'slang'
let type_slang.kinds = [
\ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
\ ]
let types.slang = type_slang
" SML {{{1
let type_sml = tagbar#prototypes#typeinfo#new()
let type_sml.ctagstype = 'sml'
let type_sml.kinds = [
\ {'short' : 'e', 'long' : 'exception declarations', 'fold' : 0, 'stl' : 0},
\ {'short' : 'f', 'long' : 'function definitions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'functor definitions', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'signature declarations', 'fold' : 0, 'stl' : 0},
\ {'short' : 'r', 'long' : 'structure declarations', 'fold' : 0, 'stl' : 0},
\ {'short' : 't', 'long' : 'type definitions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'value bindings', 'fold' : 0, 'stl' : 0}
\ ]
let types.sml = type_sml
" SQL {{{1
" The SQL ctags parser seems to be buggy for me, so this just uses the
" normal kinds even though scopes should be available. Improvements
" welcome!
let type_sql = tagbar#prototypes#typeinfo#new()
let type_sql.ctagstype = 'sql'
let type_sql.kinds = [
\ {'short' : 'P', 'long' : 'packages', 'fold' : 1, 'stl' : 1},
\ {'short' : 'd', 'long' : 'prototypes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'cursors', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'F', 'long' : 'record fields', 'fold' : 0, 'stl' : 1},
\ {'short' : 'L', 'long' : 'block label', 'fold' : 0, 'stl' : 1},
\ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'subtypes', 'fold' : 0, 'stl' : 1},
\ {'short' : 't', 'long' : 'tables', 'fold' : 0, 'stl' : 1},
\ {'short' : 'T', 'long' : 'triggers', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1},
\ {'short' : 'i', 'long' : 'indexes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'e', 'long' : 'events', 'fold' : 0, 'stl' : 1},
\ {'short' : 'U', 'long' : 'publications', 'fold' : 0, 'stl' : 1},
\ {'short' : 'R', 'long' : 'services', 'fold' : 0, 'stl' : 1},
\ {'short' : 'D', 'long' : 'domains', 'fold' : 0, 'stl' : 1},
\ {'short' : 'V', 'long' : 'views', 'fold' : 0, 'stl' : 1},
\ {'short' : 'n', 'long' : 'synonyms', 'fold' : 0, 'stl' : 1},
\ {'short' : 'x', 'long' : 'MobiLink Table Scripts', 'fold' : 0, 'stl' : 1},
\ {'short' : 'y', 'long' : 'MobiLink Conn Scripts', 'fold' : 0, 'stl' : 1},
\ {'short' : 'z', 'long' : 'MobiLink Properties', 'fold' : 0, 'stl' : 1}
\ ]
let types.sql = type_sql
" Tcl {{{1
let type_tcl = tagbar#prototypes#typeinfo#new()
let type_tcl.ctagstype = 'tcl'
let type_tcl.kinds = [
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
\ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1}
\ ]
let types.tcl = type_tcl
" LaTeX {{{1
let type_tex = tagbar#prototypes#typeinfo#new()
let type_tex.ctagstype = 'tex'
let type_tex.kinds = [
\ {'short' : 'i', 'long' : 'includes', 'fold' : 1, 'stl' : 0},
\ {'short' : 'p', 'long' : 'parts', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'chapters', 'fold' : 0, 'stl' : 1},
\ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1},
\ {'short' : 'u', 'long' : 'subsections', 'fold' : 0, 'stl' : 1},
\ {'short' : 'b', 'long' : 'subsubsections', 'fold' : 0, 'stl' : 1},
\ {'short' : 'P', 'long' : 'paragraphs', 'fold' : 0, 'stl' : 0},
\ {'short' : 'G', 'long' : 'subparagraphs', 'fold' : 0, 'stl' : 0},
\ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 0}
\ ]
let type_tex.sro = '""'
let type_tex.kind2scope = {
\ 'p' : 'part',
\ 'c' : 'chapter',
\ 's' : 'section',
\ 'u' : 'subsection',
\ 'b' : 'subsubsection'
\ }
let type_tex.scope2kind = {
\ 'part' : 'p',
\ 'chapter' : 'c',
\ 'section' : 's',
\ 'subsection' : 'u',
\ 'subsubsection' : 'b'
\ }
let type_tex.sort = 0
let types.tex = type_tex
" Vala {{{1
" Vala is supported by the ctags fork provided by Anjuta, so only add the
" type if the fork is used to prevent error messages otherwise
if has_key(a:supported_types, 'vala') || executable('anjuta-tags')
let type_vala = tagbar#prototypes#typeinfo#new()
let type_vala.ctagstype = 'vala'
let type_vala.kinds = [
\ {'short' : 'e', 'long' : 'Enumerations', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'Enumeration values', 'fold' : 0, 'stl' : 0},
\ {'short' : 's', 'long' : 'Structures', 'fold' : 0, 'stl' : 1},
\ {'short' : 'i', 'long' : 'Interfaces', 'fold' : 0, 'stl' : 1},
\ {'short' : 'd', 'long' : 'Delegates', 'fold' : 0, 'stl' : 1},
\ {'short' : 'c', 'long' : 'Classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'p', 'long' : 'Properties', 'fold' : 0, 'stl' : 0},
\ {'short' : 'f', 'long' : 'Fields', 'fold' : 0, 'stl' : 0},
\ {'short' : 'm', 'long' : 'Methods', 'fold' : 0, 'stl' : 1},
\ {'short' : 'E', 'long' : 'Error domains', 'fold' : 0, 'stl' : 1},
\ {'short' : 'r', 'long' : 'Error codes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'S', 'long' : 'Signals', 'fold' : 0, 'stl' : 1}
\ ]
let type_vala.sro = '.'
" 'enum' doesn't seem to be used as a scope, but it can't hurt to have
" it here
let type_vala.kind2scope = {
\ 's' : 'struct',
\ 'i' : 'interface',
\ 'c' : 'class',
\ 'e' : 'enum'
\ }
let type_vala.scope2kind = {
\ 'struct' : 's',
\ 'interface' : 'i',
\ 'class' : 'c',
\ 'enum' : 'e'
\ }
let types.vala = type_vala
endif
if !has_key(a:supported_types, 'vala') && executable('anjuta-tags')
let types.vala.ctagsbin = 'anjuta-tags'
endif
" Vera {{{1
" Why are variables 'virtual'?
let type_vera = tagbar#prototypes#typeinfo#new()
let type_vera.ctagstype = 'vera'
let type_vera.kinds = [
\ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
\ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
\ {'short' : 'T', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0},
\ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
\ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 't', 'long' : 'tasks', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
\ {'short' : 'p', 'long' : 'programs', 'fold' : 0, 'stl' : 1}
\ ]
let type_vera.sro = '.' " Nesting doesn't seem to be possible
let type_vera.kind2scope = {
\ 'g' : 'enum',
\ 'c' : 'class',
\ 'v' : 'virtual'
\ }
let type_vera.scope2kind = {
\ 'enum' : 'g',
\ 'class' : 'c',
\ 'virtual' : 'v'
\ }
let types.vera = type_vera
" Verilog {{{1
let type_verilog = tagbar#prototypes#typeinfo#new()
let type_verilog.ctagstype = 'verilog'
let type_verilog.kinds = [
\ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0},
\ {'short' : 'e', 'long' : 'events', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
\ {'short' : 'n', 'long' : 'net data types', 'fold' : 0, 'stl' : 1},
\ {'short' : 'p', 'long' : 'ports', 'fold' : 0, 'stl' : 1},
\ {'short' : 'r', 'long' : 'register data types', 'fold' : 0, 'stl' : 1},
\ {'short' : 't', 'long' : 'tasks', 'fold' : 0, 'stl' : 1}
\ ]
let types.verilog = type_verilog
" VHDL {{{1
" The VHDL ctags parser unfortunately doesn't generate proper scopes
let type_vhdl = tagbar#prototypes#typeinfo#new()
let type_vhdl.ctagstype = 'vhdl'
let type_vhdl.kinds = [
\ {'short' : 'P', 'long' : 'packages', 'fold' : 1, 'stl' : 0},
\ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0},
\ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1},
\ {'short' : 'T', 'long' : 'subtypes', 'fold' : 0, 'stl' : 1},
\ {'short' : 'r', 'long' : 'records', 'fold' : 0, 'stl' : 1},
\ {'short' : 'e', 'long' : 'entities', 'fold' : 0, 'stl' : 1},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1}
\ ]
let types.vhdl = type_vhdl
" Vim {{{1
let type_vim = tagbar#prototypes#typeinfo#new()
let type_vim.ctagstype = 'vim'
let type_vim.kinds = [
\ {'short' : 'n', 'long' : 'vimball filenames', 'fold' : 0, 'stl' : 1},
\ {'short' : 'v', 'long' : 'variables', 'fold' : 1, 'stl' : 0},
\ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
\ {'short' : 'a', 'long' : 'autocommand groups', 'fold' : 1, 'stl' : 1},
\ {'short' : 'c', 'long' : 'commands', 'fold' : 0, 'stl' : 0},
\ {'short' : 'm', 'long' : 'maps', 'fold' : 1, 'stl' : 0}
\ ]
let types.vim = type_vim
" YACC {{{1
let type_yacc = tagbar#prototypes#typeinfo#new()
let type_yacc.ctagstype = 'yacc'
let type_yacc.kinds = [
\ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}
\ ]
let types.yacc = type_yacc
" }}}1
for [type, typeinfo] in items(types)
let typeinfo.ftype = type
endfor
for typeinfo in values(types)
call typeinfo.createKinddict()
endfor
return types
endfunction
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
File diff suppressed because it is too large Load Diff
+1854 -248
View File
File diff suppressed because it is too large Load Diff
+159 -1805
View File
File diff suppressed because it is too large Load Diff
+53 -14
View File
@@ -2,26 +2,65 @@
" Description: Tagbar syntax settings
" Author: Jan Larres <jan@majutsushi.net>
" Licence: Vim licence
" Website: http://majutsushi.github.com/tagbar/
" Version: 1.1
" Website: https://preservim.github.io/tagbar
" Version: 3.0.0
if exists("b:current_syntax")
finish
scriptencoding utf-8
if exists('b:current_syntax')
finish
endif
syntax match Comment '^" .*' " Comments
syntax match Identifier '^ [^: ]\+[^:]\+$' " Non-scoped kinds
syntax match Title '[^(* ]\+\ze\*\? :' " Scope names
syntax match Type ' : \zs.*' " Scope types
syntax match SpecialKey '(.*)' " Signatures
syntax match NonText '\*\ze :' " Pseudo-tag identifiers
let s:ics = escape(join(g:tagbar_iconchars, ''), ']^\-')
let s:pattern = '\(^[' . s:ics . '] \?\)\@3<=[^-+: ]\+[^:]\+$'
execute "syntax match TagbarKind '" . s:pattern . "'"
let s:pattern = '\(\S\@<![' . s:ics . '][-+# ]\?\)\@<=[^*(]\+\(\*\?\(([^)]\+)\)\? :\)\@='
execute "syntax match TagbarScope '" . s:pattern . "'"
let s:pattern = '\S\@<![' . s:ics . ']\([-+# ]\?\)\@='
execute "syntax match TagbarFoldIcon '" . s:pattern . "'"
let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=+\([^-+# ]\)\@='
execute "syntax match TagbarVisibilityPublic '" . s:pattern . "'"
let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=#\([^-+# ]\)\@='
execute "syntax match TagbarVisibilityProtected '" . s:pattern . "'"
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 TagbarType ' : \zs.*' contains=TagbarTagLineN
syntax match TagbarTagLineN '\s\+\[[0-9]\+\]\(\s\+\|$\)'
syntax match TagbarSignature '\(\<operator *( *) *\)\?\zs(.*)\ze'
syntax match TagbarPseudoID '\*\ze :'
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
highlight default link TagbarType Type
highlight default link TagbarTagLineN Comment
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
highlight default link TagbarVisibilityPublic TagbarAccessPublic
highlight default link TagbarVisibilityProtected TagbarAccessProtected
highlight default link TagbarVisibilityPrivate TagbarAccessPrivate
syntax match TagbarAccessPublic '^\s*+\ze[^ ]'
syntax match TagbarAccessProtected '^\s*#\ze[^ ]'
syntax match TagbarAccessPrivate '^\s*-\ze[^ ]'
let b:current_syntax = 'tagbar'
let b:current_syntax = "tagbar"
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1