A simple and lightweight plugin to make scrolloff go past the end of the file. It uses the value of scrolloff
to determine the amount of blank space to mimic the behaviour of scrolloff.
scrollEOF-demo.mp4
Using lazy
{
'Aasim-A/scrollEOF.nvim',
event = { 'CursorMoved', 'WinScrolled' },
opts = {},
}
Using packer:
use('Aasim-A/scrollEOF.nvim')
Using vim-plug:
Plug 'Aasim-A/scrollEOF.nvim'
Make sure that you set the scrolloff
setting then add the following line to your Neovim config:
Lua:
require('scrollEOF').setup()
Vimscript:
lua require('scrollEOF').setup()
These are the default settings. Any changes can be made in the call to setup
.
-- Default settings
require('scrollEOF').setup({
-- The pattern used for the internal autocmd to determine
-- where to run scrollEOF. See https://neovim.io/doc/user/autocmd.html#autocmd-pattern
pattern = '*'
-- Whether or not scrollEOF should be enabled in insert mode
insert_mode = false,
-- Whether or not scrollEOF should be enabled in floating windows
floating = true,
-- List of filetypes to disable scrollEOF for.
disabled_filetypes = {},
-- List of modes to disable scrollEOF for. see https://neovim.io/doc/user/builtin.html#mode()
disabled_modes = {},
})