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