Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the documentation for colorscheme customization #85

Open
ZaneBartlett1 opened this issue Oct 11, 2022 · 6 comments
Open

Improve the documentation for colorscheme customization #85

ZaneBartlett1 opened this issue Oct 11, 2022 · 6 comments

Comments

@ZaneBartlett1
Copy link

Hello,

Thanks a ton for the pluggin, I really love it! The one thing that I was hoping I might be able to configure is this blue highlighting I'm getting from having netrw and a terminal open -
image

I understand it probably has something to do with the fact they're kind of hidden buffers it seems? I looked at what's configurable here but honestly have never messed with colors or anything like that and really just want to turn the highlighting off as whatever buffertab is darkened does correctly correspond to the buffer in focus. Any help is much appreciated!

@ap
Copy link
Owner

ap commented Oct 28, 2022

Hi, sorry I didn’t realize how long this has been waiting for a response.

Basically the way color schemes in Vim work is that things like UI elements and parsed bits of syntax use symbolic names, and color schemes assign colors to these symbolic names, but symbolic names can also be linked to another symbolic name. And the linked bit of the documentation describes the symbolic names that BufTabLine declares, plus which well-known symbolic names it defaults links them to. That way BufTabLine automatically picks up colors defined by your color scheme which will hopefully fit together well. But sometimes they don’t, and then you can assign a color to one of BufTabLine’s symbolic names directly which overrides the linkage. So you can certainly override the blue highlight with something else.

What commands did you run to get this set of buffers? I’m trying to figure out what kind of buffer is being highlighted in blue.

@ZaneBartlett1
Copy link
Author

ZaneBartlett1 commented Oct 28, 2022

No problem at all! If this ends up being a huge thing I'd honestly be okay with just closing this. I recently moved to nvim and use a different pluggin to handle buffers. Although I'm trying to make my config usable to others and still suggest this pluggin for a more streamlined set up, as it really is plug and play. I do get the same issue on nvim as vim though, so I'd be interested in knowing how to solve this so that I can add that to the ReadMe, but not at a large expense of your time!

If it's the case that this wouldn't be a large ask, on nvim I'm running :Lexplore|wincmd l|10split|terminal. I forget if the command is the exact same on vim though because the terminals are handled differently. In both cases though I'm fairly confident it's the emulated terminal buffer that's being highlighted blue. If I switch focus to the terminal, buftabline shows that I'm focused on the buffer that is highlighted blue at that point. Let me know if there's anything else helpful I can provide on my end! Here's the current config I'm using for nvim if that's any help https://github.com/ZaneBartlett1/nvim

@FriendlyTroll
Copy link

Just info for anyone running into this issue:

I wanted a similar solution to this, but only to reverse the highlighting around, so that the blue highlight represents the active tab, so I used this .vimrc snippet :

...
" color scheme
colorscheme onedark
" buftabline custom highlight
" this has to be applied after colorscheme
highlight TabLineSel term=bold ctermfg=236 ctermbg=39
highlight PmenuSel ctermfg=145 ctermbg=237
...

You can play around with the numbers to get different colors. You can also show the current highlight mappings by running
:hi

Might be good to add info about this in the README, as this could be a common thing people would want.

@ap
Copy link
Owner

ap commented Jun 24, 2023

@FriendlyTroll That’s not a good way of doing this. Buftabline is piggybacking on TabLineSel and PmenuSel in order to integrate with everything else, but those have other meanings as well, so you’re messing with more than you intend. Instead you should override just Buftabline’s own custom names, which are documented in :help buftabline-colors.

But a better way still is not to define specific colors but to reuse one from your colorscheme. You can do this by browsing :help highlight-groups, which lists the standard highlight group names and conveniently highlights them by themselves, so it’s kinda like a color swatch. Find a highlight group name with a color that makes sense, then put hi link BufTabLineActive ThatOtherGroup in your vimrc.

(Yes, this should be in the docs, this last part in particular. I didn’t have a good user-friendly results-oriented way of explaining this process until just now.)

@FriendlyTroll
Copy link

Hi ap, sorry for the late reply.

Thanks for the info, you are right my way is not the optimal one. I did try your suggestion, however in my testing the BufTabLineActive controls the non-focused tab and the BufTabLineCurrent controls the active buffer, here's the config part

highlight link BufTabLineCurrent WildMenu
highlight link BufTabLineActive Search

which gets me this
Screenshot from 2023-07-24 10-49-24
debian11.yml is the current focused buffer, the other one is in vertical split.

Anyway it works now, and thanks for the lesson in vim highlighting :-D

@ap
Copy link
Owner

ap commented Jul 26, 2023

Sorry for the late reply.

Have you seen how late some of my replies are? 😛

Anyway it works now, and thanks for the lesson in vim highlighting :-D

Happy to provide. 🙂

@ap ap changed the title Turn off blue highlighting? Improve the documentation for colorscheme customization Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants