jinh0 / eyeliner.nvim

👀 Move faster with unique f/F indicators.
461 stars 15 forks source link

feature: `max_line_length` option #41

Closed llllvvuu closed 3 months ago

llllvvuu commented 1 year ago

Certain compiled JavaScript files can be a single line with hundreds of KB of text. In this case it would be nice to have eyeliner not trigger for that line (or only search up to the max_line_length-th character).

Here's my workaround currently, but it's not quite the same condition:

return {
  {
    'jinh0/eyeliner.nvim',
    config = function()
      require'eyeliner'.setup({})
      vim.api.nvim_create_autocmd(
        "BufReadPre", {
          pattern = "*",
          command = 'if getfsize(expand("%")) > 100000 | execute "EyelinerDisable" | endif'
        }
      )
    end
  }
}
jinh0 commented 3 months ago

Sorry for the year-long inactivity on this repository, but if you're still interested, I have added this feature in the latest commit https://github.com/jinh0/eyeliner.nvim/commit/22a5c94f14eb286b25aed56e9c1ae90e53d2d520 of eyeliner!

You can enable this feature with:

  require'eyeliner'.setup({
    max_length = 80
  })

eyeliner will only look and highlight at most 80 characters from your current cursor.

Thanks for the suggestion!