Vim has a special filetype
for help docs called help
. So you may use an autocmd
to set it conditionally in your .vimrc
. This requires using BufEnter
conditionally to match the 'help'
filetype.
autocmd BufEnter * if &filetype == 'help'| set scrolloff=0 | else | set scrolloff=99 | endif