如何在插入模式下键入时停止vim自动滚动

时间:2015-05-22 03:29:13

标签: vim windows-7

我对vim有一个恼人的问题,我已经谷歌搜索死亡无济于事。当我在插入模式下输入时,我希望vim停止向右滚动。当我放大vim窗口时我没有这个问题,但我想保持窗口小而紧凑以达到我自己的目的。

提前致谢!

编辑: 根据merlin2011的要求,这里是我的.vimrc文件的内容。

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      let cmd = '""' . $VIMRUNTIME . '\diff"'
      let eq = '"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction

1 个答案:

答案 0 :(得分:0)

我也遇到了这个问题,我想我已经解决了,但这不是 vim 的问题。您可以尝试右键单击 cmd prmpt 窗口,进入属性并确保已选中此项吗?当我选中那个框时,vim 停止锁定我的光标并在我键入时向侧面滚动。让我知道这是否有效。

enter image description here