From 0a20d1d3e24a879b7716d40eda4525822dde19ea Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Sat, 19 Sep 2020 18:42:23 +0530 Subject: [PATCH] nvim: Add scrollbar --- nvim/.config/nvim/autocmd.vim | 12 ++++++++++++ nvim/.config/nvim/init.vim | 2 ++ 2 files changed, 14 insertions(+) diff --git a/nvim/.config/nvim/autocmd.vim b/nvim/.config/nvim/autocmd.vim index f687ddf..e10eacf 100644 --- a/nvim/.config/nvim/autocmd.vim +++ b/nvim/.config/nvim/autocmd.vim @@ -35,3 +35,15 @@ augroup LuaHighlight autocmd! autocmd TextYankPost * silent! lua require'vim.highlight'.on_yank("IncSearch", 2000) augroup END + +augroup Scrollbar + autocmd! + autocmd BufEnter * silent! lua require('scrollbar').show() + autocmd BufLeave * silent! lua require('scrollbar').clear() + + autocmd CursorMoved * silent! lua require('scrollbar').show() + autocmd VimResized * silent! lua require('scrollbar').show() + + autocmd FocusGained * silent! lua require('scrollbar').show() + autocmd FocusLost * silent! lua require('scrollbar').clear() +augroup END diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 7b8994c..c5824a5 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -50,6 +50,8 @@ Plug 'tpope/vim-sleuth' Plug 'Yggdroot/indentLine' " Smooth scrolling Plug 'psliwka/vim-smoothie' +" Scrollbar +Plug 'Xuyuanp/scrollbar.nvim' " Directory viewer Plug 'justinmk/vim-dirvish' " Handle line & column jump specifications as found in stack traces