https://github.com/gw31415/scrolluptolastline.vim
scrollBeyondLastLine=false in Vim
https://github.com/gw31415/scrolluptolastline.vim
vim vscode
Last synced: about 1 year ago
JSON representation
scrollBeyondLastLine=false in Vim
- Host: GitHub
- URL: https://github.com/gw31415/scrolluptolastline.vim
- Owner: gw31415
- License: apache-2.0
- Created: 2023-11-26T13:58:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-27T11:25:35.000Z (over 2 years ago)
- Last Synced: 2025-03-25T06:02:17.435Z (about 1 year ago)
- Topics: vim, vscode
- Language: Vim Script
- Homepage:
- Size: 13.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scrollUptoLastLine.vim
A Vim plugin to stop mouse scrolling at the last line, similar to setting `scrollBeyondLastLine` to `false` in VSCode.

## DESCRIPTION
This plugin modifies the behavior of mouse scrolling in Vim. When installed and enabled, it prevents the mouse from scrolling beyond the last line of the document.
`scrollUptoLastLine.vim` is designed for users who prefer the editor's viewport to stop at the last line of the file, avoiding extra empty space below the last line during scrolling. This feature is akin to the `scrollBeyondLastLine` setting in VSCode when set to `false`.
## OPTIONS
`g:scroll_upto_lastline_padding` - This global variable sets the number of lines to show after the last line of the file when scrolling reaches the end. For instance, setting this variable to 5 will allow the user to see five lines past the last line of the file while scrolling. The default value is `&scrolloff`.
## INSTALLATION
To install `scrollUptoLastLine.vim`, use your preferred Vim plugin manager.
- plug.vim
```vim
Plug 'gw31415/scrollUptoLastLine.vim'
```
- dein.vim
```vim
call dein#add('gw31415/scrollUptoLastLine.vim')
```
## USAGE
After installing, the plugin works automatically. You can adjust the padding by setting `g:scroll_upto_lastline_padding` in your `.vimrc` file, like so:
```vim
let g:scroll_upto_lastline_padding = 3
```
## Q/A
### Issue: Strange Behavior When Push After Scrolling
**Q**: When I hold Shift after scroll, the behavior seems erratic. What's happening?
**A**: This issue is likely due to `` being unintentionally active. To resolve this, remap `` to `` (No operation). You can do this by adding the following line to your `.vimrc`:
```vim
noremap
inoremap
```
This remapping prevents any unintended actions when shift-scrolling.