https://github.com/abhilash26/zenline.nvim
A lua based status line for neovim
https://github.com/abhilash26/zenline.nvim
lua neovim-plugin neovim-plugin-lua nvim-plugin statusline
Last synced: 6 months ago
JSON representation
A lua based status line for neovim
- Host: GitHub
- URL: https://github.com/abhilash26/zenline.nvim
- Owner: abhilash26
- License: mit
- Created: 2024-07-06T05:15:51.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-16T05:22:49.000Z (9 months ago)
- Last Synced: 2025-03-29T18:41:26.680Z (6 months ago)
- Topics: lua, neovim-plugin, neovim-plugin-lua, nvim-plugin, statusline
- Language: Lua
- Homepage:
- Size: 50.8 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zenline.nvim
A simple statusline for neovim written in lua.
### 🚧 WIP 🚧
## Requirements
* Requires neovim version >= 0.10
* `vim.opt.laststatus=2` in your init.lua for statusline. (or `3` for global line)
* Have a [nerd font installed](https://www.nerdfonts.com/font-downloads)
* Have [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) installed (requirement for git branch and git_diff components)## Installation
### Lazy
```lua
{
"abhilash26/zenline.nvim",
event = { "WinEnter", "BufEnter", "ColorScheme" },
opts = {},
},
```
## Minimum Configuration
```lua
require("zenline").setup()
```
### Click to see default configuration
Default configuration is here [options](https://github.com/abhilash26/zenline.nvim/blob/main/lua/zenline/config.lua)```lua
-- default options
{
sections = {
active = {
left = { "mode", "git_branch", "git_diff" },
center = { "file_name" },
right = { "diagnostics", "file_type", "line_column" },
},
inactive = { hl = "Normal", text = "%F%=" },
},
components = {
mode = {
["n"] = { "ZenlineNormal", "NORMAL" },
["i"] = { "ZenlineInsert", "INSERT" },
["ic"] = { "ZenlineInsert", "INSERT" },
["v"] = { "ZenlineVisual", "VISUAL" },
["V"] = { "ZenlineVisual", "VISUAL LINE" },
["^V"] = { "ZenlineVisual", "VISUAL BLOCK" },
["c"] = { "ZenlineCmdLine", "COMMAND" },
["R"] = { "ZenlineReplace", "REPLACE" },
["t"] = { "ZenlineTerminal", "TERMINAL" },
default = { "Normal", "UNKNOWN" },
},
file_type = { hl = "ZenlineAccent" },
file_name = {
hl = "ZenlineAccent",
mod = ":~:.",
modified = " [+] ",
readonly = " ",
},
diagnostics = {
["ERROR"] = { "ZenlineError", " " },
["WARN"] = { "ZenlineWarn", " " },
["INFO"] = { "ZenlineInfo", " " },
["HINT"] = { "ZenlineHint", " " },
},
line_column = { hl = "ZenlineNormal", text = "%P %l:%c " },
git_branch = { hl = "ZenlineAccent", icon = " " },
git_diff = {
["added"] = { "ZenlineAdd", " " },
["changed"] = { "ZenlineChange", " " },
["removed"] = { "ZenlineDelete", " " },
},
},
special_fts = {
["alpha"] = { "Alpha", " " },
["lazy"] = { "Lazy", " " },
["mason"] = { "Mason", "" },
["NvimTree"] = { "NvimTree", " " },
["neo-tree"] = { "Neotree", " " },
["oil"] = { "Oil", " " },
["help"] = { "Help", " " },
["lspinfo"] = { "LspInfo", " " },
["checkhealth"] = { "Checkhealth", " " },
["spectre_panel"] = { "Spectre", "" },
["man"] = { "Man", " " },
["qt"] = { "Quickfix", " " },
["toggleterm"] = { "ToggleTerm", " " },
},
}
```## Sections
| section | use |
|---------|-----|
| mode | shows the mode |
| file_name | shows filename with path to cwd |
| file_type | shows filetype |
| diagnostics | shows lsp diagnostics (number of errors, warnings, etc) |
| line_column | shows line, column, percentage, etc |
| git_branch | shows current branch name (uses [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) ) |
| git_diff | shows diff (added, changed and deleted) icons with count (uses [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) ) |