Skip to content

Aasim-A/scrollEOF.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

scrollEOF.nvim

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

Getting started

Install

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'

Setup

Quick start

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()

Settings

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 = { 'terminal' },
  -- List of modes to disable scrollEOF for. see https://neovim.io/doc/user/builtin.html#mode()
  disabled_modes = { 't', 'nt' },
})

Note

When using large scrolloff values i.e. larger than half of the number of lines on the screen, this plugin will override the scrolloff value to be half of the screen lines to avoid conflict from vim trying to prevent scrolloff when reaching end of file.

About

Scroll past the end of file just like scrolloff option

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 7

Languages