Fork me on GitHub
#vim
<
2021-09-22
>
walterl17:09:54

Is there a way to change the bg color for only a specific buffer? Trying to get an autocmd going to make Conjure log windows stand out a bit more.

noisesmith17:09:36

my first hunch would be to define a custom mode for the log window, then apply syntax hightlighting rules for that mode

walterl17:09:16

Didn't know one could do that! 💡

walterl17:09:25

Define custom modes, that is

noisesmith17:09:03

:h winhightlight might help you more directly if you use neovim

neovim 2
walterl18:09:05

🎉 autocmd BufEnter conjure-log-*.cljc setlocal winhighlight=Normal:CocListWhiteBlack Thanks for the pointers, @U051SS2EU

noisesmith18:09:52

there might be a gotcha here if you were to go to that window and :b a different buffer in it - it would still have the old highlighting right?

noisesmith18:09:04

maybe your user flow would never do that

walterl18:09:44

That's for Neovim neovim. Looks like vim will be a bit different.

walterl18:09:12

Yeah, I just picked the first au event that was "good enough", since I don't know them all that well 🙂

walterl18:09:02

> vim will be a bit different ... but definitely still doable.

noisesmith18:09:17

I think that's intrinsically an issue with using an autocmd to set a specific window bg, as opposed to using a custom filetype with custom highlight rules

noisesmith18:09:59

but I think making a new filetype / highlighting ruleset is probably overengineering here

walterl18:09:06

Yeah. I'm quite happy with a quick hack 🙂