dokwork / lualine-ex

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

feat(ex.location): the new component to show cursor location #27

Closed vladimir-popov closed 8 months ago

vladimir-popov commented 8 months ago

This component shows the current cursor position in configurable format. Comparing to the default location component, this component can show total number of lines, and may be flexibly configured.

pattern example
'%2C:%-3L/%T' ex location
'%3L:%-2C' ex location-2
sections = {
  lualine_a = {
    {
      'ex.location',

      -- The pattern to show the cursor position. Here three possible specifiers:
      --  'L' means 'line' - the number of the line where is the cursor now;
      --  'C' means 'column' - the number of the virtual column where is the cursor now;
      --  'T' means 'total' - the total count of lines in the current buffer;
      -- Every specifier can be used in similar maner to %d in the {string.format} function.
      -- The pattern similar to the default 'location' component is '%3L:%-2C'
      pattern = '%2C:%-3L/%T'
    }
  }
}