vim: Fix scroll mappings

The included `vimrc` file sets mappings for <ScrollWheelUp> and
<ScrollWheelDown>, so that scrolling is smooth. Unfortunately,
'compatible' is set by default [0], so the `<>` notation used for those
mappings isn't enabled. Instead of the key `<ScrollWheelUp>` being
mapped, the mapping is actually from the typed string "<ScrollWheelUp>".

[0]: `:help compatible-default` explains that vim will turn the
'compatible' option off when "a user vimrc is found", or under various
other conditions (note that the system-wide vimrc doesn't count [1]),
but even in the case where a user vimrc exists, this system-wide vimrc
is executed before that happens.

[1]: From `:help compatible-default`:

    Note that this does NOT happen when a system-wide vimrc file was
    found.
This commit is contained in:
Shayne Holmes 2019-03-22 08:13:18 -07:00
parent aa0c59c6cf
commit 5f630bd495

View File

@ -1,3 +1,6 @@
" Ensure that <> notation works for the mappings that follow
set nocompatible
" Scroll only one line for mouse wheel events to get smooth scrolling on touch screens
map <ScrollWheelUp> <C-Y>
imap <ScrollWheelUp> <C-X><C-Y>