-
Notifications
You must be signed in to change notification settings - Fork 22.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow zt
and zb
to temporarily surpress scrolloff
option
#1165
Comments
dang. realizing this also only works momentarily. any new motions will add the scrolloff back. interested in other possible solutions. |
Try just this. vim.keymap.set('n', 'zt', ':let save_scrolloff = &scrolloff<CR>:set scrolloff=0<CR>zt:let &scrolloff = save_scrolloff<CR>')
vim.keymap.set('n', 'zb', ':let save_scrolloff = &scrolloff<CR>:set scrolloff=0<CR>zb:let &scrolloff = save_scrolloff<CR>') |
this is the same thing without a shared function, right? |
It works for me, at least. Can reach true top and bottom. Of course, any subsequent motions will factor in the scrolloff value once the keymap is finished. I'd suggest just removing the scrolloff value entirely if it impedes with your desired workflow, or have a separate keymap that toggles it on/off. |
Describe the bug
scrolloff
is set to10
lines.This disallows
zt
andzb
from hitting true top and bottom.To Reproduce
In
Normal
, type the commandzt
orzb
.Note that top and bottom are impacted by the default
scrolloff
value.Desktop
Neovim Version
Suggestion
Temporarily set
scrolloff
to zero, only for mapped commands (zt
,zb
).The text was updated successfully, but these errors were encountered: