1

As title. Say I have 2 (vertical) window splits, I just want to change the background color of the right one. Is this even possible? If so, How?

1 Answer 1

1

This is :h 'wincolor' in Vim. And :h 'winhighlight' in Neovim.

:execute printf("hi RandomBg guibg=#%x", rand() % 0xFFFFFF)
:let w = winnr("l")
:if has("nvim")
:  call setwinvar(w, "&winhighlight", "Normal:RandomBg")
:else
:  call setwinvar(w, "&wincolor", "RandomBg")
:endif
1
  • Sorry for my late upvote! Great, a very happy news after work :) Feb 11, 2022 at 16:08

Your Answer

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

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