cursor - Vim:在终端中,我怎样才能拥有更好的光标?

标签 cursor vim 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

我注意到它叫做 guicursor设置,但是在终端中,其中一些确实生效,但它们并没有完全生效。

此外,光标似乎没有更新很多。例如,如果我进入插入模式,则会放置正确的光标,但是如果我退出,则会使用相同的光标,直到我移动或执行某些操作,然后它才会更新为正常模式光标。

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

编辑:

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

重新措辞问题:如何使终端中的光标重绘速度更快,以及如何使其采用上面的设置?我已经试过了 ttyfastlazyredraw .

最佳答案

您的设置适用于 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

关于cursor - Vim:在终端中,我怎样才能拥有更好的光标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14030979/

相关文章:

vim - 是否有类似于fuzzyfinder_textmate 和Command-T 的Vim 插件_not_ 需要Ruby 支持?

vim - 在 Vim 中更改 emmet 的领导键

java - 列 '_id' 不存在,嵌套查询的

android - 尝试重新打开一个已经关闭的对象:SQLiteQuery

Python - 使用 Python 参数对查询应用过滤器

python - 随机混合300万行文件的行

c - 通过 vimserver 为 vim 提供稳定的文本馈送

vim - 在独立缓冲区内实时监控 vim 消息

python - 在 Vim 中基于缩进级别标记 block

javascript - 重置 game.input.onDown 时使用哪个指针对象(即光标)