Git Product home page Git Product logo

Comments (3)

lervag avatar lervag commented on June 1, 2024

I just noticed another related thing: Thematic breaks plugins that alter highlighting such as vim-niji. The reason seems to be the same as what I mentioned above.

Perhaps a better approach here would be to add some hooks after a theme has been loaded. Something like this:

let g:thematic#themes.theme.post_hook = 'MyFunction'

Where MyFunction is a function that is called after the theme has been loaded, and where I can make my customizations as desired.

from vim-thematic.

reedes avatar reedes commented on June 1, 2024

Colorscheme initialization can be a tricky problem, as you observe. :)

Thematic will alter colors typically upon demand, much as if the user typed :colo solarized, which also will not re-initialize the customized highlights you had specified in your .vimrc. A configurable post-load hook sounds like one way to address that, perhaps on a per-theme basis.

Better yet you can set up your own event-driven hook:

augroup MyCustomHighlights
  autocmd!
  autocmd colorscheme *
   \ highlight SpellBad   gui=bold guibg=#faa |
   \ highlight SpellCap   gui=bold guibg=#faf |
   \ highlight SpellRare  gui=bold guibg=#aff |
   \ highlight SpellLocal gui=bold guibg=#ffa
augroup END

Regarding plugins like vim-niji that will override the highlighting, that's a more difficult problem. Ideally they should re-initialize after a user typed :colo solarized, but at least that plugin does not. I'd ask its author to do an event-driven hook as above to re-initialize themselves.

Does that answer your concerns/questions?

from vim-thematic.

lervag avatar lervag commented on June 1, 2024

Yes, thank you!

from vim-thematic.

Related Issues (19)

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.