Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Cursorline colors #7164

Closed
Ha5hBr0wn opened this issue May 29, 2023 · 7 comments
Closed

Cursorline colors #7164

Ha5hBr0wn opened this issue May 29, 2023 · 7 comments
Labels
C-enhancement Category: Improvements

Comments

@Ha5hBr0wn
Copy link

Hi,

I am new to using helix and so far I have really liked it, but something that I am missing from Vim is the ability to have a different color cursor line for when i am in Insert mod vs Normal mode.

For example I want my cursor line to have a blue background when I am in Normal mode, and a red background when I am in insert mode.

I find it a lot easier than looking to the bottom to see what mode I am in.

Adding such a feature would be really nice.

Thanks

@Ha5hBr0wn Ha5hBr0wn added the C-enhancement Category: Improvements label May 29, 2023
@gabydd
Copy link
Member

gabydd commented May 29, 2023

I think originally this wasn't done as to not overcomplicate the theme scopes #2170 (comment), to implement this though you would probably want to do something similar to the matching here https://github.com/helix-editor/helix/pull/5130/files though with just the ui.cursorline.secondary and ui.cursorline.primary prefix

@danillos
Copy link
Contributor

Currently, we can do it on the cursor only:

"ui.cursor"                   = { fg = "dark-choco-60", bg = "white-choco-10" }

"ui.cursor.insert"            = { fg = "dark-choco-60", bg = "red10" }
"ui.cursor.primary.insert"    = { fg = "dark-choco-60", bg = "red10" }

"ui.cursor.select"            = { fg = "dark-choco-60", bg = "blue10" }
"ui.cursor.primary.select"    = { fg = "dark-choco-60", bg = "blue10" }

@Ha5hBr0wn
Copy link
Author

Do I just add this to the .toml file of the theme I am using?

@gabydd
Copy link
Member

gabydd commented May 30, 2023

to add that to the theme you are using, you can make a new theme file in ~/.config/helix/themes and then use inheritance like so:

inherits = "<name of theme you are using>"
# theme scopes you want to override

then use the name of that new file as your theme name

this is separate to this issue though and still doesn't solve having a different cursorline color depending on the mode

@Ha5hBr0wn
Copy link
Author

inherits = "solarized_light"

"ui.cursor"                   = { fg = "dark-choco-60", bg = "white-choco-10" }

"ui.cursor.insert"            = { fg = "dark-choco-60", bg = "red10" }
"ui.cursor.primary.insert"    = { fg = "dark-choco-60", bg = "red10" }

"ui.cursor.select"            = { fg = "dark-choco-60", bg = "blue10" }
"ui.cursor.primary.select"    = { fg = "dark-choco-60", bg = "blue10" }

I put this in a file and set my theme to it. But all that happens is when I enter insert, or select mode my cursor disappears. Also I don't want to affect select mode. I want blue on normal mode if that is possible. I understand that it won't give me a full cursor line but even just changing the cursor color would still be pretty good. Thanks

@gabydd
Copy link
Member

gabydd commented May 30, 2023

something like this will make the primary cursor blue in normal mode and keep it the same as the theme in normal and select (the above is the palette from a different theme which is probably why your cursor is disappearing)

inherits = "solarized_light"

"ui.cursor.primary.normal" = { fg = "base03", bg = "blue" }

@Ha5hBr0wn
Copy link
Author

Ok that fg setting works for everything. Thanks. I will leave the issue open because I still think it would be a nice feature to implement

@helix-editor helix-editor locked and limited conversation to collaborators Apr 14, 2024
@pascalkuthe pascalkuthe converted this issue into discussion #10427 Apr 14, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

3 participants