zaldih / themery.nvim

A colorscheme picker with live preview and persistence for neovim ✨
https://imzaldih.com/en/post/how-to-change-neovim-colorscheme-with-themery/
GNU General Public License v3.0
138 stars 7 forks source link

Doesn't load theme config files #3

Closed IzzyDLP closed 9 months ago

IzzyDLP commented 10 months ago

I'm using the gruvbox theme and using themery gives an error of Themery error: Could not open file or read: /home/name/.config/nvim/v:null

This is my current setup in themery.lua

require("themery").setup({ themes = {{ name = "Day", colorscheme = "gruvbox", before = [[vim.opt.background = "light"]], themeConfigFile = "/home/name/.config/nvim/lua/blah/plugins/day.lua" }, { name = "Night", colorscheme = "gruvbox", before = [[vim.opt.background = "dark"]], themeConfigFile = "/home/name/.config/nvim/lua/blah/plugins/night.lua" } } })

zaldih commented 10 months ago

Thank you for opening this issue! I will check it in a few days as soon as I have time :)

zaldih commented 10 months ago

Oh wait I think I've found the problem.

"themeConfigFile" should be declared once outside the themes tag.

Try this code:

require("themery").setup({
themeConfigFile = "/home/name/.config/nvim/lua/blah/plugins/sample-config.lua",
themes = {{
   name = "Day",
   colorscheme = "gruvbox",
   before = [[vim.opt.background = "light"]],
}, {
   name = "Night",
   colorscheme = "gruvbox",
   before = [[vim.opt.background = "dark"]],
}}
})

And in the sample-config.lua (or in your own configuration file) put this text:

-- Themery block
-- end themery block
zaldih commented 9 months ago

Closing due to inactivity. If the problem is not solved by the proposed solution, please feel free to reopen the issue.