Vim:在终端,我怎样才能拥有更好的游标?

gre*_*uan 5 vim cursor macvim

我注意到当我使用终端时光标不是我配置它.

换句话说,在GUI中它看起来很完美,光标就是,但在终端中需要时间来更新,它看起来不像我配置它等.

以下是我对光标的设置:

set guicursor=n-v-c:block-Cursor-blinkon0
set guicursor+=ve:ver35-Cursor
set guicursor+=o:hor50-Cursor-blinkwait175-blinkoff150-blinkon175
set guicursor+=i-ci:ver20-Cursor
set guicursor+=r-cr:hor20-Cursor
set guicursor+=sm:block-Cursor-blinkwait175-blinkoff150-blinkon175
Run Code Online (Sandbox Code Playgroud)

我注意到它被称为guicursor设置,但是在终端中,其中一些确实生效了,它们只是没有完全发挥作用.

此外,似乎光标不会得到很多更新.例如,如果我进入插入模式,则放置正确的光标,但是如果我离开,则使用相同的光标直到我移动或者其他东西然后更新为正常模式光标.

你对此有什么建议吗?或者我只需忍受它?

编辑:

我的操作系统是安装了Mountain Lion的Mac Mini.我使用iTerm2 xterm-color256作为终端.

重写问题:如何在终端中更快地重绘光标,如何使其采用上面的设置?我已经尝试过ttyfastlazyredraw.

rom*_*inl 6

您的设置适用于GUI Vim.您不能指望它们在CLI Vim中工作.如果您不喜欢CLI Vim的工作方式,请使用MacVim.

我在这个函数中执行的函数略有不同~/.vimrc:

" changes the cursor shape/color
" in the terminal depending on the mode
" see http://code.google.com/p/iterm2/issues/detail?id=710&q=cursor
function! SetCursorStyle()
  if &term =~ "xterm\\|rxvt"
    " use a | cursor in insert mode
    let &t_SI = "\<Esc>]50;CursorShape=1\x7"

    " use a rectangle cursor otherwise
    let &t_EI = "\<Esc>]50;CursorShape=0\x7"

    " reset cursor when vim exits
    autocmd VimLeave * silent !echo -ne "\<Esc>]50;CursorShape=0\x7"

  endif
endfunction
Run Code Online (Sandbox Code Playgroud)