Closed Macko-pp closed 2 years ago
If I correctly understand what you're asking, the same README example referenced in the issue you linked can be slightly tweaked to override the CursorLine
highlight, which styles what I think you mean by "the line where the cursor is" (this would need to appear before the colorscheme onedark
line in your ~/.vimrc):
" `gui` is the hex color code used in GUI mode/nvim true-color mode
" `cterm` is the color code used in 256-color mode
" `cterm16` is the color code used in 16-color mode
if (has("autocmd"))
augroup colorset
autocmd!
let s:cursor_grey = { "gui": "#2C323C", "cterm": "236", "cterm16": "0" } " Tweak to personal taste
autocmd ColorScheme * call onedark#set_highlight("CursorLine", { "bg": s:cursor_grey })
augroup END
endif
Alternatively, your mention of "brown" makes me think you're running the theme in 256-color mode. If you are able to use true-color mode per the REAMDE, the colors will look better in general / the default CursorLine
color should look grey and not brown.
Hi! Sorry for the late response, I have been trying for a couple of days and have not been able to change the color of the cursor line even with the snippet you gave me. I have grown to like it because it differentiates the bg from the cursor line making it easier to find. I also have another question, how do I actually configure true color? I haven't been able to find something to actually put into my vimrc and the set termguicolors
isn't working. Thanks for the help!
Hi! Sorry for the late response, I have been trying for a couple of days and have not been able to change the color of the cursor line even with the snippet you gave me.
I realized I had one copy-paste mistake in the snippet but just edited it and fixed that, can you try again?
How do I actually configure true color?
Can you confirm that you tried following Step 2 of the installation instructions exactly as written?
Hi! I am sooo sorry for responding this late, but I just haven't had time to respond. Anyways, I tried what you said and also changed to termcolors: 16 because I installed a hyper onedark theme and it worked! The only thing is that the comments are white for some reason :|
Thanks for all the help!
No worries and you're welcome!
16-color mode is specifically designed to work with the terminal themes that ship with onedark.vim itself: https://github.com/joshdick/onedark.vim/tree/main/term Using 16-color mode with any other terminal theme can result in behavior like you're seeing.
Even so, you're better off switching to true-color mode as I previously mentioned, if your terminal supports it. True-color mode will always show proper colors regardless of your terminal's configured colors.
Terminal Emulator Info
Hyper 3.2.0
Output From
vim --version
Issue Description
I took a look at this issue because it covered what I wanted to do, it worked, but the line where the cursor is still maintained the old brown color which I didn't want. I know there is a way to fix this using the same method I used to fix the bg but I don't know how to do it.
Thanks in advance!