Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change color of block caret. #1945

Closed
kkorus opened this issue Apr 15, 2017 · 7 comments · Fixed by #2179
Closed

Change color of block caret. #1945

kkorus opened this issue Apr 15, 2017 · 7 comments · Fixed by #2179
Labels
Milestone

Comments

@kkorus
Copy link

kkorus commented Apr 15, 2017

Hello,
Change color of "block caret" is not the same that I have set to. For example I want my color of block caret to be 255 ; 204 ; 0 but in editor ends up being 179 ; 146 ; 13.

The color I have setup:
image

The color in editor (little bit darker):
image

Does anyone have the same issue? Does anyone know how to fix it?
edit: I think it's because caret is somehow transparent ¯_(ツ)_/¯
Can this transparency be disabled?

@kkorus kkorus changed the title Change of color bracket Change color of caret. Apr 19, 2017
@kkorus kkorus changed the title Change color of caret. Change color of block caret. Apr 19, 2017
@michaelHL
Copy link

+1. 😞
It seems like green when I set the color to be yellow(255,255,0)

@jaredpar jaredpar added the bug label Jan 13, 2018
@jaredpar jaredpar added this to the 2.6.0 milestone Jan 13, 2018
@ricksladkey
Copy link
Collaborator

The default caret opacity is 65% and so the color you see is roughly two thirds that color and one third whatever the background color of the character under the cursor is. To get exactly your specified caret color, you can set the opacity to 100% in .vsvimrc with :set vsvimcaret=100.

The benefit to having the opacity lower than 100% is that the caret color is different from but related to whatever the background color is, which is presumably less jarring. For example, you can try setting a breakpoint (which on my system makes the text background a sort of brick red) and then positioning the caret on that line.

Unfortunately, it is currently impossible to change the color of the text under the cursor, so it quite difficult to get good contrast both within the caret and between the caret and the document. The traditional solution to this problem is the so-called "reverse video" where the foreground and background are swapped. The solution in gvim is that it allows you to set both the foreground and background of the block cursor as can be seen here (with :colorscheme desert):

image

If the cursor foreground color were white in this image, the caret would be extremely hard to read, which is the current situation with VsVim:

image

@kkorus
Copy link
Author

kkorus commented Jun 2, 2018

@ricksladkey Nice, thanks for explanation.

You said that currently impossible to change the color of the text under the cursor. Is it because of Visual Studio or do you think it can be done in plugin itself? Cheers.

@ricksladkey
Copy link
Collaborator

@kkorus I believe it is a limitation in VsVim. Yet, it is an area I've wanted to look into, so I'll take a look at how hard it would be.

@ricksladkey
Copy link
Collaborator

This issue would be resolved if issue #749 were implemented and the then default opacity was set to 100%.

@ricksladkey
Copy link
Collaborator

I have a working prototype that allows user-configurable block caret text foreground and background color. Here it is in action editing VsVim itself. The options:

image

The results:

image

I'll test it out locally for a few days and if I don't see any problems, I'll submit a PR.

@kkorus
Copy link
Author

kkorus commented Jun 5, 2018

@ricksladkey Awesome news! Waiting for release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants