davidosomething / everandever.nvim

Lua utilities for composing an LSP progress indicator.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

everandever.nvim

Lua utilities for composing an LSP progress indicator.
See a demo video

screenshot

Installation

These are strictly lua modules, they do nothing unless specifically required by your own config. Install by adding to your plugin manager, no lazy loading required.

  • lazy.nvim

    { "davidosomething/everandever.nvim" }

Usage

Make sure your statusline (or tabline or winbar) updates on the following autocmd events:

"LspAttach",
"LspDetach",
"User LspProgressUpdate",
"User LspRequest",

Get progress messages for given buffer

local opts = { bufnr = 0 }
vim.pretty_print(
  require('everandever.lsp').get_progress_messages(opts)
)

opts is passed directly to vim.lsp.get_active_clients(opts)

Get messages, lowest % of the messages, and a bar character like

vim.pretty_print(
  require('everandever.progress').status_progress({ bufnr = 0 })
)

Convert a number percentage to a status bar character

local progress = require('everandever.progress')

vim.pretty_print(
  progress.character(progress.VERTICAL, 75)
)

vim.pretty_print(
  progress.character(progress.HORIZONTAL, 75)
)

lualine example

local function lspprogress()
  local data = require('everandever.progress').status_progress({ bufnr = 0 })
  return " " .. data.bar .. " " .. data.lowest.name .. " "
end

...

sections = { lualine_c = { lspprogress } }

heirline.nvim example

Can be found here (very similar to lualine)

License

MIT

About

Lua utilities for composing an LSP progress indicator.

License:MIT License


Languages

Language:Lua 100.0%