在Vim中使用鼠标滚轮

在Vim中使用鼠标滚轮

本文介绍了在Vim中使用鼠标滚轮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的.vimrc有以下几行

set mouse=a
map <ScrollWheelUp> <C-Y>
map <ScrollWheelDown> <C-E>

但是当我使用鼠标滚轮向上滚动时,我会得到文本上方 Vim.例如,如果刚启动Vim,我将获得终端会话文本.我最初是在帮助文件上使用鼠标滚轮进行实验,然后再移至其他文件,因此使用a选项.

But when I scroll up using the mouse wheel, I'd get the text above Vim. For example, I'd get my terminal session text if I'd just started Vim. I'm initially experimenting with the mouse scroll wheel on help files, then move on to other files, hence the a option.

我还需要设置什么?我在终端机中使用Snow Leopard和Vim 7.3.

What else do I need to set? I'm using Snow Leopard and Vim 7.3 inside a Terminal.

在这里,我只是转了个圈.请参阅顶部的终端会话.

Here, I just did a wheel up. See the Terminal session at the top.

推荐答案

在OS X的iTerm 2中使用vim,您可以:set mouse=a启用滚轮滚动以及选择进入可视模式等.

Using vim in iTerm 2 in OS X, you can:set mouse=ato enable scrolling with the scroll wheel, as well as selecting to enter Visual mode, etc.

这篇关于在Vim中使用鼠标滚轮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 06:32