I often find myself wanting to change just something little in a colorscheme, but i don't want to edit the original file. I tried putting my change in '~/.vim/after/colors/blah.vim', but that doesn't work for me.
Example, I want to change the CursorLine highlight in BusyBee.vim..
~/.vim/colors/BusyBee.vim
I create the file '~/.vim/after/colors/BusyBee.vim' and add this:
hi CursorLine guibg=#000000 ctermbg=Black cterm=none
However, i don't see the change. Of course it works if i change the line in the originial BusyBee.vim, but like i said i'd prefer not to do that.
Doing...
:colo Busy<TAB>
Shows me...
BusyBee BusyBee
To install a new color scheme for Vim, you will need to download it from the git hub repository. Here I am going to download a vim theme “Monokai” from the Git repository. For Monokai color scheme, open the following link, then right-click and save it as . vim in your Downloads directory.
The ctermfg=white is used to set the foreground color to white in a terminal text editor. Finally, the ctermbg=black is used to set the background color to black in a terminal text editor.
You asked what I'm looking for today. I found a simpler solution than those presented here. I want transparent background instead of the black background from the theme, while simply overriding the color after the colorscheme
statement in .vimrc
doesn't work and installing a plugin just for that is weird. Here is what I did:
autocmd ColorScheme * highlight Normal ctermbg=None autocmd ColorScheme * highlight NonText ctermbg=None
Why does it work? I guess that vim does something besides just read your colorscheme
statement and load the statement and then read your highlight
statement and change the color. Anyway it seems like vim only change the color scheme after reading the config files. So I provide a hook, that will change the colors every time the color scheme is changed. A nice side effect is, this works even if you switch your color scheme (you could do an if
block if you want to).
Have a look at AfterColors.vim, it will enable you to to use the ~/.vim/after/colors/BusyBee.vim
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With