From 5667f59c6fa40f9804fac7c287dbac689c10c076 Mon Sep 17 00:00:00 2001 From: Daniel Lynn Date: Fri, 7 Jan 2022 12:37:58 -0600 Subject: [PATCH] Scrollbar setup --- nvim/scrollbar.vimrc | 49 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/nvim/scrollbar.vimrc b/nvim/scrollbar.vimrc index 1a8f41c..fe1e230 100644 --- a/nvim/scrollbar.vimrc +++ b/nvim/scrollbar.vimrc @@ -1,3 +1,50 @@ lua << EOF -require('scrollbar').setup() +require("scrollbar").setup({ + handle = { + text = " ", + color = "white", + }, + marks = { + Search = { text = { "-", "=" }, priority = 0, color = "orange" }, + Error = { text = { "-", "=" }, priority = 1, color = "red" }, + Warn = { text = { "-", "=" }, priority = 2, color = "yellow" }, + Info = { text = { "-", "=" }, priority = 3, color = "blue" }, + Hint = { text = { "-", "=" }, priority = 4, color = "green" }, + Misc = { text = { "-", "=" }, priority = 5, color = "purple" }, + }, + excluded_filetypes = { + "", + "prompt", + "TelescopePrompt", + }, + autocmd = { + render = { + "BufWinEnter", + "TabEnter", + "TermEnter", + "WinEnter", + "CmdwinLeave", + "TextChanged", + "VimResized", + "WinScrolled", + }, + }, + handlers = { + diagnostic = true, + search = true, + }, +}) + +require("hlslens").setup({ + build_position_cb = function(plist, bufnr, changedtick, pattern) + require('scrollbar').search_handler.show(plist.start_pos) + end +}) + +vim.cmd([[ + augroup scrollbar_search_hide + autocmd! + autocmd CmdlineLeave : lua require('scrollbar').search_handler.hide() + augroup END +]]) EOF