nvim-scrollbar icon indicating copy to clipboard operation
nvim-scrollbar copied to clipboard

How to configure it with lazy vim?

Open adilJamshad opened this issue 11 months ago • 4 comments

Hi,

I have the following snippet in my init.lua file, the plugin is loaded but the scrollbar isn't visible at all.

{
    "petertriho/nvim-scrollbar",
    config = function ()
      require("scrollbar").setup()
    end,
    dependencies = {
      "lewis6991/gitsigns.nvim",
      "kevinhwang91/nvim-hlslens"
    }
  }

Need your help for the review or suggestions. New to this configuration.

adilJamshad avatar Feb 02 '25 06:02 adilJamshad

I use this config

return {
  'petertriho/nvim-scrollbar',
  dependencies = {
    'lewis6991/gitsigns.nvim',
    'kevinhwang91/nvim-hlslens',
  },
  opts = {},
}

and the scrollbar shows and I even get the marks warnings and errors. I can't see git changes or search results though.

tjcocucci avatar Apr 16 '25 15:04 tjcocucci

I just enabled search an git with this config, hope it helps (not a vim wiz or anything, just trying to get a decent nvim config, so there's probably better ways to do this)

return {
  'petertriho/nvim-scrollbar',
  dependencies = {
    'lewis6991/gitsigns.nvim',
    'kevinhwang91/nvim-hlslens',
  },
  opts = {},
  config = function()
    require('scrollbar').setup()
    require('gitsigns').setup()
    require('hlslens').setup {
      build_position_cb = function(plist, _, _, _)
        require('scrollbar.handlers.search').handler.show(plist.start_pos)
      end,
    }
    require('scrollbar.handlers.gitsigns').setup()
    require('scrollbar.handlers.search').setup()
  end,
}

tjcocucci avatar Apr 16 '25 15:04 tjcocucci

@adilJamshad Can you try explicitly setting the scrollbar handle color to something? Your theme might be causing it to be hidden

require("scrollbar").setup({
    handle = {
        text = " ",
        color = "#ffffff",
    },
}

petertriho avatar Apr 17 '25 01:04 petertriho

@tjcocucci

return {
  'petertriho/nvim-scrollbar',
  dependencies = {
    'lewis6991/gitsigns.nvim',
    'kevinhwang91/nvim-hlslens',
  },
  opts = {
handlers = {
        gitsigns = true,
        search = true,
    },
},
}

This should be all that's required. The handler setup functions works as well, they are there for lazy loading purposes

petertriho avatar Apr 17 '25 02:04 petertriho