Browse Source

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.
emacs-27
Shayne Holmes 6 years ago
parent
commit
55a96a1b4c
  1. 3
      packages/vim/vimrc

3
packages/vim/vimrc

@ -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 " Scroll only one line for mouse wheel events to get smooth scrolling on touch screens
map <ScrollWheelUp> <C-Y> map <ScrollWheelUp> <C-Y>
imap <ScrollWheelUp> <C-X><C-Y> imap <ScrollWheelUp> <C-X><C-Y>

Loading…
Cancel
Save