dokwork / lualine-ex

Plugin for lualine.nvim with additional components and tools
MIT License
21 stars 1 forks source link

feat(ex.progress): the new component to show the progress in different modes #28

Closed vladimir-popov closed 8 months ago

vladimir-popov commented 8 months ago

This component shows the progress in the file. It has two pre-build modes: 'percent' and 'bar'. The first one is similar to the default progress component, but in the second 'bar' mode the progress is shown as a progress bar.

mode example
'percent' ex progress-percent
'bar' ex progress-bar
sections = {
  lualine_a = {
    {
      'ex.progress',

      -- How to show the progress. It may be the one of two string constants:
      -- 'percent' or 'bar'. In the 'percent' mode the progress is shown as percent of the file.
      -- In the 'bar' mode it's shown as the vertical bar. Also, it can be a table with symbols
      -- which will be taken to show according to the progress, or a function, which receive three
      -- arguments: the component itself, the cursor line and total lines count in the file.
      mode = 'percent',

      -- This string will be shown when the cursor is on the first line of the file. Set `false`
      -- to turn this logic off.
      top = 'Top',

      -- This string will be shown when the cursor is on the last line of the file. Set `false`
      -- to turn this logic off.
      bottom = 'Bot'
    }
  }
}