For themes like One or PaperColor, there are dark and light versions. For dark or light theme, I usually add my own customizations like bracket color, comment color... etc.

I tried to combine them so that everytime I set background=dark or light, with an if else statement. I tried the following but it doesn't work.

if (set background=dark)
    """ my own code here

Please let me know how to go about this and thank you.

1 Answer 1

if &background ==# 'dark'
    " balabala

&background get value of 'background' option, check :help let-&
==# compare strings case sensitively, check :help ==#


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.