A Neovim plugin to attach customisable components to the statusline. Written in Lua.
You can install this plugin with your favourite package manager. As an example, for vim-plug:
Plug 'sam4llis/nvim-stratus'
Stratus allows the user to split the statusline into multiple components and
comes with a multitude of built-in components for easy configuration. To add
stratus components to your statusline, you can call Stratus' setup()
function.
This setup function requires a components
table, which tells Stratus which
components should be added to the statusline.
My default configuration for Stratus uses colours defined by the Catppuccin colorscheme.
local cp = require('catppuccin.core.color_palette')
local separators = require('nvim-stratus.ui.separators')
local builtins = require('nvim-stratus.builtins')
local components = {
{
operation = function ()
return builtins.current_mode()
end,
style = {
fg = cp.black2,
bg = cp.gray2,
gui= 'bold',
},
separator = separators.arrow,
},
{
operation = function ()
return builtins.git_branch()
end,
style = {
fg = cp.black2,
bg = cp.gray2,
gui= 'bold',
},
separator = separators.arrow,
},
{
operation = function ()
return builtins.filename()
end,
style = {
fg = cp.black2,
bg = cp.pink,
gui= 'bold',
},
separator = separators.arrow,
},
{
operation = function ()
return builtins.modified()
end,
style = {
fg = cp.black2,
bg = cp.pink,
gui= 'bold',
},
separator = separators.arrow,
},
{
operation = function ()
return builtins.spell_check()
end,
style = {
fg = cp.black2,
bg = cp.pink,
gui= 'bold',
},
separator = separators.arrow,
position = 'right',
},
{
operation = function ()
return builtins.file_directory()
end,
style = {
fg = cp.black2,
bg = cp.pink,
gui= 'bold',
},
separator = separators.arrow,
position = 'right',
},
{
operation = function ()
return builtins.percentage_line_count()
end,
style = {
fg = cp.black2,
bg = cp.gray2,
gui= 'bold',
},
separator = separators.arrow,
position = 'right',
},
}
require('nvim-stratus').setup(components)
This creates a statusline that looks like the following: