Yet another minimal and lightweight statusline plugin designed for neovim. It prioritizes simplicity and performance without sacrificing functionality.
In addition to easy integration with vim's default statusline items, YASL provides the following features:
- LSP Diagnostics: Keep track of lsp diagnostic informations
- Git Informations:
- Display the current branch name
- Show git diff stats to stay informed about changes
- Active Mode: Easily identify the currently active mode with dynamic colors
- Custom Components: Create your own custom providers with simple recipe.
These features are available without relying on any extra dependencies. It also tries to be more efficient by evaluating each statusline component only when needed, preventing unnecessary and expensive function calls.
lazy.nvim
{
"brianaung/yasl.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons", -- (optional) if you want icons
},
opts = {}
}
packer.nvim
require("packer").startup(function()
use({
"brianaung/yasl.nvim",
config = function()
require("yasl").setup()
end,
})
end)
- mode
- diagnostics
- branch
- gitdiff
- filetype
- Your own custom component. See recipe.
- Any valid string used by vim's statusline items. See
:h statusline
.
gitdiff
component has some issues on versions less than v0.10.0 so it's currently disabled by default. See: neovim/neovim#21856
require("yasl").setup({
-- See :h laststatus
laststatus = 3,
-- true if nvim-web-devicons is installed, otherwise false
enable_icons = true,
--[[
Accepts provided component name (or)
any string vim can use for statusline value. See :h statusline
Default layout:
+-----------------------------------------------------------------------+
| mode | name branch | | diagnostics | ft location progress |
+-----------------------------------------------------------------------+
]]--
components = {
"mode",
" ",
"%<%t%h%m%r%w", -- filename
" ",
"branch",
" ",
"diagnostics",
" ",
"filetype",
" ",
"[%-8.(%l, %c%V%) %P]", -- location, and progress
" ",
}
})
To provide your own custom components, simply pass in a table to components
array
with events
and update
values set.
require("yasl").setup({
...
components = {
...
{
-- Events that will trigger update function calls and redraws the statusline.
events = { "BufEnter" },
-- Any function that returns a string value.
update = function()
return "Hello!"
end
},
...
},
...
})