Code Monkey home page Code Monkey logo

Comments (6)

ap avatar ap commented on August 14, 2024

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.

from vim-buftabline.

ZaneBartlett1 avatar ZaneBartlett1 commented on August 14, 2024

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

from vim-buftabline.

FriendlyTroll avatar FriendlyTroll commented on August 14, 2024

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.

from vim-buftabline.

ap avatar ap commented on August 14, 2024

@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.)

from vim-buftabline.

FriendlyTroll avatar FriendlyTroll commented on August 14, 2024

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

from vim-buftabline.

ap avatar ap commented on August 14, 2024

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. 🙂

from vim-buftabline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.