Closed koopa1338 closed 8 months ago
I just made a simple colorscheme. So I think you got it for the most part but requiring the file runs into caching problems. I found if i had it return from the module it works better. So for example instead of JUST requiring, make the module return a function that you can call to set the color scheme.
https://github.com/rockerBOO/boo-colorscheme-nvim/blob/main/lua/boo-colorscheme.lua#L8
And then I have
lua require'boo-colorscheme'.use{}
@rockerBOO I was searching for the caching problem and found a solution. It seems require
won't load the same file, as explained in nvim-lua-guide#1.
Loaded info must be removed to make :colorscheme
force-reload, so I've done this in colors/cactusbuddy.vim of my colorscheme.
lua package.loaded.cactusbuddy = nil
lua require('cactusbuddy')
I think this seriously needs a documentation as this might become way more popular if it gives sense how to use it.
Should be just colorscheme blah
now and load it with lua, i included example one in repo now as well :)
The README shows some example themes but it lacks some information about how to setup your own colorscheme:
My naive try was:
packadd
nvim/lua/colors.lua
file and define my colorschemeinit.lua
→ didn't work, for some reason my colors are broken but I don't get any error messages.