Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cursor color in vim terminal OS X Mountain Lion

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.

like image 254
Jose187 Avatar asked Aug 09 '12 07:08

Jose187


2 Answers

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.

Terminal settings

like image 197
gib Avatar answered Oct 13 '22 00:10

gib


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.

like image 39
Prince Goulash Avatar answered Oct 13 '22 00:10

Prince Goulash