Cursor color in vim terminal OS X Mountain Lion

不打扰是莪最后的温柔 提交于 2019-12-01 15:31:10

问题


I want to make the cursor and selected text easier to read in vim (white background, black foreground), so i've done

hi Visual guibg=white guifg=black gui=NONE ctermfg=black ctermbg=white cterm=reverse
hi Cursor guibg=white guifg=black gui=NONE ctermfg=black ctermbg=white cterm=reverse

which gives me exactly what i want on MacVim. On the vim terminal, however, it defaults to the terminal preferences, which is very difficult to read and find...how can i override the terminal defaults?

Edit: to say that the hi Visual like works perfectly. It's the hi Cursor that doesn't.


回答1:


I am not a Mac user, but I don't believe this is possible. The cursor colour in console Vim is inherited from the terminal application, and can't be modified.* You could try changing the cursor colour in the terminal preferences.

*Disclaimer: this is certainly true of the Windows command prompt, which I am forced to use at work. It wouldn't surprise me if other Unix-like shells were more flexible.




回答2:


You can't change the cursor colour programatically (i.e. just do it for vim), but you can change it in Terminal>Preferences>Profiles>Text>Cursor (see image), which may solve your issue.

I find a bright green cursor makes a big difference for visibility!

EDIT: This is mentioned in the comments, but I missed that the first time so I think it deserves its own answer.



来源:https://stackoverflow.com/questions/11878484/cursor-color-in-vim-terminal-os-x-mountain-lion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!