GitXplorerGitXplorer
M

nougat.nvim

public
202 stars
3 forks
3 issues

Commits

List of commits on branch main.
Unverified
1c1cde6e53d7d7c2242d125fe67552b00e235876

test(nut): add tests for tab.winlist

MMunifTanjim committed a year ago
Unverified
29d824d2dbdd71f9f5b984350025c16432771bc2

feat(core): use nougat.store

MMunifTanjim committed a year ago
Unverified
1401b528d92c90ab0d63fd7655d8ab69235cfbf4

feat(nut): add tab.tablist.win_count

MMunifTanjim committed a year ago
Unverified
bf76777d624f46a099a176517a37437e2b8f3f5e

feat(nut): add tab.winlist

MMunifTanjim committed a year ago
Unverified
a7ac83de0089924630a6cf34b2313b884d01d5da

perf(nut): remove unnecessary list and loop

MMunifTanjim committed a year ago
Unverified
abaed7e4934d84d2b81ffefa94ac3f760b5c99a8

feat(nut): add tab.tablist.number

MMunifTanjim committed a year ago

README

The README file for this repository.

GitHub Workflow Status: CI Coverage License

🍫 nougat.nvim

Hyperextensible plugin for Neovim's 'statusline', 'tabline' and 'winbar'.

✨ Features

  • 🛠️ Hyperextensible.
  • 🚀 Fast, Performance focused, Submillisecond evaluation time.
  • 🖥️ Responsive Breakpoints, Smart Truncation.
  • 🎨 Color Palette, Automatic and Adaptive.
  • 📦 Modular Design, only use what you need.
  • 🔮 Dynamic statusline / tabline / winbar.
  • 📃 Filetype Specific statusline / winbar.
  • 💅 Fancy Separator.
  • 🖱️ Mouse-Click.
  • 💼 Caching out-of-the-box.
  • 📊 Built-in Profiler.
  • 🥜 Common Items included.

🕸️ Requirements

  • Neovim >= 0.7.0

📥 Installation

Install with your preferred plugin manager. For example:

With lazy.nvim

{
  "MunifTanjim/nougat.nvim",
},
With packer.nvim
use({
  "MunifTanjim/nougat.nvim",
})
With vim-plug
Plug 'MunifTanjim/nougat.nvim'

Usage

nougat.nvim is at your disposal to build exactly what you want.

local nougat = require("nougat")

set_statusline

Signature: (bar: NougatBar | nougat_bar_selector, opts?: { filetype?: string }) -> nil

bar can be a NougatBar instance:

local stl = Bar("statusline")

nougat.set_statusline(stl)

Or a nougat_bar_selector function (ctx: nougat_core_expression_context) -> NougatBar.

local stl = Bar("statusline")
local stl_inactive = Bar("statusline")

-- use separate statusline focused/unfocused window
nougat.set_statusline(function(ctx)
  return ctx.is_focused and stl or stl_inactive
end)

opts is a table with the shape { filetype?: string }.

If filetype is given, the bar will only be used for that filetype.

local stl_fugitive = Bar("statusline")
local stl_help = Bar("statusline")

-- set filetype specific statusline
for ft, stl_ft in pairs({
  fugitive = stl_fugitive,
  help = stl_help,
}) do
  nougat.set_statusline(stl_ft, { filetype = ft })
end

refresh_statusline

Signature: (force_all? boolean) -> nil

set_tabline

Signature: (bar: NougatBar | nougat_bar_selector) -> nil

bar can be a NougatBar instance or a nougat_bar_selector function.

refresh_tabline

Signature: () -> nil

set_winbar

Signature: (bar: NougatBar | nougat_bar_selector, opts?: { filetype: string }|{ global?: boolean }|{ winid: integer }) -> nil

bar can be a NougatBar instance or a nougat_bar_selector function.

opts is a table with one of the shapes { filetype: string } / { global?: boolean } / { winid: integer }.

If filetype is given, the bar will only be used for that filetype.

If global is true, the bar will be used for global 'winbar', otherwise the local 'winbar' is set whenever a new window is created.

If winid is present, the bar will be used for only that specific window.

refresh_winbar

Signature: (force_all?: boolean) -> nil

Examples

A handful of examples are available to get you started.

Bubbly

Source: bubbly.lua

Bubbly Statusline

Pointy

Source: pointy.lua

Pointy Statusline

Slanty

Source: slanty.lua

Slanty Statusline


🎨 Color Palette

Check Detailed Documentation for nougat.color

⚙️ NougatBar

The sweet NougatBar represents the statusline / tabline / winbar.

Check Detailed Documentation for nougat.bar

⚙️ NougatItem

Each NougatBar is made of a bunch of NougatItem.

Check Detailed Documentation for nougat.item

⚙️ Separator

Separator that goes between two NougatItems.

Check Detailed Documentation for nougat.separator

⚙️ Cache

Check Detailed Documentation for nougat.cache

⚙️ Store

Check Detailed Documentation for nougat.store

🥜 Nuts

Commonly used NougatItems for your NougatBar are available inside nougat.nut.* module.

📊 Profiler

The built-in profiler can be used with the :Nougat profile command.


📓 Links

📜 License

Licensed under the MIT License. Check the LICENSE file for details.