Vim Override Specific Highlights in a Color Scheme Without Changing its File

Until recently I've always forked vim color schemes and tweaked a few bits, most often the background color. I use vim-plug and I didn't want to lose my changes so I'd fork, edit, commit and push- tedious and annoying.

Until recently I've always forked vim color schemes and tweaked a few bits, most often the background color. I use vim-plug and I didn't want to lose my changes so I'd fork, edit, commit and push- tedious and annoying.

Using an autocommand will let you override any part of the color scheme and will also carry over if you change color schemes or source your vimrc.

Below is a snippet from my vimrc

function! CustomHighlights() abort
    highlight Normal     cterm=NONE ctermbg=16    gui=NONE guibg=#1a1a1a
    highlight NonText    cterm=NONE ctermbg=16    gui=NONE guibg=#1a1a1a
endfunction

augroup CustomColors
    autocmd!
    autocmd ColorScheme * call CustomHighlights()
augroup END