Skip to content
Source outline viewer for Kakoune
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
rc do not modify / register state on jumping (#6) Mar 21, 2019
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md add more info about kinds Mar 21, 2019

README.md

tagbar.kak

tagbar.kak

This plugin displays the outline overview of your code, somewhat similar to Vim plugin tagbar. It uses ctags to generate tags for current buffer, and readtags to display them.

Tagbar.kak doesn't display your project structure, but current file structure, providing ability to jump to the definition of the tags in current file.

Installation

With plug.kak

Add this snippet to your kakrc:

plug "andreyorst/tagbar.kak"

Without Plugin Manager

Clone this repo, and place tagbar.kak to your autoload directory, or source it manually.

Dependencies

For this plugin to work, you need working ctags and readtags programs. Note that readtags isn't shipped with exuberant-ctags by default (you can use universal-ctags).

Configuration

Tagbar.kak supports configuration via these options:

  • tagbar_sort - affects tags sorting method in sections of the tagbar buffer;
  • tagbar_display_anon - affects displaying of anonymous tags;
  • tagbar_side - defines what side of the tmux pane should be used to open tagbar;
  • tagbar_size - defines width or height in cells or percents;
  • tagbar_split - defines how to split tmux pane, horizontally or vertically;
  • tagbarclient - defines name of the client that tagbar will create and use to display itself.
  • tagbar_ctags_cmd - defines what command will be used to generate tag file. This option was added to allow setting custom ctags-compatible executable for languages that are not supported by ctags package, but have a compatible parser. If you want to set up tagbar.kak for unsupported language, you also need to populate tagbar_kinds option with pairs of kinds for the language. For example, for C, kinds are defined as follows 'f' 'Function Definitions', 'g' 'Enumeration Names', 'h' 'Included Header files', and so on.

Automatic startup

To start tagbar.kak automatically on certain filetypes, you can use this hook:

# To see what filetypes are supported use `ctags --list-kinds | awk '/^\w+/'
hook global WinSetOption filetype=(c|cpp|rust) %{
    tagbar-enable
}

Note that tagbar.kak currently allows only one client per session.

Usage

Tagbar.kak provides these commands:

  • tagbar-enable - spawn new client with *tagbar* buffer in it, and define watching hooks;
  • tagbar-toggle - toggles tagbar client on and off;
  • tagbar-disable - destroys tagbar client and support hooks. That's a proper way to exit tagbar.

When $TMUX option is available Tagbar.kak will create split accordingly to the settings. If Kakoune launched in X, new window will be spawned, letting window manager to handle it.

In tagbar window you can use Ret key to jump to the definition of the tag. tagbar window will keep track of file opened in the last active client.

You can’t perform that action at this time.