Skip to content

Features

github-actions[bot] edited this page Nov 11, 2026 · 2 revisions

Features

简体中文

  • Colours derived from the colorscheme where possible.
  • Sort buffers by extension, directory, or a custom compare function.
  • Configuration via Lua functions for greater customization.

See also: Multiline Buffer Tabs.

Alternate styling

Slanted tabs

slanted tabs

NOTE: some terminals require special characters to be padded, so set the style to padded_slant if the appearance isn't right in your terminal emulator. Results vary by terminal emulator and this style might not work everywhere.

Sloped tabs

sloped tabs

See :help bufferlines-styling.

Hover events

NOTE: only available for Neovim 0.8+. Not supported with multiline.

hover-event-preview

See :help bufferlines-hover-events.

Underline indicator

Screen Shot 2022-08-22 at 09 14 24

Your mileage will vary based on your terminal emulator. The screenshot above was achieved using kitty nightly (as of August 2022), with increased underline thickness and an increased underline position so it sits further from the text.

Tabpages

Screen Shot 2022-03-08 at 17 39 57

Set the mode option to tabs to show only tabpages. This turns the bufferlines into a tabline with many of the same features and styling, but not all:

  • Sorting doesn't work yet, as that needs to be thought through.
  • Grouping doesn't work yet, for the same reason.

mode = "tabs" is not supported with multiline.

LSP indicators

LSP Indicator

Setting diagnostics = "nvim_lsp" | "coc" adds an indicator for any buffer with errors, so you can tell at a glance which buffers are affected.

Customise the appearance of the count with a function:

--- count is an integer representing total count of errors
--- level is a string "error" | "warning"
--- diagnostics_dict is a dictionary from error level ("error", "warning" or "info") to number of errors for each level.
--- this should return a string
--- Don't get too fancy as this function will be executed a lot
diagnostics_indicator = function(count, level, diagnostics_dict, context)
  local icon = level:match("error") and "" or ""
  return " " .. icon .. count
end

diagnostics_indicator

diagnostics_indicator = function(count, level, diagnostics_dict, context)
  local s = " "
  for e, n in pairs(diagnostics_dict) do
    local sym = e == "error" and ""
      or (e == "warning" and "" or "")
    s = s .. n .. sym
  end
  return s
end

Indicators can be reported conditionally, based on buffer context. For instance, disable them for the current buffer and show them only for other buffers:

diagnostics_indicator = function(count, level, diagnostics_dict, context)
  if context.buffer:current() then
    return ''
  end

  return ''
end

current visible

The first bufferlines shows diagnostic.lua as the current buffer. It has LSP reported errors, but they don't show up. The second shows 500-nvim-bufferlines.lua as current; because the 'faulty' diagnostic.lua buffer transitioned from current to visible, its indicator now appears.

Change the filename highlighting for error states via :help bufferlines-highlights.

Groups

bufferline_group_toggle

Groups visualize related buffers in clusters and let you operate on them together — for example, clicking the group indicator hides all its buffers. Partly inspired by Chrome's tabs and centaur-tabs' groups.

See :help bufferlines-groups.

Sidebar offsets

explorer header

See :help bufferlines-sidebar-offset. Offsets apply to the native tabline only; multiline uses its editor split's actual width.

Numbers

bufferlines with numbers

Prefix buffer names with either the ordinal or buffer id using the numbers option, specified as buffer_id | ordinal or a function.

numbers

See :help bufferlines-numbers.

Unique names

duplicate names

Close icons

close button

Re-ordering

re-order buffers

This order can be persisted between sessions (enabled by default).

Picking

bufferlines pick

See :help bufferlines-pick.

Pinning

Screen Shot 2022-03-31 at 18 13 50

Custom areas

custom area

See :help bufferlines-custom-areas. Custom areas are single-row only and are not supported with multiline.

Clone this wiki locally