This article provides a guide on customizing the status line in Neovim with and without plugins.
Abstract
The article "Neovim for Beginners — Status Line" explains how to customize the status line in Neovim, both with and without plugins. The author discusses the basics of the status line, including the laststatus option and the structure of status line items. The article then demonstrates how to configure the status line using Lua and the Lualine plugin, as well as how to integrate the nvim-gps plugin to display the current scope in the status line. The author also provides examples and screenshots to illustrate the customization process.
Bullet points
The article explains how to customize the status line in Neovim.
The author discusses the basics of the status line, including the laststatus option and the structure of status line items.
The article demonstrates how to configure the status line using Lua and the Lualine plugin.
The author shows how to integrate the nvim-gps plugin to display the current scope in the status line.
The article provides examples and screenshots to illustrate the customization process.
Neovim for Beginners — Status Line
Customize the status line to show useful information, with and without plugins.
Neovim for Beginners — Status Line
Let’s learn how to customize the status line with and without any plugins.
We are going to
Configure the status line without using any plugins (:h statusline).
Use the Lualine plugin to configure the status line in Lua.
Integrate nvim-gps with Lualine to see the current scope in the status line.
Without any customization, the default status line, using the Everforest theme, should look similar to the following.
Lualine using Everforest Theme
Lualine has many features, including support for LSP diagnostics and extensions for changing the status line appearance for a window/buffer with specified file types. For now, let’s customize it using nvim-gps to show the current scope we are working inside.
If we want to have a global status line, set the Lualine globalstatus option to true. This option configures the Neovim laststatus option to 3 (available since release 0.7). I prefer a global status line.
Global Status Line
We can also set cmdheight (:h ‘cmdheight’) to 0 to hide the command line.