Description
Incorrect Initialization of tokyonight.nvim
I have noticed that tokyonight.nvim
is being initialized in a way that is not aligned with the recommended approach by @folke.
Expected Initialization
According to the official README, the proper way to install and initialize the plugin is:
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opts = {},
}
This does not set the colorscheme; it only initializes the plugin. However, it is important to call setup()
before configuring the theme. This is because tokyonight.nvim
applies only the necessary highlight groups based on the installed plugins, which helps optimize startup time.
Correct Way to Apply the Colorscheme
To properly apply the colorscheme, the configuration should look like this:
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
config = function()
require("tokyonight").setup()
vim.cmd.colorscheme("tokyonight")
end
}
Disabling Italics in Comments (as Kickstart Does)
If you want to disable italics in comments, similar to what Kickstart currently does, use:
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
config = function()
require("tokyonight").setup({
styles = {
comments = { italic = false },
},
})
vim.cmd.colorscheme("tokyonight")
end
}
Alternative Method (Less Documented in lazy.nvim
)
Although not well-documented in lazy.nvim
, you can also achieve the same effect with:
{
"folke/tokyonight.nvim",
priority = 1000,
opts = {
styles = {
comments = { italic = false },
},
},
config = function(_, opts)
require("tokyonight").setup(opts)
vim.cmd.colorscheme("tokyonight-night")
end,
}
Would it be possible to align the initialization of tokyonight.nvim
with the recommended approach?