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

164 Commits

Author SHA1 Message Date
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
Jan Larres 91deffb04d Version 1.1 2011-02-26 20:52:40 +13:00
Jan Larres 9ae8cfedd8 Allow expanding the vim window when opening Tagbar 2011-02-26 20:51:15 +13:00
Jan Larres a18be73b63 Fix syntax highlighting when :syntax enable is called 2011-02-26 19:59:28 +13:00
Jan Larres c6bbfcdba1 Version 1.0 2011-02-23 17:47:42 +13:00
Jan Larres d971024947 Change homepage 2011-02-20 11:04:09 +13:00
Jan Larres 65632006da Add README 2011-02-20 02:32:57 +13:00
Jan Larres efa19610f9 Small manual fix 2011-02-20 02:00:28 +13:00
Jan Larres 3b0bad1372 Finish manual except for release info 2011-02-20 01:37:09 +13:00
Jan Larres 060248aacb Small manual fixes 2011-02-19 23:12:48 +13:00
Jan Larres 78946a696a Expand manual 2011-02-19 22:59:44 +13:00
Jan Larres a92911fa18 Replace 'wincmd p' with explicit window numbers in a few locations 2011-02-19 17:50:29 +13:00
Jan Larres 342aece556 Don't do anything on OpenWindow() when in Tagbar window 2011-02-19 17:39:35 +13:00
Jan Larres d0d557bf5f Extract some one-time settings from OpenWindow() 2011-02-19 17:32:49 +13:00
Jan Larres 91076ee9d5 Let kind2scope and scope2kind be auto-generated from each other in user-defs 2011-02-19 17:12:47 +13:00
Jan Larres 1b5f3a4e84 Expand manual 2011-02-18 19:54:39 +13:00
Jan Larres d0b88b1f78 Fix requirement for ctags version 2011-02-18 01:04:27 +13:00
Jan Larres 300cd343ba Some auto-update improvements 2011-02-17 17:33:59 +13:00
Jan Larres 7808f0ec93 Manual 2011-02-17 01:19:24 +13:00
Jan Larres bbc5c1fa2d Manual fixes 2011-02-16 19:56:57 +13:00
Jan Larres d66169f2d6 Get rid of superflous check for system() 2011-02-15 19:18:09 +13:00
Jan Larres efe0cb3fdb Expand manual 2011-02-15 19:17:46 +13:00
Jan Larres 05eb38a018 Small manual fixes 2011-02-15 02:35:26 +13:00
Jan Larres 2431562c1c Preliminary version of manual 2011-02-15 01:06:39 +13:00
Jan Larres cc6a2958a1 Reorganize file structure 2011-02-14 23:47:18 +13:00
Jan Larres 4772da814a Provide command for autoclosing window regardless of global setting 2011-02-14 23:32:57 +13:00
Jan Larres 6cd89f58bd Don't fold comments 2011-02-14 22:10:30 +13:00
Jan Larres e053a24cfc Small misc stuff 2011-02-14 22:02:44 +13:00
Jan Larres 48704d10fa Make folding work 2011-02-14 20:48:24 +13:00
Jan Larres e22147a2d3 Allow setting sort mode per type 2011-02-14 17:37:34 +13:00
Jan Larres 7b558822a4 Ignore '~' prefix for C++ destructors when sorting 2011-02-14 16:28:56 +13:00
Jan Larres 47abcb82cf Add compact display mode 2011-02-14 16:11:59 +13:00
Jan Larres 6402fc98e8 Slight highlighting change 2011-02-13 19:25:02 +13:00
Jan Larres 762d5b9968 Rewrite the processing of scoped tags 2011-02-13 19:20:29 +13:00
Jan Larres 5f400b06b7 Make autocommand more readable 2011-02-09 18:31:36 +13:00
Jan Larres a21290dbdc Get rid of PrintWarningMsg() 2011-02-09 18:17:22 +13:00
Jan Larres cbb6a5f7ba Support user-defined types 2011-02-07 19:19:55 +13:00
Jan Larres 3639b9635a Tighten syntax highlighting a bit 2011-02-07 19:16:38 +13:00
Jan Larres 1900bf9da1 Add support for the rest of the languages 2011-02-07 17:59:07 +13:00
Jan Larres 7081192a8f Fix depth bug 2011-02-07 17:58:33 +13:00
Jan Larres b4b8eef2b0 Small pseudo-tag bugfix 2011-02-06 23:09:34 +13:00
Jan Larres 6bad51de6a Cache depth in tags 2011-02-06 21:22:56 +13:00
Jan Larres 5c06c683d3 Add support for more languages 2011-02-05 19:33:18 +13:00
Jan Larres 172afabdb7 Handle ctags failures gracefully 2011-02-05 19:32:49 +13:00
Jan Larres 522a158956 Fix case bug 2011-02-05 19:30:03 +13:00
Jan Larres d9c0b8b2d4 Add Erlang support 2011-02-04 18:29:34 +13:00
Jan Larres f8b49b2f20 Mark current position before jumping to it 2011-02-01 15:28:48 +13:00
Jan Larres 053466b5a6 Display some useful info in the statusline 2011-01-27 21:04:21 +13:00
Jan Larres fab8af715c Add support for more languages 2011-01-26 19:17:09 +13:00
Jan Larres eb96cd87f1 Add support for Asm 2011-01-25 20:12:57 +13:00
Jan Larres a8d29ed5d1 Add support for Ant 2011-01-25 19:32:30 +13:00
Jan Larres 23ea6d0011 Support C 2011-01-24 23:23:40 +13:00
Jan Larres 1521c90fc3 Switch to marker folding 2011-01-24 22:37:52 +13:00
Jan Larres cd17c19dea Small syntax fix 2011-01-24 22:10:40 +13:00
Jan Larres 9f3e5f6ccb Don't highlight access symbols 2011-01-24 21:27:35 +13:00
Jan Larres ce001d55f4 Fix bug with prototype recognition 2011-01-24 20:14:28 +13:00
Jan Larres f17f1faa1f Fix some parsing bugs and add Java support 2011-01-24 19:48:58 +13:00
Jan Larres 310435b009 Support access/visibility prefix 2011-01-23 18:10:50 +13:00
Jan Larres 0d96623015 Only do type initialization once the tagbar is opened for the first time 2011-01-23 16:47:44 +13:00
Jan Larres 1537287fce If autoclose is set jump to the tagbar window on open 2011-01-23 16:40:14 +13:00
Jan Larres f15d130c3a Speed up child processing by separating scoped from non-scoped tags 2011-01-23 15:09:08 +13:00
Jan Larres 2fd950e96d Cache some information to make filtering faster 2011-01-23 02:22:20 +13:00
Jan Larres 39beb53fc1 Pseudo-tag fixes. Sigh. 2011-01-22 22:16:49 +13:00
Jan Larres 7bae0c5a69 Display some help 2011-01-22 00:27:50 +13:00
Jan Larres d615d070c0 Comment for last fix 2011-01-21 22:29:48 +13:00
Jan Larres 8e4101b990 Fix small highlighting bug 2011-01-21 21:16:46 +13:00
Jan Larres ca7307be6b *Really* support nested pseudo-tags 2011-01-21 20:11:15 +13:00
Jan Larres d235ec6dfb Support some more C++ scopes 2011-01-21 01:38:14 +13:00
Jan Larres 8e6d6355d0 Small reformattings 2011-01-20 22:18:33 +13:00
Jan Larres 8d72cedc41 Allow zooming the window 2011-01-20 21:20:29 +13:00
Jan Larres a5fd8d2c75 Allow closing the window with 'q' 2011-01-20 21:13:00 +13:00
Jan Larres 0b6ce07d78 Show prototype with <space> and balloon 2011-01-20 21:03:56 +13:00
Jan Larres 8aadfd19d3 Allow jumping to a tag definition from the tagbar window 2011-01-20 20:16:58 +13:00
Jan Larres d94b7ad66f Allow toggling the sort method 2011-01-20 18:16:57 +13:00
Jan Larres e7d50d3800 Fix sorting bug 2011-01-20 17:11:27 +13:00
Jan Larres ebf1d4b2e1 Add syntax highlighting 2011-01-20 16:51:50 +13:00
Jan Larres 19dee23d8d Add highlighting function and rearrange update method 2011-01-20 16:51:33 +13:00
Jan Larres 7247c1edb7 Add some comments 2011-01-20 16:47:29 +13:00
Jan Larres 58b13eaaa9 Make ctags_args more readable 2011-01-19 18:44:08 +13:00
Jan Larres 7ac78715b2 Consolidate sorting 2011-01-19 17:36:10 +13:00
Jan Larres 3fab2ae0dd Support nesting pseudo-tags 2011-01-19 17:19:15 +13:00
Jan Larres 597a0f4940 Fix some compatibility bugs 2011-01-18 15:03:27 +13:00
Jan Larres 040d1b99e7 Small cleanups. 2011-01-17 23:40:50 +13:00
Jan Larres ba24621296 Support non-nesting pseudo-tags. 2011-01-17 22:58:31 +13:00
Jan Larres e5e761b64a Fix compare bug. 2011-01-17 17:09:55 +13:00
Jan Larres dda2103363 Allow sorting the tags by name or line (unsorted). 2011-01-17 17:08:10 +13:00
Jan Larres 90f6a780e8 Print top-level tags in the specified order. 2011-01-17 15:54:12 +13:00
Jan Larres 00dc87f351 Simplify top level scope detection. 2011-01-17 03:19:11 +13:00
Jan Larres a832db8b47 Use proper ctags binary name on Debian-like systems. 2011-01-17 00:41:41 +13:00
Jan Larres 32d42f5d47 Process scopes only when the file has changed. 2011-01-17 00:35:05 +13:00
Jan Larres d250f26798 Clear buffer for unsupported files. 2011-01-16 22:02:52 +13:00
Jan Larres 04ad66a70e Rough support for nested scopes. 2011-01-16 17:46:14 +13:00
Jan Larres dfce41715b Keep old alternate file when opening tagbar window. 2011-01-15 19:22:56 +13:00
Jan Larres 8b2fd1c849 Simple scope support. 2011-01-14 23:12:26 +13:00
Jan Larres 5f5e5e1b70 prepare autoclose functionality 2011-01-12 23:30:38 +13:00
Jan Larres db3e802912 primitive version with c++ support 2011-01-12 22:48:04 +13:00
Jan Larres 6c0f348ad1 Initial commit 2011-01-11 22:36:49 +13:00
26 changed files with 3518 additions and 464 deletions
-1
View File
@@ -1 +0,0 @@
_site/
+7
View File
@@ -0,0 +1,7 @@
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.
-2
View File
@@ -1,2 +0,0 @@
markdown: rdiscount
highlighter: pygments
-7
View File
@@ -1,7 +0,0 @@
<p>1.0 (2011-02-23)
<a href="https://github.com/majutsushi/tagbar/zipball/v1.0">zip</a>
<a href="https://github.com/majutsushi/tagbar/tarball/v1.0">tar</a>
<ul>
<li>Initial release</li>
</ul>
</p>
-80
View File
@@ -1,80 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>{{ page.title }}</title>
<!-- <link rel="stylesheet" href="/css/fonts.css" type="text/css" charset="utf-8" /> -->
<link href='https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic|Ubuntu+Mono:400,700' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
margin-top: 1.0em;
/* background-color: #1C1C1C; */
background-color: #202020;
font-size: 16px;
font-family: Ubuntu, Helvetica, Arial, FreeSans;
color: #F0E7D5;
/* color: #FFFFFF; */
}
#container {
margin: 0 auto;
width: 650px;
}
h1 {
font-size: 3.0em;
color: #dddddd;
margin-bottom: 3px;
text-shadow: #111111 3px 3px 1px;
text-align: center;
}
h1 .small { font-size: 0.4em; }
h1 a { text-decoration: none; color: #F0E7D5 }
h2 { font-size: 1.5em; color: #dddddd; text-shadow: #111111 1px 1px 1px; }
h3 { text-align: left; color: #dddddd; }
a { color: #ffcc00; }
.description { font-size: 1.2em; margin-bottom: 30px; margin-top: 30px; font-style: italic;}
.download { float: right; }
pre {
background: #333333;
color: #ffffff;
padding: 8px 15px 8px 15px;
border-width: 1px;
border-color: #222222;
border-style: solid;
box-shadow: rgba(0, 0, 0, 0.3) 0 1px 3px 0 inset;
font-family: "Ubuntu Mono", monospace;
}
.pre {
background: #333333;
color: #ffffff;
padding: 2px 3px 2px 3px;
border-width: 1px;
border-color: #222222;
border-style: solid;
box-shadow: rgba(0, 0, 0, 0.3) 0 1px 2px 0 inset;
font-family: "Ubuntu Mono", monospace;
}
code { font-family: "Ubuntu Mono", monospace; }
hr { border: 0; width: 80%; border-bottom: 1px solid #aaa}
#title {
margin-bottom: 50px;
}
#title p {
font-size: 1.8em;
text-align: center;
color: #999999;
}
.footer { text-align:center; padding-top:30px; font-style: italic; }
</style>
<link rel="stylesheet" href="/css/desert.css" type="text/css" />
</head>
<body>
{{ content }}
</body>
</html>
-5
View File
@@ -1,5 +0,0 @@
---
title: 1.0
---
- Initial release
-6
View File
@@ -1,6 +0,0 @@
---
title: 1.1
---
- Don't lose syntax highlighting when ':syntax enable' is called
- Allow expanding the Vim window when Tagbar is opened
-5
View File
@@ -1,5 +0,0 @@
---
title: 1.2
---
- Fix typo in Ruby definition
-14
View File
@@ -1,14 +0,0 @@
---
title: 1.5
---
- Type definitions can now include a path to a file with the ctags
definition. This is especially useful for ftplugins that can now ship with
a complete ctags and Tagbar configuration without requiring user
intervention. Thanks to Jan Christoph Ebersbach for the suggestion.
- Added autofocus setting by Taybin Rutkin. This will put the cursor in the
Tagbar window when it is opened.
- The "scopes" field is no longer needed in type definitions, the
information is already there in "scope2kind". Existing definitions will be
ignored.
- Some fixes and improvements related to redrawing and window switching.
-5
View File
@@ -1,5 +0,0 @@
---
title: 2.0.1
---
- Fixed sorting bug when 'ignorecase' is set
-14
View File
@@ -1,14 +0,0 @@
---
title: 2.0
---
- Folding now works correctly. Folds will be preserved when leaving the
Tagbar window and when switching between files. Also tag types can be
configured to be folded by default, which is useful for things like
includes and imports.
- DoctorJS/jsctags and other compatible programs are now supported.
- All of the highlight groups can now be overridden.
- Added keybinding to quickly jump to next/previous top-level tag.
- Added Taglist's "p" keybinding for jumping to a tag without leaving the
Tagbar window.
- Several bugfixes and other small improvements.
-18
View File
@@ -1,18 +0,0 @@
---
title: 2.1
---
- Make Tagbar work in (hopefully) all cases under Windows
- Handle cases where 'encoding' is different from system encoding, for
example on a Chinese Windows with 'encoding' set to "utf-8" (see manual
for details in case it doesn't work out-of-the-box)
- Fixed a bug with the handling of subtypes like "python.django"
- If a session got saved with Tagbar open it now gets restored properly
- Locally reset foldmethod/foldexpr in case foldexpr got set to something
expensive globally
- Tagbar now tries hard to go to the correct window when jumping to a tag
- Explain some possible issues with the current jsctags version in the
manual
- Explicitly check for some possible configuration problems to be able to
give better feedback
- A few other small fixes
-19
View File
@@ -1,19 +0,0 @@
---
title: 2.2
---
- Small incompatible change: TagbarOpen now doesn't jump to the Tagbar window
anymore if it is already open. Use "TagbarOpen j" instead or see its
documentation for more options.
- Tags inside of scopes now have a header displaying their "kind".
- The Tagbar contents are now immediately updated on save for files smaller
than a configurable size.
- Tagbar can now be configured to jump to a tag with only a single-click
instead of a double-click.
- Most of the script has been moved to the autoload directory, so Vim startup
should be faster (thanks to Kien N).
- Jumping to tags should work most of the time even if the file has been
modified and not saved.
- If Ctags has been installed into the default location using Homebrew or
MacPorts it should now be found automatically.
- Several bugfixes.
-12
View File
@@ -1,12 +0,0 @@
---
title: 2.3
---
- Add a convenience function that allows more flexible ways to automatically
open Tagbar.
- Replace option tagbar_usearrows with tagbar_iconchars to allow custom
characters to be specified. This helps with fonts that don't display the
default characters properly.
- Remove the need to provide the complete jsctags configuration if jsctags is
not found in $PATH, now only the concrete path has to be specified.
- Add debugging functionality.
-11
View File
@@ -1,11 +0,0 @@
---
title: 2.4
---
- New function tagbar#currenttag() that reports the current tag, for example
for putting it into the statusline.
- New command TagbarGetTypeConfig for easy customization of an existing type.
- Type definitions now can be loaded from ftplugins.
- The autoopen() function is now a bit more flexible.
- Vala is now supported if Anjuta is installed.
- Various other small improvements and bugfixes.
-10
View File
@@ -1,10 +0,0 @@
---
title: 2.4.1
---
- Fixed some bugs related to the currenttag() function when it was called
before the rest of the plugin was loaded. Also fail silently in case
something goes wrong so the statusline doesn't get messed up.
- In certain cases highlighting tags in deeply nested folds could cause an
error message.
- Spellchecking is now correctly getting disabled in the Tagbar window.
-28
View File
@@ -1,28 +0,0 @@
---
title: 2.5
---
- New command :TagbarTogglePause to freeze Tagbar in its current state so you
can switch to other files while keeping the old information displayed for
reference. (Kian Ryan)
- New command :TagbarCurrentTag which reports the same information as
currenttag().
- New option tagbar_indent to configure the indentation depth of the tags.
- New option tagbar_show_visibility to allow disabling the visibility symbols.
- Files are now cached locally to avoid additional slowdowns for slow
connections. This also makes it possible to use Tagbar with files accessed
through Netrw.
- Execute ctags again even if the previous run reported errors, in case it was
a parse error that has since been fixed. If the error persists, don't
display it again.
- Improved window switching and Vim exit behaviours. (Techlive Zheng)
- The currenttag() function now can show the prototype instead of the actual
tag, which can be useful in some cases where ctags doesn't report all the
interesting information.
- The prototype shown in the tooltip or command line should now always be
complete, even if it is spread out over more than one line in the source
file.
- The TagbarAccessPublic etc. highlight groups have been renamed to
TagbarVisibilityPublic etc. to keep them in line with standard terminology.
The old names are still supported.
- Various smaller improvements and bugfixes.
-16
View File
@@ -1,16 +0,0 @@
---
title: 2.6
---
- Added possibility to show tags in the preview window, either manually or
automatically.
- Allow customizing the statusline, see :help g:tagbar_status_func.
- Type configuration can now be project-specific.
- The keybindings in the Tagbar window are now configurable.
- Improvements to Ctags execution on Windows, thanks to Darcy Parker.
- Added function tagbar#currentfile() that returns the path to the file
currently being displayed in Tagbar, thanks to Zhao Cai.
- Added a :Tagbar command as an alias for :TagbarToggle.
- Added an way to ignore specific files in case they create problems.
- Optionally show line numbers in the Tagbar window.
- The usual bunch of small improvements and bugfixes.
-9
View File
@@ -1,9 +0,0 @@
---
title: 2.6.1
---
- Automatically close the preview window when jumping to a tag
- Don't forget the previous window in certain situations, which was causing
problems with for example fugitive
- Fixed toggling kind-specific folds
- Fixed ctags error that can happen with Cygwin
-22
View File
@@ -1,22 +0,0 @@
---
layout: default
title: Old releases
---
<a href="https://github.com/majutsushi/tagbar"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
<div id="container">
<h3>Old releases</h3>
{% for post in site.posts offset:1 %}
<span style="font-weight:bold">{{ post.title }}</span> ({{ post.date | date:"%Y-%m-%d" }})
<a href="https://github.com/majutsushi/tagbar/zipball/v{{ post.title }}">zip</a>
<a href="https://github.com/majutsushi/tagbar/tarball/v{{ post.title }}">tar</a>
{{ post.content }}
{% endfor %}
</div>
-70
View File
@@ -1,70 +0,0 @@
.highlight { background: #333333; color: #ffffff}
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #87ceeb} /* Comment */
.highlight .err { color: #ffffff} /* Error */
.highlight .g { color: #ffffff} /* Generic */
.highlight .k { color: #f0e68c; font-weight: bold } /* Keyword */
.highlight .l { color: #ffffff} /* Literal */
.highlight .n { color: #ffffff} /* Name */
.highlight .o { color: #ffffff} /* Operator */
.highlight .x { color: #ffffff} /* Other */
.highlight .p { color: #ffffff} /* Punctuation */
.highlight .cm { color: #87ceeb} /* Comment.Multiline */
.highlight .cp { color: #cd5c5c} /* Comment.Preproc */
.highlight .c1 { color: #87ceeb} /* Comment.Single */
.highlight .cs { color: #87ceeb} /* Comment.Special */
.highlight .gd { color: #0000c0; font-weight: bold; background-color: #008080 } /* Generic.Deleted */
.highlight .ge { color: #c000c0; text-decoration: underline} /* Generic.Emph */
.highlight .gr { color: #c0c0c0; font-weight: bold; background-color: #c00000 } /* Generic.Error */
.highlight .gh { color: #cd5c5c} /* Generic.Heading */
.highlight .gi { color: #ffffff; background-color: #0000c0 } /* Generic.Inserted */
.highlight .go { color: #add8e6; font-weight: bold; background-color: #4d4d4d } /* Generic.Output */
.highlight .gp { color: #ffffff} /* Generic.Prompt */
.highlight .gs { color: #ffffff} /* Generic.Strong */
.highlight .gu { color: #cd5c5c} /* Generic.Subheading */
.highlight .gt { color: #c0c0c0; font-weight: bold; background-color: #c00000 } /* Generic.Traceback */
.highlight .kc { color: #f0e68c; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #f0e68c; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #f0e68c; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #f0e68c; font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { color: #f0e68c; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #bdb76b; font-weight: bold } /* Keyword.Type */
.highlight .ld { color: #ffffff} /* Literal.Date */
.highlight .m { color: #ffffff} /* Literal.Number */
.highlight .s { color: #ffffff} /* Literal.String */
.highlight .na { color: #ffffff} /* Name.Attribute */
.highlight .nb { color: #ffffff} /* Name.Builtin */
.highlight .nc { color: #ffffff} /* Name.Class */
.highlight .no { color: #ffa0a0} /* Name.Constant */
.highlight .nd { color: #ffffff} /* Name.Decorator */
.highlight .ni { color: #ffdead} /* Name.Entity */
.highlight .ne { color: #ffffff} /* Name.Exception */
.highlight .nf { color: #ffffff} /* Name.Function */
.highlight .nl { color: #ffffff} /* Name.Label */
.highlight .nn { color: #ffffff} /* Name.Namespace */
.highlight .nx { color: #ffffff} /* Name.Other */
.highlight .py { color: #ffffff} /* Name.Property */
.highlight .nt { color: #f0e68c} /* Name.Tag */
.highlight .nv { color: #98fb98} /* Name.Variable */
.highlight .ow { color: #ffffff} /* Operator.Word */
.highlight .w { color: #ffffff} /* Text.Whitespace */
.highlight .mf { color: #ffffff} /* Literal.Number.Float */
.highlight .mh { color: #ffffff} /* Literal.Number.Hex */
.highlight .mi { color: #ffffff} /* Literal.Number.Integer */
.highlight .mo { color: #ffffff} /* Literal.Number.Oct */
.highlight .sb { color: #ffffff} /* Literal.String.Backtick */
.highlight .sc { color: #ffffff} /* Literal.String.Char */
.highlight .sd { color: #ffffff} /* Literal.String.Doc */
.highlight .s2 { color: #ffffff} /* Literal.String.Double */
.highlight .se { color: #ffffff} /* Literal.String.Escape */
.highlight .sh { color: #ffffff} /* Literal.String.Heredoc */
.highlight .si { color: #ffffff} /* Literal.String.Interpol */
.highlight .sx { color: #ffffff} /* Literal.String.Other */
.highlight .sr { color: #ffffff} /* Literal.String.Regex */
.highlight .s1 { color: #ffffff} /* Literal.String.Single */
.highlight .ss { color: #ffffff} /* Literal.String.Symbol */
.highlight .bp { color: #ffffff} /* Name.Builtin.Pseudo */
.highlight .vc { color: #98fb98} /* Name.Variable.Class */
.highlight .vg { color: #98fb98} /* Name.Variable.Global */
.highlight .vi { color: #98fb98} /* Name.Variable.Instance */
.highlight .il { color: #ffffff} /* Literal.Number.Integer.Long */
+855
View File
@@ -0,0 +1,855 @@
*tagbar.txt* Display tags of a file in their correct scope
Author: Jan Larres <jan@majutsushi.net>
Licence: Vim licence, see |license|
Homepage: http://majutsushi.github.com/tagbar/
Version: 2.0.1
==============================================================================
Contents *tagbar* *tagbar-contents*
1. Intro ........................... |tagbar-intro|
Pseudo-tags ................... |tagbar-pseudotags|
Supported features ............ |tagbar-features|
Other ctags-compatible programs |tagbar-other|
2. Requirements .................... |tagbar-requirements|
3. Installation .................... |tagbar-installation|
4. Usage ........................... |tagbar-usage|
Commands ...................... |tagbar-commands|
Key mappings .................. |tagbar-keys|
5. Configuration ................... |tagbar-configuration|
Highlight colours ............. |tagbar-highlight|
Automatically opening Tagbar .. |tagbar-autoopen|
6. Extending Tagbar ................ |tagbar-extend|
7. Bugs and limitations ............ |tagbar-bugs|
8. History ......................... |tagbar-history|
9. Todo ............................ |tagbar-todo|
10. Credits ......................... |tagbar-credits|
==============================================================================
1. Intro *tagbar-intro*
Tagbar is a 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.
Let's say we have the following code inside of a C++ file:
>
namespace {
char a;
class Foo
{
public:
Foo();
~Foo();
private:
int var;
};
};
<
Then Tagbar would display the tag information like so:
>
__anon1* : namespace
Foo : class
+Foo()
+~Foo()
-var
a
<
This example shows several important points. First, the tags are listed
indented below the scope they are defined in. Second, the type of a scope is
listed after its name and a colon. Third, tags for which the access/visibility
information is known are prefixed with a symbol indicating that.
------------------------------------------------------------------------------
PSEUDO-TAGS *tagbar-pseudotags*
The example also introduces the concept of "pseudo-tags". Pseudo-tags are tags
that are not explicitly defined in the file but have children in it. In this
example the namespace doesn't have a name and thus ctags doesn't generate a
tag for it, but since it has children it still needs to be displayed using an
auto-generated name.
Another case where pseudo-tags appear is in C++ implementation files. Since
classes are usually defined in a header file but the member methods and
variables in the implementation file the class itself won't generate a tag
in that file.
Since pseudo-tags don't really exist they cannot be jumped to from the Tagbar
window.
Pseudo-tags are denoted with an asterisk ('*') at the end of their name.
------------------------------------------------------------------------------
SUPPORTED FEATURES *tagbar-features*
The following features are supported by Tagbar:
- Display tags under their correct scope.
- Automatically update the tags when switching between buffers and editing
files.
- Display visibility information of tags if available.
- Highlight the tag near the cursor while editing files.
- Jump to a tag from the Tagbar window.
- Display the complete prototype of a tag.
- Tags can be sorted either by name or order of appearance in the file.
- Scopes can be folded to hide uninteresting information.
- Supports all of the languages that ctags does, i.e. Ant, Assembler, ASP,
Awk, Basic, BETA, C, C++, C#, COBOL, DosBatch, Eiffel, Erlang, Flex,
Fortran, HTML, Java, JavaScript, Lisp, Lua, Make, MatLab, OCaml, Pascal,
Perl, PHP, Python, REXX, Ruby, Scheme, Shell script, SLang, SML, SQL, Tcl,
Tex, Vera, Verilog, VHDL, Vim and YACC.
- Can be extended to support arbitrary new types.
------------------------------------------------------------------------------
OTHER CTAGS-COMPATIBLE PROGRAMS *tagbar-other*
Tagbar theoretically also supports filetype-specific programs that can output
tag information that is compatible with ctags. However due to potential
incompatibilities this may not always completely work. Tagbar has been tested
with doctorjs/jsctags and will use that if present, other programs require
some configuration (see |tagbar-extend|). If a program does not work even with
correct configuration please contact me.
==============================================================================
2. Requirements *tagbar-requirements*
The following requirements have to be met in order to be able to use tagbar:
- Vim 7.0 or higher. Older versions will not work since Tagbar uses data
structures that were only introduced in Vim 7.
- Exuberant ctags 5.5 or higher. Ctags is the program that generates the
tag information that Tagbar uses. It is shipped with most Linux
distributions, otherwise it can be downloaded from the following
website:
http://ctags.sourceforge.net/
Tagbar will work on any platform that ctags runs on -- this includes
UNIX derivatives, Mac OS X and Windows. Note that other versions like
GNU ctags will not work.
Tagbar generates the tag information by itself and doesn't need (or use)
already existing tag files.
- File type detection must be turned on in vim. This can be done with the
following command in your vimrc:
>
filetype on
<
See |filetype| for more information.
- Tagbar will not work in |restricted-mode| or with 'compatible' set.
==============================================================================
3. Installation *tagbar-installation*
Use the normal Vimball install method for installing tagbar.vba:
>
vim tagbar.vba
:so %
:q
<
Alternatively you can clone the git repository and then add the path to
'runtimepath' or use the pathogen plugin. Don't forget to run |:helptags| if
you're not using pathogen.
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 |g:tagbar_ctags_bin|.
==============================================================================
4. Usage *tagbar-usage*
There are essentially two ways to use Tagbar:
1. Have it running all the time in a window on the side of the screen. In
this case Tagbar will update its contents whenever the source file is
changed and highlight the tag the cursor is currently on in the file. If
a tag is selected in Tagbar the file window will jump to the tag and the
Tagbar window will stay open. |g:tagbar_autoclose| has to be unset for
this mode.
2. Only open Tagbar when you want to jump to a specific tag and have it
close automatically once you have selected one. This can be useful for
example for small screens where a permanent window would take up too much
space. You have to set the option |g:tagbar_autoclose| in this case. The
cursor will also automatically jump to the Tagbar window when opening it.
Opening and closing the Tagbar window~
Use |:TagbarOpen| or |:TagbarToggle| to open the Tagbar window if it is
closed. By default the window is opened on the right side, set the option
|g:tagbar_left| to open it on the left instead. If the window is already open,
|:TagbarOpen| will jump to it and |:TagbarToggle| will close it again.
|:TagbarClose| will simply close the window if it is open.
It is probably a good idea to assign a key to these commands. For example, put
this in your |vimrc|:
>
nnoremap <silent> <F9> :TagbarToggle<CR>
<
You can then open and close Tagbar by simply pressing the <F9> key.
You can also use |:TagbarOpenAutoClose| to open the Tagbar window, jump to it
and have it close automatically on tag selection regardless of the
|g:tagbar_autoclose| setting.
Jumping to tags~
When you're inside the Tagbar window you can jump to the definition of a tag
by moving the cursor to a tag and pressing <Enter> or double-clicking on it
with the mouse. The source file will then move to the definition and put the
cursor in the corresponding line. This won't work for pseudo-tags.
Sorting~
You can sort the tags in the Tagbar window in two ways: by name or by file
order. Sorting them by name simply displays the tags in their alphabetical
order under their corresponding scope. Sorting by file order means that the
tags keep the order they have in the source file, but are still associated
with the correct scope. You can change the sort order by pressing the "s" key
in the Tagbar window. The current sort order is displayed in the statusbar of
the Tagbar window.
Folding~
The displayed scopes (and unscoped types) can be folded to hide uninteresting
information. Mappings similar to Vim's built-in ones are provided. Folds can
also be opened and closed by clicking on the fold icon with the mouse.
Displaying the prototype of a tag~
Tagbar can display the prototype of a tag. More precisely it can display the
line in which the tag is defined. This can be done by either pressing <Space>
when on a tag or hovering over a tag with the mouse. In the former case the
prototype will be displayed in the command line |Command-line|, in the latter
case it will be displayed in a pop-up window. The prototype will also be
displayed when the cursor stays on a tag for 'updatetime' milliseconds.
------------------------------------------------------------------------------
COMMANDS *tagbar-commands*
:TagbarOpen
Open the Tagbar if it is closed. In case it is already open jump to it.
:TagbarClose
Close the Tagbar window if it is open.
:TagbarToggle
Open the Tagbar window if it is closed or close it if it is open.
:TagbarOpenAutoClose
Open the Tagbar window and close it on tag selection, regardless of the
setting of |g:tagbar_autoclose|. If it was already open jump to it.
:TagbarSetFoldlevel [number]
Set the foldlevel of the tags of the current file to [number]. The
foldlevel of tags in other files remains unaffected. Works in the same way
as 'foldlevel'.
:TagbarShowTag
Open the parent folds of the current tag in the file window as much as
needed for the tag to be visible in the Tagbar window.
------------------------------------------------------------------------------
KEY MAPPINGS *tagbar-keys*
These mappings are valid in the Tagbar window:
<F1> Display key mapping help.
<CR>/<Enter> Jump to the tag under the cursor. Doesn't work for pseudo-tags
or generic headers.
p Jump to the tag under the cursor, but stay in the Tagbar window.
<LeftMouse> When on a fold icon, open or close the fold depending on the
current state.
<2-LeftMouse> Same as <CR>.
<Space> Display the prototype of the current tag (i.e. the line defining
it) in the command line.
+/zo Open the fold under the cursor.
-/zc Close the fold under the cursor or the current one if there is
no fold under the cursor.
o/za Toggle the fold under the cursor or the current one if there is
no fold under the cursor.
*/zR Open all folds by setting foldlevel to 99.
=/zM Close all folds by setting foldlevel to 0.
<C-N> Go to the next top-level tag.
<C-P> Go to the previous top-level tag.
s Toggle sort order between name and file order.
x Toggle zooming the window.
q Close the Tagbar window.
==============================================================================
5. Configuration *tagbar-configuration*
*g:tagbar_ctags_bin*
g:tagbar_ctags_bin~
Default: empty
Use this option to specify the location of your ctags executable. Only needed
if it is not in one of the directories in your $PATH environment variable.
Example:
>
let g:tagbar_ctags_bin = 'C:\Ctags5.8\ctags.exe'
<
*g:tagbar_left*
g:tagbar_left~
Default: 0
By default the Tagbar window will be opened on the right-hand side of vim. Set
this option to open it on the left instead.
Example:
>
let g:tagbar_left = 1
<
*g:tagbar_width*
g:tagbar_width~
Default: 40
Width of the Tagbar window in characters.
Example:
>
let g:tagbar_width = 30
<
*g:tagbar_autoclose*
g:tagbar_autoclose~
Default: 0
If you set this option the Tagbar window will automatically close when you
jump to a tag.
Example:
>
let g:tagbar_autoclose = 1
<
*g:tagbar_autofocus*
g:tagbar_autofocus~
Default: 0
If you set this option the cursor will move to the Tagbar window when it is
opened.
Example:
>
let g:tagbar_autofocus = 1
<
*g:tagbar_sort*
g:tagbar_sort~
Default: 1
If this option is set the tags are sorted according to their name. If it is
unset they are sorted according to their order in the source file. Note that
in the second case Pseudo-tags are always sorted before normal tags of the
same kind since they don't have a real position in the file.
Example:
>
let g:tagbar_sort = 0
<
*g:tagbar_compact*
g:tagbar_compact~
Default: 0
Setting this option will result in Tagbar omitting the short help at the
top of the window and the blank lines in between top-level scopes in order to
save screen real estate.
Example:
>
let g:tagbar_compact = 1
<
*g:tagbar_expand*
g:tagbar_expand~
Default: 0
If this option is set the Vim window will be expanded by the width of the
Tagbar window if using a GUI version of Vim.
Example:
>
let g:tagbar_expand = 1
<
*g:tagbar_foldlevel*
g:tagbar_foldlevel~
Default: 99
The initial foldlevel for folds in the Tagbar window. Fold with a level higher
than this number will be closed.
Example:
>
let g:tagbar_foldlevel = 2
<
*g:tagbar_usearrows*
g:tagbar_usearrows~
{Windows only}
Default: 0
Tagbar can display nice Unicode arrows instead of +/- characters as fold icons.
However, Windows doesn't seem to be able to substitute in characters from
other fonts if the current font doesn't support them. This means that you have
to use a font that supports those arrows. Unfortunately there is no way to
detect whether specific characters are supported in the current font. So if
your font supports those arrows you have to set this option to make it work.
Example:
>
let g:tagbar_usearrows = 1
<
*g:tagbar_autoshowtag*
g:tagbar_autoshowtag~
Default: 0
If this variable is set and the current tag is inside of a closed fold then
the folds will be opened as much as needed for the tag to be visible so it can
be highlighted. If it is not set then the folds won't be opened and the parent
tag will be highlighted instead. You can use the TagbarShowTag command to open
the folds manually.
Example:
>
let g:tagbar_autoshowtag = 1
<
------------------------------------------------------------------------------
HIGHLIGHT COLOURS *tagbar-highlight*
All of the colours used by Tagbar can be customized. Here is a list of the
highlight groups that are defined by Tagbar:
TagbarComment
The help at the top of the buffer.
TagbarKind
The header of generic "kinds" like "functions" and "variables".
TagbarScope
Tags that define a scope like classes, structs etc.
TagbarType
The type of a tag or scope if available.
TagbarSignature
Function signatures.
TagbarPseudoID
The asterisk (*) that signifies a pseudo-tag.
TagbarFoldIcon
The fold icon on the left of foldable tags.
TagbarHighlight
The colour that is used for automatically highlighting the current tag.
TagbarAccessPublic
The "public" visibility/access symbol.
TagbarAccessProtected
The "protected" visibility/access symbol.
TagbarAccessPrivate
The "private" visibility/access symbol.
If you want to change any of those colours put a line like the following in
your vimrc:
>
highlight TagbarScope guifg=Green ctermfg=Green
<
See |:highlight| for more information.
------------------------------------------------------------------------------
AUTOMATICALLY OPENING TAGBAR *tagbar-autoopen*
If you want Tagbar to open automatically, for example on Vim startup or for
specific filetypes, there are various ways to do it. For example, to always
open Tagbar on Vim startup you can put this into your vimrc file:
>
autocmd VimEnter * nested TagbarOpen
<
If you want to have it start for specific filetypes put
>
TagbarOpen
<
into a corresponding filetype plugin (see |filetype-plugin|).
Check out |autocmd.txt| if you want it to automatically open in more
complicated cases.
==============================================================================
6. Extending Tagbar *tagbar-extend*
Tagbar has a flexible mechanism for extending the existing file type (i.e.
language) definitions. This can be used both to change the settings of the
existing types and to add completely new types.
Every type definition in Tagbar is a dictionary with the following keys:
ctagstype: The name of the language as recognized by ctags. Use the command >
ctags --list-languages
< to get a list of the languages ctags supports. The case doesn't
matter.
kinds: A list of the "language kinds" that should be listed in Tagbar,
ordered by the order they should appear in in the Tagbar window.
Use the command >
ctags --list-kinds={language name}
< to get a list of the kinds ctags supports for a given language. An
entry in this list is a string with two or three parts separated
by a colon: the first part is the one-character abbreviation that
ctags uses, and the second part is an arbitrary string that will
be used in Tagbar as the header for the tags of this kind that are
not listed under a specific scope. The optional third part
determines whether tags of this kind should be folded by default,
with 1 meaning they should be folded and 0 they should not. If
this part is omitted the tags will not be folded by default. For
example, the string >
"f:functions:1"
< would list all the function definitions in a file under the header
"functions" and fold them.
sro: The scope resolution operator. For example, in C++ it is "::" and
in Java it is ".". If in doubt run ctags as shown above and check
the output.
kind2scope: A dictionary describing the mapping of tag kinds (in their
one-character representation) to the scopes their children will
appear in, for example classes, structs etc.
Unfortunately there is no ctags option to list the scopes, you
have to look at the tags ctags generates manually. For example,
let's say we have a C++ file "test.cpp" with the following
contents: >
class Foo
{
public:
Foo();
~Foo();
private:
int var;
};
< We then run ctags in the followin way: >
ctags -f - --format=2 --excmd=pattern --fields=nksazSmt --extra= test.cpp
< Then the output for the variable "var" would look like this: >
var tmp.cpp /^ int var;$/;" kind:m line:11 class:Foo access:private
< This shows that the scope name for an entry in a C++ class is
simply "class". So this would be the word that the "kind"
character of a class has to be mapped to.
scope2kind: The opposite of the above, mapping scopes to the kinds of their
parents. Most of the time it is the exact inverse of the above,
but in some cases it can be different, for example when more than
one kind maps to the same scope. If it is the exact inverse for
your language you only need to specify one of the two keys.
replace: If you set this entry to 1 your definition will completely replace
{optional} an existing default definition. This is useful if you want to
disable scopes for a file type for some reason. Note that in this
case you have to provide all the needed entries yourself!
sort: This entry can be used to override the global sort setting for
{optional} this specific file type. The meaning of the value is the same as
with the global setting, that is if you want to sort tags by name
set it to 1 and if you want to sort them according to their order
in the file set it to 0.
deffile: The path to a file with additional ctags definitions (see the
{optional} section below on adding a new definition for what exactly that
means). This is especially useful for ftplugins since they can
provide a complete type definition with ctags and Tagbar
configurations without requiring user intervention.
Let's say you have an ftplugin that adds support for the language
"mylang", and your directory structure looks like this: >
ctags/mylang.cnf
ftplugin/mylang.vim
< Then the "deffile" entry would look like this to allow for the
plugin to be installed in an arbitray location (for example
with pathogen): >
'deffile' : expand('<sfile>:p:h:h') . '/ctags/mylang.cnf'
<
ctagsbin: The path to a filetype-specific ctags-compatible program like
{optional} jsctags. Set it in the same way as |g:tagbar_ctags_bin|. jsctags is
used automatically if found in your $PATH and does not have to be
set in that case. If it is not in your path you have to provide the
complete configuration and use the "replace" key (see the
Tagbar source code for the suggested configuration).
ctagsargs: The arguments to be passed to the filetype-specific ctags program
{optional} (without the filename). Make sure you set an option that makes the
program output its data on stdout. Not used for the normal ctags
program.
You then have to assign this dictionary to a variable with the name
>
g:tagbar_type_{vim filetype}
<
For example, for C++ the name would be "g:tagbar_type_cpp". If you don't know
the vim file type run the following command:
>
:set filetype?
<
and vim will display the file type of the current buffer.
Example: C++~
Here is a complete example that shows the default configuration for C++ as
used in Tagbar.
>
let g:tagbar_type_cpp = {
\ 'ctagstype' : 'c++',
\ 'kinds' : [
\ 'd:macros:1',
\ 'p:prototypes:1',
\ 'g:enums',
\ 'e:enumerators',
\ 't:typedefs',
\ 'n:namespaces',
\ 'c:classes',
\ 's:structs',
\ 'u:unions',
\ 'f:functions',
\ 'm:members',
\ 'v:variables'
\ ],
\ 'sro' : '::',
\ 'kind2scope' : {
\ 'g' : 'enum',
\ 'n' : 'namespace',
\ 'c' : 'class',
\ 's' : 'struct',
\ 'u' : 'union'
\ },
\ 'scope2kind' : {
\ 'enum' : 'g',
\ 'namespace' : 'n',
\ 'class' : 'c',
\ 'struct' : 's',
\ 'union' : 'u'
\ }
\ }
<
Which of the keys you have to specify depends on what you want to do.
Changing an existing definition~
If you want to change an existing definition you only need to specify the
parts that you want to change. It probably only makes sense to change "kinds"
and/or "scopes", which would be the case if you wanted to exclude certain
kinds from appearing in Tagbar or if you want to change their order. As an
example, if you didn't want Tagbar to show prototypes for C++ files and switch
the order of enums and typedefs, you would do it like this:
>
let g:tagbar_type_cpp = {
\ 'kinds' : [
\ 'd:macros:1',
\ 'g:enums',
\ 't:typedefs',
\ 'e:enumerators',
\ 'n:namespaces',
\ 'c:classes',
\ 's:structs',
\ 'u:unions',
\ 'f:functions',
\ 'm:members',
\ 'v:variables'
\ ]
\ }
<
Compare with the complete example above to see the exact change.
Adding a definition for a new language/file type~
In order to be able to add a new language to Tagbar you first have to create a
configuration for ctags that it can use to parse the files. This can be done
in two ways:
1. Use the --regex argument for specifying regular expressions that are used
to parse the files. An example of this is given below. A disadvantage of
this approach is that you can't specify scopes.
2. Write a parser plugin in C for ctags. This approach is much more powerful
than the regex approach since you can make use of all of ctags'
functionality but it also requires much more work. Read the ctags
documentation for more information about how to do this.
For the first approach the only keys that are needed in the Tagbar definition
are "ctagstype" and "kinds". A definition that supports scopes has to define
those two and in addition "scopes", "sro" and at least one of "kind2scope" and
"scope2kind".
Let's assume we want to add support for LaTeX to Tagbar using the regex
approach. First we put the following text into ~/.ctags or a file pointed to
by the "deffile" definition entry:
>
--langdef=latex
--langmap=latex:.tex
--regex-latex=/^\\tableofcontents/TABLE OF CONTENTS/s,toc/
--regex-latex=/^\\frontmatter/FRONTMATTER/s,frontmatter/
--regex-latex=/^\\mainmatter/MAINMATTER/s,mainmatter/
--regex-latex=/^\\backmatter/BACKMATTER/s,backmatter/
--regex-latex=/^\\bibliography\{/BIBLIOGRAPHY/s,bibliography/
--regex-latex=/^\\part[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/PART \2/s,part/
--regex-latex=/^\\part[[:space:]]*\*[[:space:]]*\{([^}]+)\}/PART \1/s,part/
--regex-latex=/^\\chapter[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/CHAP \2/s,chapter/
--regex-latex=/^\\chapter[[:space:]]*\*[[:space:]]*\{([^}]+)\}/CHAP \1/s,chapter/
--regex-latex=/^\\section[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\. \2/s,section/
--regex-latex=/^\\section[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\. \1/s,section/
--regex-latex=/^\\subsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\.\. \2/s,subsection/
--regex-latex=/^\\subsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\.\. \1/s,subsection/
--regex-latex=/^\\subsubsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\.\.\. \2/s,subsubsection/
--regex-latex=/^\\subsubsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\.\.\. \1/s,subsubsection/
--regex-latex=/^\\includegraphics[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\3/g,graphic+listing/
--regex-latex=/^\\lstinputlisting[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\3/g,graphic+listing/
--regex-latex=/\\label[[:space:]]*\{([^}]+)\}/\1/l,label/
--regex-latex=/\\ref[[:space:]]*\{([^}]+)\}/\1/r,ref/
--regex-latex=/\\pageref[[:space:]]*\{([^}]+)\}/\1/p,pageref/
<
This will create a new language definition with the name "latex" and associate
it with files with the extension ".tex". It will also define the kinds "s" for
sections, chapters and the like, "g" for included graphics, "l" for labels,
"r" for references and "p" for page references. See the ctags documentation
for more information about the exact syntax.
Now we have to create the Tagbar language definition in our vimrc:
>
let g:tagbar_type_tex = {
\ 'ctagstype' : 'latex',
\ 'kinds' : [
\ 's:sections',
\ 'g:graphics',
\ 'l:labels',
\ 'r:refs:1',
\ 'p:pagerefs:1'
\ ],
\ 'sort' : 0,
\ 'deffile' : expand('<sfile>:p:h:h') . '/ctags/latex.cnf'
\ }
<
The "deffile" field is of course only needed if the ctags definition actually
is in that file and not in ~/.ctags.
Sort has been disabled for LaTeX so that the sections appear in their correct
order. They unfortunately can't be shown nested with their correct scopes
since as already mentioned the regular expression approach doesn't support
that.
Tagbar should now be able to show the sections and other tags from LaTeX
files.
==============================================================================
7. Bugs and limitations *tagbar-bugs*
- Nested pseudo-tags cannot be properly parsed since only the direct parent
scope of a tag gets assigned a type, the type of the grandparents is not
reported by ctags (assuming the grandparents don't have direct, real
children).
For example, if we have a C++ with the following content:
>
foo::Bar::init()
{
// ...
}
foo::Baz::method()
{
// ...
}
<
In this case the type of "foo" is not known. Is it a namespace? A class?
For this reason the methods are displayed in Tagbar like this:
>
foo::Bar* : class
init()
foo::Baz* : class
method()
<
- Scope-defining tags at the top level that have the same name but a
different kind/scope type can lead to an incorrect display. For example,
the following Python code will incorrectly insert a pseudo-tag "Inner2"
into the "test" class:
>
class test:
class Inner:
def foo(self):
pass
def test():
class Inner2:
def bar(self):
pass
<
I haven't found a clean way around this yet, but it shouldn't be much of a
problem in practice anyway. Tags with the same name at any other level are
no problem, though.
==============================================================================
8. History *tagbar-history*
2.0.1 (2011-04-26)
- Fix sorting bug when 'ignorecase' is set
2.0 (2011-04-26)
- Folding now works correctly. Folds will be preserved when leaving the
Tagbar window and when switching between files. Also tag types can be
configured to be folded by default, which is useful for things like
includes and imports.
- DoctorJS/jsctags and other compatible programs are now supported.
- All of the highlight groups can now be overridden.
- Added keybinding to quickly jump to next/previous top-level tag.
- Added Taglist's "p" keybinding for jumping to a tag without leaving the
Tagbar window.
- Several bugfixes and other small improvements.
1.5 (2011-03-06)
- Type definitions can now include a path to a file with the ctags
definition. This is especially useful for ftplugins that can now ship
with a complete ctags and Tagbar configuration without requiring user
intervention. Thanks to Jan Christoph Ebersbach for the suggestion.
- Added autofocus setting by Taybin Rutkin. This will put the cursor in
the Tagbar window when it is opened.
- The "scopes" field is no longer needed in type definitions, the
information is already there in "scope2kind". Existing definitions will
be ignored.
- Some fixes and improvements related to redrawing and window switching.
1.2 (2011-02-28)
- Fix typo in Ruby definition
1.1 (2011-02-26)
- Don't lose syntax highlighting when ':syntax enable' is called
- Allow expanding the Vim window when Tagbar is opened
1.0 (2011-02-23)
- Initial release
==============================================================================
9. Todo *tagbar-todo*
- Allow filtering the Tagbar content by some criteria like tag name,
visibility, kind ...
- Integrate Tagbar with the FSwitch plugin to provide header file
information in C/C++.
- Allow jumping to a tag in the preview window, a split window or a new tab.
==============================================================================
10. Credits *tagbar-credits*
Tagbar was written by Jan Larres and is released under the Vim licence, see
|license|. It was heavily inspired by the Taglist plugin by Yegappan
Lakshmanan and uses a small amount of code from it.
Original taglist copyright notice:
Permission is hereby granted to use and distribute this code, with or without
modifications, provided that this copyright notice is copied with it. Like
anything else that's free, taglist.vim is provided *as is* and comes with no
warranty of any kind, either expressed or implied. In no event will the
copyright holder be liable for any damamges resulting from the use of this
software.
The folding technique was inspired by NERDTree by Martin Grenfell.
Taybin Rutkin:
- Contributed tagbar_autofocus option
Seth Milliken:
- Contributed folding keybindings that resemble the built-in ones
Thanks to the following people for feature suggestions etc: Jan Christoph
Ebersbach, pielgrzym
==============================================================================
vim: tw=78 ts=8 sw=8 sts=8 noet ft=help
-77
View File
@@ -1,77 +0,0 @@
---
layout: default
title: Tagbar, the Vim class outline viewer
---
<a href="https://github.com/majutsushi/tagbar"><img alt="Fork me on GitHub" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" style="position: absolute; top: 0; right: 0; border: 0;"/></a>
<div id="container">
<div id="title">
<h1><a href="https://github.com/majutsushi/tagbar">Tagbar</a></h1>
<p>A class outline viewer for Vim</p>
</div>
<div id="markdown-output"><h2>What Tagbar is</h2><p>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.</p><h2>What Tagbar is not</h2><p>Tagbar is not a general-purpose tool for managing <code>tags</code> files. It only
creates the tags it needs on-the-fly in-memory without creating any files.
<code>tags</code> file management is provided by other plugins, like for example
<a href="https://github.com/xolox/vim-easytags">easytags</a>.</p><h2>Dependencies</h2><p><a href="http://www.vim.org/">Vim 7.0</a> (But see note below)<br/>
<a href="http://ctags.sourceforge.net/">Exuberant ctags 5.5</a></p><h2>Installation</h2><p>Extract the archive or clone the repository into a directory in your
<code>'runtimepath'</code>, or use a plugin manager of your choice like
<a href="https://github.com/tpope/vim-pathogen">pathogen</a>. Don't forget to run
<code>:helptags</code> if your plugin manager doesn't do it for you so you can access the
documentation with <code>:help tagbar</code>.</p><p>Note: Vim versions &lt; 7.0.167 have a bug that prevents Tagbar from working. If
you are affected by this use this alternate Tagbar download instead:
<a href="https://github.com/majutsushi/tagbar/zipball/70fix">zip</a>. It is on par with
version 2.2 but probably won't be updated after that due to the amount of
changes required.</p><p>If the ctags executable is not installed in one of the directories in your
<code>$PATH</code> environment variable you have to set the <code>g:tagbar_ctags_bin</code>
variable, see the documentation for more info.</p><h2>Quickstart</h2><p>Put something like the following into your ~/.vimrc:</p><pre><code class="vim">nmap &lt;F8&gt; :TagbarToggle&lt;CR&gt;
</code></pre><p>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.</p><h2>Support for additional filetypes</h2><p>For filetypes that are not supported by Exuberant Ctags check out <a href="https://github.com/majutsushi/tagbar/wiki">the
wiki</a> 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.</p><h2>Note: If the file structure display is wrong</h2><p>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
<a href="http://ctags.sourceforge.net/">exuberant-ctags</a> 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.</p><p>There is an example in <code>:h tagbar-issues</code> 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!</p><p>You can also have a look at <a href="https://github.com/majutsushi/tagbar/issues?labels=ctags-bug&amp;page=1&amp;state=closed">ctags bugs that have previously been filed
against Tagbar</a>.</p><h2>Screenshots</h2><p><img alt="screenshot1" src="https://i.imgur.com/Sf9Ls2r.png"/>
<img alt="screenshot2" src="https://i.imgur.com/n4bpPv3.png"/></p><h2>License</h2><p>Vim license, see LICENSE</p><h2>Maintainer</h2><p>Jan Larres &lt;<a href="mailto:jan@majutsushi.net">jan@majutsushi.net</a>&gt;</p></div>
<h2>Download</h2>
<h3>Latest stable release</h3>
{% for post in site.posts limit:1 %}
<span style="font-weight:bold">{{ post.title }}</span> ({{ post.date | date:"%Y-%m-%d" }})
<a href="https://github.com/majutsushi/tagbar/zipball/v{{ post.title }}">zip</a>
<a href="https://github.com/majutsushi/tagbar/tarball/v{{ post.title }}">tar</a>
{{ post.content }}
{% endfor %}
<a href="archive">Old releases</a>
<h3>Latest development version</h3>
<p>
Download as:
<a href="https://github.com/majutsushi/tagbar/zipball/master">zip</a>
<a href="https://github.com/majutsushi/tagbar/tarball/master">tar</a>
</p>
<p>
You can also clone the project with <a href="http://git-scm.com">Git</a>
by running:
<pre>$ git clone git://github.com/majutsushi/tagbar</pre>
</p>
<div class="footer">
get the source code on GitHub : <a href="https://github.com/majutsushi/tagbar">majutsushi/tagbar</a>
</div>
</div>
+2596
View File
File diff suppressed because it is too large Load Diff
+60
View File
@@ -0,0 +1,60 @@
" File: tagbar.vim
" Description: Tagbar syntax settings
" Author: Jan Larres <jan@majutsushi.net>
" Licence: Vim licence
" Website: http://majutsushi.github.com/tagbar/
" Version: 2.0.1
if exists("b:current_syntax")
finish
endif
if has('multi_byte') && has('unix') && &encoding == 'utf-8' &&
\ (empty(&termencoding) || &termencoding == 'utf-8')
syntax match TagbarKind '\([▶▼] \)\@<=[^-+: ]\+[^:]\+$'
syntax match TagbarScope '\([▶▼][-+# ]\)\@<=[^*]\+\(\*\?\(([^)]\+)\)\? :\)\@='
syntax match TagbarFoldIcon '[▶▼]\([-+# ]\)\@='
syntax match TagbarAccessPublic '\([▶▼ ]\)\@<=+\([^-+# ]\)\@='
syntax match TagbarAccessProtected '\([▶▼ ]\)\@<=#\([^-+# ]\)\@='
syntax match TagbarAccessPrivate '\([▶▼ ]\)\@<=-\([^-+# ]\)\@='
elseif has('multi_byte') && (has('win32') || has('win64')) && g:tagbar_usearrows
syntax match TagbarKind '\([▷◢] \)\@<=[^-+: ]\+[^:]\+$'
syntax match TagbarScope '\([▷◢][-+# ]\)\@<=[^*]\+\(\*\?\(([^)]\+)\)\? :\)\@='
syntax match TagbarFoldIcon '[▷◢]\([-+# ]\)\@='
syntax match TagbarAccessPublic '\([▷◢ ]\)\@<=+\([^-+# ]\)\@='
syntax match TagbarAccessProtected '\([▷◢ ]\)\@<=#\([^-+# ]\)\@='
syntax match TagbarAccessPrivate '\([▷◢ ]\)\@<=-\([^-+# ]\)\@='
else
syntax match TagbarKind '\([-+] \)\@<=[^-+: ]\+[^:]\+$'
syntax match TagbarScope '\([-+][-+# ]\)\@<=[^*]\+\(\*\?\(([^)]\+)\)\? :\)\@='
syntax match TagbarFoldIcon '[-+]\([-+# ]\)\@='
syntax match TagbarAccessPublic '\([-+ ]\)\@<=+\([^-+# ]\)\@='
syntax match TagbarAccessProtected '\([-+ ]\)\@<=#\([^-+# ]\)\@='
syntax match TagbarAccessPrivate '\([-+ ]\)\@<=-\([^-+# ]\)\@='
endif
syntax match TagbarComment '^".*'
syntax match TagbarType ' : \zs.*'
syntax match TagbarSignature '(.*)'
syntax match TagbarPseudoID '\*\ze :'
highlight default link TagbarComment Comment
highlight default link TagbarKind Identifier
highlight default link TagbarScope Title
highlight default link TagbarType Type
highlight default link TagbarSignature SpecialKey
highlight default link TagbarPseudoID NonText
highlight default link TagbarFoldIcon Statement
highlight default link TagbarHighlight Search
highlight default TagbarAccessPublic guifg=Green ctermfg=Green
highlight default TagbarAccessProtected guifg=Blue ctermfg=Blue
highlight default TagbarAccessPrivate guifg=Red ctermfg=Red
let b:current_syntax = "tagbar"
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env python
# This script is originally from the YouCompleteMe project.
from bs4 import BeautifulSoup
from markdown import markdown
import fileinput
markdown_lines = list(fileinput.input())
# Delete the header
del markdown_lines[:2]
markdown_source = ''.join(markdown_lines)
with open('index.html', 'r+') as content_file:
content = content_file.read()
new_contents = markdown(unicode(markdown_source, 'utf-8'),
extensions=['fenced_code'])
new_tags = BeautifulSoup(new_contents, 'html5lib')
# soup = BeautifulSoup(content, "html5lib")
# Use the normal html parser so it doesn't add html/body tags
# around our fragment
soup = BeautifulSoup(content, "html.parser")
elem = soup.find(id="markdown-output")
elem.clear()
for new_elem in new_tags.body.contents:
elem.append(new_elem)
content_file.seek(0)
content_file.truncate()
content_file.write(str(soup))