Ramilito / winbar.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

winbar.nvim

Sets a winbar at the top for each file

image

✨ Features

  • Shows if a file is modified and not saved
  • Colored icons
  • Integrates with diagnostics to highlight errors, warn, info, hints
  • Can opt-out of icons and/or diagnostics
  • Very fast!

⚡️ Dependencies

  • devicons (icons) -- If config.icons = true

📦 Installation

Install the plugin with your preferred package manager:

return {
  {
    "ramilito/winbar.nvim",
    event = "VimEnter", -- Alternatively, BufReadPre if we don't care about the empty file when starting with 'nvim'
    dependencies = { "nvim-tree/nvim-web-devicons" },
    config = function()
      require("winbar").setup({
        -- your configuration comes here, for example:
        icons = true,
        diagnostics = true,
        buf_modified = true,
        buf_modified_symbol = "M",
        -- or use an icon
        -- buf_modified_symbol = "●"
        dim_inactive = {
            enabled = false,
            highlight = "WinbarNC",
            icons = true, -- whether to dim the icons
            name = true, -- whether to dim the name
        }
      })
    end
  },
}

⚙️ Configuration

Setup

{
  icons = true,
  diagnostics = true,
  buf_modified = true,
  dir_levels = 0,
  filetype_exclude = {
    "help",
    "startify",
    "dashboard",
    "packer",
    "neo-tree",
    "neogitstatus",
    "NvimTree",
    "Trouble",
    "alpha",
    "lir",
    "Outline",
    "spectre_panel",
    "toggleterm",
    "TelescopePrompt",
    "prompt"
  },
}

Performance

Startup

No startup impact since we use VimEnter to register the plugin.

UI

On an M2 Mac running nvim ./file

image

On an M2 Mac running nvim

image

Motivation

This plugin aims to help people move away from the tabline way of working but still need to orient them selves when working with multiple files by giving context. The features are inspired by VSCode behaviour, some code is borrowed from bufferline, thanks for that 🙏.

About

License:Apache License 2.0


Languages

Language:Lua 100.0%