为什么我不能 vim 平滑滚动以在 iTerm2 (Yosemite) 上工作?

Why can't I get vim smooth-scrolling to work on iTerm2 (Yosemite)?

我已经浪费了太多时间来尝试让这些东西正常工作,这是我最后的尝试。

我正在使用这个插件: https://github.com/terryma/vim-smooth-scroll

我将 .vim 文件放在 ~/.vim/plugin 并将自述文件中的代码添加到我的 .vimrc

当我在 iTerm2 中打开 vim 并滚动一个大文件时,Ctrl+U/D 的工作方式与默认情况下相同。但是当我使用 OS X 自带的默认终端时,我可以看到文件平滑滚动。

我该如何解决这个问题?

PS:我也试过将 .vim 文件放在 ~/.vimrc/bundle 中(我有病原体)。还是不行。

您是否已将键绑定添加到 .vimrc

let g:smooth_scroll_duration=50
map <silent> <c-u> :call smooth_scroll#up(&scroll, smooth_scroll_duration, 2)<CR>
map <silent> <c-d> :call smooth_scroll#down(&scroll, smooth_scroll_duration, 2)<CR>
map <silent> <c-b> :call smooth_scroll#up(&scroll*2, smooth_scroll_duration, 4)<CR>
map <silent> <c-f> :call smooth_scroll#down(&scroll*2, smooth_scroll_duration, 4)<CR>

map <silent> <PageUp> :call smooth_scroll#up(&scroll*2, smooth_scroll_duration, 4)<CR>
map <silent> <PageDown> :call smooth_scroll#down(&scroll*2, smooth_scroll_duration, 4)<CR>