Neovim 101 — Status Line, WinBar, and Buffer Line

Tips and tricks to configure status line, window bar, and buffer line.

alpha2phi
6 min readNov 12, 2022

--

Neovim 101 — Status Line, WinBar, and Buffer Line

This article explores several tips and tricks to configure the status line, window bar, and buffer line. The code snippets can be adapted to fit into other similar plugins.

This article is part of the Neovim 101 series.

The Neovim configuration files are available in this and this repository.

Getting Started

Many Neovim plugins are available to manage the status line, window bar, and buffer line.

This article goes through several tips and tricks to leverage these plugins to improve our development workflow.

Status Line

Let’s get started with the status line.

Show Command and Macro

Vim provides the showcmd (:h showcmd) option that shows the command in the last line of the screen.

The screenshot below shows the partial command in the command line when the option is set.

Show Command

With the feature to set the command line height to 0 (:h cmdheight), we cannot see the command and any macro recording message.

Using the lualine.nvim and Noice plugins, we can use the status line for the same purpose.

Let’s install these 2 plugins using packer.nvim.

In the lua/config/lualine.lua file, we configure the status line using Noice for

  • message — last line of the previous message (event=show_msg)
  • command — showcmd
  • mode — showmode (macro recording messages)
  • search — search count messages

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.