Skip to content

A starting point/guide for creating custom statusline, statuscolumn, tabline & winbar for Neovim.

License

Notifications You must be signed in to change notification settings

OXY2DEV/bars.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ bars.nvim

Neovim Repo size GitHub Release

A starting point/guide for creating custom statusline, statuscolumn, tabline & winbar for Neovim.

bars.nvim is NOT a plugin, if it wasn't clear. It's just a reference manual.

πŸ“– Table of contents

✨ Features

  • Actually fast,

    • Termux: average: 7ms, lowest: 5ms.
    • MacOS: average: 2ms, lowest: 1.8ms.
  • Fully customisable.

  • Per-window configuration.

  • Ability to toggle various bars/lines via commands.

πŸ“š Requirements

  • 0.10.4 or higher recommended.

Note

The version requirement varies for different parts of bars.nvim.

  • Nerd font >= 3.0.0
  • Git(branch in statusline).
  • Tree-sitter parser(node in winbar).

πŸ’‘ Guide

Guide for creating your own custom statusline, statuscolumn, tabline & winbar are given below,

πŸ“ Installation

🧩 Vim-plug

Add this to your plugin list.

Plug "OXY2DEV/bars.nvim"

πŸ’€ lazy.nvim

Note

Lazy loading is NOT needed for this!

For plugins.lua users,

{
    "OXY2DEV/bars.nvim",
},

For plugins/bars.lua,

return {
    "OXY2DEV/bars.nvim",
};

🦠 mini.deps

local MiniDeps = require("mini.deps");

MiniDeps.add({
    source = "OXY2DEV/bars.nvim"
});

πŸŒ’ Rocks.nvim

Warning

luarocks package may sometimes be a bit behind main.

:Rocks install bars.nvim

πŸ“₯ GitHub release

Tagged releases can be found in the release page.

Note

Github releases may sometimes be slightly behind main.

🧭 Configuration

bars.nvim can be configured in 2 ways,

  1. Via the setup() function.
require("bars").setup({
    global = false
});
  1. Via the modules own setup function.
require("bars.statusline").setup({
    ignore_filwtypes = { "help" }
});

Check the wiki to learn about all the configuration options!

Usage instructions for different modules,

🧰 Commands

bars.nvim provides a single command :Bars which has sub-commands that can be used to do different things.

USAGE,
    :Bars

    :Bars [sub-command]

    :Bars [sub-command] [modifier]

    :Bars [sub-command] [modifier] [window_1] [window_2] ..

EXAMPLE,
    :Bars toggle ? 1000

The sub-commands are given below,

Sub-command Description
Toggle Used to toggle statusline, statuscolumn etc. globally.
Enable Used to enable statusline, statuscolumn etc. globally.
Disable Used to disable statusline, statuscolumn etc. globally.
toggle Used to toggle statusline, statuscolumn etc. of given window(s).
enable Used to enable statusline, statuscolumn etc. of given window(s).
disable Used to disable statusline, statuscolumn etc. of given window(s).
clean Cleans up cached values of deleted windows.
update Updates the module's configuration ID of given window.

All the sub-commands support modifier to specify which modules should be affected by the command.

Tip

If you want to run a sub-command on the current window then you can ignore the modifier.

" Toggles all bars & lines for the current window.
:Bars toggle

Modifiers are given below,

Modifier Description
all Affects all modules.
? Prompt which module(s) to affect.
statusline Self-explanatory.
statuscolumn Self-explanatory.
tabline Self-explanatory.
winbar Self-explanatory.

You can add any number of windows after the modifier to specify which windows to run the command on.

Tip

Cmdline completion are provided for all sub-commands/modifiers/windows!

🎨 Highlight groups

bars.nvim comes with the following highlight groups,

  • BarsFoldClose1

  • BarsFoldOpen1

  • BarsFoldClose2

  • BarsFoldOpen2

  • BarsFoldClose3

  • BarsFoldOpen3

  • BarsFoldClose4

  • BarsFoldOpen4

  • BarsFoldClose5

  • BarsFoldOpen5

  • BarsFoldClose6

  • BarsFoldOpen6

  • BarsLineNr

  • BarsWrap1<1..10>

  • BarsVirtual2<1..10>

  • BarsNormal<1..10>

  • BarsInsert<1..10>

  • BarsVisual<1..10>

  • BarsVisualLine<1..10>

  • BarsVisualBlock<1..10>

  • BarsCommand<1..10>

  • BarsNormal

  • BarsInsert

  • BarsVisual

  • BarsVisualLine

  • BarsVisualBlock

  • BarsCommand

  • BarsFt

  • BarsFt0

  • BarsFt1

  • BarsFt2

  • BarsFt3

  • BarsFt4

  • BarsFt5

  • BarsFt6

  • BarsGit

  • BarsRuler

  • BarsRulerVisual

About

A starting point/guide for creating custom statusline, statuscolumn, tabline & winbar for Neovim.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages