Why is scrolloff suddenly set to 5 in view but not vim?

0

I use vim's view command frequently to view files readonly. This morning I observed very unusual scrolling behavior: my cursor would never reach the bottom of the screen. It would stop about 5 lines away whenever I scrolled down. Switching to another file and restarting view didn't help. Restarting my terminal didn't help (this is Cygwin mintty).

The only thing that seemed to help was starting with vim -R on the commandline instead of view.

Googling I found that this option is the scrolloff setting and that it changed somewhat recently in vim 7 for reasons that don't sound so good to me:

Patch 7.4.2278
Problem:    New users have no idea of the 'scrolloff' option.
Solution:   Set 'scrolloff' in defaults.vim.
Files: runtime/defaults.vim

I wonder why this setting seems to only affect view and not vim, if it's been changed?

I'm also finding that if I add set scrolloff=0 to my .vimrc it is not respected for the view command.

Why does view get this setting changed but vim does not, and how do I change it for view so that it always starts up with a value of 0?

skiphoppy

Posted 2017-02-07T16:15:49.213

Reputation: 2 193

What's the output of type -a view and type -a vim? – Heptite – 2017-02-08T03:20:52.523

view is /usr/bin/view vim is /usr/bin/vim – skiphoppy – 2017-02-10T17:09:29.377

No answers