문제

I normally like setting scrolloff=99, but it's not ideal when I'm reading the help files. How can I detect when I'm in there so I can turn scrolloff off?

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top