ThePrimeagen/init.lua

Erorr while sourcing colors.lua

umairmaratab opened this issue · 8 comments

When I try to source colors.lua file it says:

Screenshot from 2023-06-15 13-52-16

I copied the exact content from colors.lua file in after/plugin directory.

Thanks in advance for your help.

I think after saving the colors.lua you have to call the function ColorMyPencils() by typing :lua ColorMyPencils()

Thanks for your answer.
Same Error.

I don't if you use it after accessing to the directory of nvim after writing nvim . in the terminal.
you're welcome bro

That's the code that I wrote :

function ColorMyPencils(color)
color = color or "rose-pine"
vim.cmd.colorscheme(color)

vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })

end

ColorMyPencils()

you can use it and try again.

I think error is somewhere else, as when I execute nvim . it says:

Error detected while processing /home/user-name/.local/share/nvim/site/pack/packer/start/rose-pine/colors
/rose-pine.lua:
W18: Invalid character in group name

Full description of error:
Error detected while processing /home/user-name/.local/share/nvim/site/pack/packer/start/rose-pine/colors
/rose-pine.lua:
W18: Invalid character in group name
.
.
.
W18: Invalid character in group name

Error detected while processing /home/user-name/.config/nvim/after/plugin/colors.lua:
E5113: Error while calling lua chunk: /home/user-name/.config/nvim/after/plugin/colors.lua:7: attempt to
index field 'cmd' (a function value)
stack traceback:
/home/user-name/.config/nvim/after/plugin/colors.lua:7: in function 'ColorMyPencils'
/home/user-name/.config/nvim/after/plugin/colors.lua:14: in main chunk
Press ENTER or type command to continue

you can see this issue:
neovim/neovim#14202

Thank u it was actually due to older version of nvim.
I installed via source and now everything is fine.