Skip to content

brianaung/yasl.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yasl.nvim

Yet another minimal and lightweight statusline plugin designed for neovim. It prioritizes simplicity and performance without sacrificing functionality.

Features

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.

Examples

screenshot of statusline in normal mode screenshot of statusline in insert mode screenshot of statusline in visual mode screenshot of statusline in command mode screenshot of statusline in replace mode

Installation

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)

Configurations

Available components

gitdiff component has some issues on versions less than v0.10.0 so it's currently disabled by default. See: neovim/neovim#21856

Default options

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
        " ",
    }
})

Recipe for creating your own component

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
        },
        ...
    },
    ...
})

Releases

No releases published

Packages

No packages published

Languages