Open-source project
preservim/tagbar avatar
preservim/tagbar

Tagbar tutorial: how a ctags outline sidebar works in Vim

Vim plugin that displays tags in a window, ordered by scope

6,216 stars475 forksVim ScriptNOASSERTION

At a glance

What is it?
Tagbar turns ctags output for the file you are editing into a sidebar window ordered by scope, which makes it a per-buffer outline viewer rather than a tags file manager. Everything it shows depends on the ctags binary you hand it.
Who is it for?
Tagbar suits Vim and Neovim users who want a scope-aware outline of the file in front of them and are willing to depend on an external ctags binary; it does not suit anyone who needs a project-wide index, because it writes no tags file and leaves that job to gutentags.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 154 days ago.
What is it written in?
Mainly Vim Script, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • preservim/tagbar6,216 ★ · -8
Star history
Repository2026-09-232026-11-15
preservim/tagbar6.2k6.2k

-8 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The sidebar is ctags output ordered by scope

Tagbar does not read your source file itself. It gives the current file to a ctags implementation and turns the result into a window that opens beside the buffer, with entries arranged so that scope decides the nesting: methods defined inside a C++ class are listed under that class. Anything the parser emits becomes an entry in the outline, which is why the plugin needs an external ctags binary instead of Vim's own tag machinery.

That division has consequences for setup. Vim 7.3.1058 or newer is the stated floor, and any version of Neovim is accepted. The code is Vim Script, and the repository ships the conventional plugin layout: autoload/ holds the implementation, plugin/ is what Vim sources at startup, doc/ holds the help file, and syntax/ handles highlighting inside the window. There is no dependency file to resolve during install. The ctags executable is the only thing you have to have on the machine.

No tags file is ever written

Tagbar builds its tag list on the fly and holds it in memory. Nothing lands on disk, and no tags file is created or updated as a side effect of opening the sidebar. That is a deliberate boundary, and the project states it plainly: Tagbar is not a general-purpose tool for managing tags files.

The practical effect is that a persistent tags file, if you want one, has to come from somewhere else. The project points at gutentags for that job. If your workflow depends on jumping to a symbol defined in a file you have not opened yet, Tagbar will not get you there, because the tags it knows about come from the file in front of you. Read it as a structural view of one buffer rather than an index of a project, and the boundary stops feeling like a gap.

g:tagbar_ctags_bin is the first thing to check when the window stays empty

If the ctags executable is not installed in one of the directories listed in your $PATH environment variable, you have to set the g:tagbar_ctags_bin variable, which points the plugin at an executable sitting somewhere else. The help file covers the details, reachable with :help tagbar.

Version choice matters here in a way that is easy to read past. Universal Ctags is the strongly recommended implementation, a maintained fork of Exuberant Ctags with many bugfixes, support for many more formats and proper Unicode handling. Exuberant Ctags 5.5 or higher works to some degree, but the project marks it as destined for deprecation. A 5.5 binary that renders an outline today is a binary you will eventually have to replace.

Extracting into 'runtimepath' and mapping F8

Installation is manual by default: extract the archive, or clone the repository into a directory inside your 'runtimepath'. A plugin manager is the other route, and pathogen is the one named. Either way, run :helptags afterwards if your manager does not do it for you, otherwise the help file stays invisible even though it is on disk.

vim
:helptags
:help tagbar

Those two ex commands rebuild the help tags for the runtime path and then open the documentation. Once that works, the first real action is a mapping in your ~/.vimrc:

vim
nmap <F8> :TagbarToggle<CR>

That line is the quickstart as the project gives it. F8 toggles the Tagbar window, and any other shortcut works if you prefer one. The documentation covers the remaining commands, including the more flexible ways to open and close the window.

Filetypes Exuberant Ctags cannot parse

Tagbar inherits the parser's coverage, and the README sends you elsewhere for the gap: for filetypes that Exuberant Ctags does not support, it points at the project wiki instead of promising a fix. The wiki is the collection point for other projects and configurations, and you are asked to add anything you find or create so that others can use it too.

Two providers are named in the dependency notes as able to handle additional formats: jsctags for JavaScript and phpctags for PHP. Neither is a Tagbar feature, and neither changes how the sidebar behaves. They stand in for the parser. If your file type sits outside what your ctags build recognises, the outline you want belongs to another project, and this plugin does not close that gap on its own.

When the outline looks wrong, the parser is the first suspect

A malformed outline is the usual complaint shape, and the project's guidance is to confirm the fault lies in Tagbar before filing a report. The reasoning is structural: Tagbar uses exuberant-ctags and compatible programs to do the actual file parsing, so a wrong entry has to be traced back to the program responsible for that filetype.

The documentation makes that testable. There is an example in :h tagbar-issues showing how to run ctags manually, which lets you compare raw parser output against what the sidebar shows and settle where the bug lives. If ctags is at fault, the report belongs on the ctags project's own site, since there is nothing the plugin author can do about it. Traced cases sit in the issue tracker under the closed ctags-bug label. That division keeps the plugin's own bug surface small, and it also means a wrong outline can be unfixable from inside Vim.

gutentags, jsctags and phpctags cover different halves of the job

If what you want is a project-wide index rather than a sidebar of the current buffer, gutentags is the plugin the project names, because tags file management sits outside Tagbar's scope by design. The difference in approach is persistence and reach. A tags file manager keeps an index on disk that spans files you have not opened; Tagbar creates the tags it needs for the current file on the fly, in memory, without creating any files.

The other alternatives work at the parser level. jsctags and phpctags exist to give ctags knowledge of one language, so plugging one in changes what the sidebar can contain for that filetype and nothing about how it behaves. Neither replaces the window. The documentation names no drop-in substitute for the sidebar itself, so anyone shopping for a replacement should expect to assemble an index plugin and a language parser rather than swap one plugin for another.

No tagged releases, so upgrades mean resyncing master

The repository has no GitHub releases and the default branch is master, so there is no version number to pin and no changelog attached to a tag. The last push was on 2026-06-14 and the project is not archived, which means what you install is simply the current state of master. With pathogen or a comparable manager, updating is a re-sync of that directory rather than an upgrade between releases.

Licensing is the simple part. Distribution is under the terms of the Vim license, with a LICENSE file at the repository root, while the repository's licence field reads as unasserted. Anyone who needs the exact wording should read that file; none of this is legal advice.

History is documented rather than versioned. The plugin was originally written by Jan Larres, the README credits Caleb Maclennan and David Hegland as its maintainers, and at least 75 other people have contributed features and bug fixes over the years. Two workflow badges, Vint and Check, sit above a .vintrc.yaml at the root, so the checks live in the repository while the versioning does not exist.

Editorial conclusion

Tagbar suits Vim and Neovim users who want a scope-aware outline of the file in front of them and are willing to depend on an external ctags binary; it does not suit anyone who needs a project-wide index, because it writes no tags file and leaves that job to gutentags. Verify two things before installing: that Universal Ctags is on your $PATH rather than an Exuberant Ctags 5.5 build, which the README says will be deprecated eventually, and that your filetype is covered by the parser you intend to use.

Frequently asked questions

How do I use tags in Vim with Tagbar?

Tagbar shows the tags a ctags program generates for the file you are editing, grouped by scope in a sidebar window. Those tags are created on the fly and kept in memory, so no tags file is written; persistent tag storage is the job of other plugins such as gutentags.

What is tag bar in Vim?

Tagbar is a Vim plugin that builds a sidebar for the current file from ctags-generated tags ordered by scope, so methods in a C++ class appear under that class. It needs Vim 7.3.1058 or newer, or any version of Neovim, plus a ctags implementation.

Vim tagbar alternative: what should I use instead?

For tags file management the README points to other plugins such as gutentags, because Tagbar never writes a tags file. For languages Exuberant Ctags cannot parse, providers such as jsctags and phpctags can be used instead, and the project wiki collects those combinations. No drop-in replacement for the sidebar itself is named.

Official sources

  1. Issues
  2. preservim/tagbar on GitHub
  3. Project website
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/preservim-tagbar.svg)](https://hysenlabs.com/projects/preservim-tagbar)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/preservim-tagbar.svg)](https://hysenlabs.com/projects/preservim-tagbar)

Was this useful?