-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax highlighting #137
Comments
Hey @gldtn! Can you be more specific about what is wrong? Nothing is jumping out at me from your screenshot. |
For example, the scopes(words in this case): local, require, |
ah! I see. are you using treesitter and have the lua parser installed? |
Hmm, seems like there was a couple of things affecting, first my lame attempt to get .blade.php files to be parsed correctly: After commenting this out, treesitter started parsing correctly.. -- -- FIXME: this is a hack to add blade support
-- local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
--
-- ---@class ParserConfig
-- parser_config.blade = {
-- install_info = {
-- url = "https://github.com/EmranMR/tree-sitter-blade",
-- files = { "src/parser.c" },
-- branch = "main",
-- },
-- filetype = "blade",
-- }
--
-- vim.filetype.add({
-- pattern = {
-- [".*%.blade%.php"] = "blade",
-- },
-- }) Colors were also different due to me playing with italics: overrides = function(colours)
return {
-- italics
Keyword = { italic = true },
-- Constant = { italic = true },
Function = { italic = true },
Identifier = { italic = true },
-- non-italics
Unit = { italic = false },
Error = { italic = false },
Number = { italic = false },
}
end, What is the proper way to add more italics to the theme without overriding the original colors? |
The overrides function is intended to override the highlight group entirely, so you'd need to give it a colour otherwise it will just default to the value of So in this case, your config should look like this: overrides = function(colours)
return {
-- italics
Keyword = { fg = colours.orange, italic = true},
Function = { fg = colours.blue, italic = true },
-- and so on ...
}
end, That would be the way to do it inside the cyberdream config. However, a more simple approach in your case could be to set the italic property after cyberdream.nvim has already been set up. In that case, the following example should work: return {
{
"scottmckendry/cyberdream.nvim",
dev = true,
lazy = false,
priority = 1000,
config = function()
require("cyberdream").setup({})
vim.cmd("colorscheme cyberdream")
-- define italic groups
local italic_groups = {
"Keyword",
"Function",
}
-- must appear AFTER the "colorscheme cyberdream" command
for _, group in ipairs(italic_groups) do
vim.cmd("hi " .. group .. " gui=italic cterm=italic")
end
end,
},
} |
I do like that second approach, but that seems like it reverts the colors to the default Treesitter/LSP highlights. At least from the quick test I did here. So might have to go through |
Question or Suggestion
I just noticed while I was playing with italics that my syntax highlighting is different from the original cyberdream for some reason:
Any idea what might be overriding? Or what I can check?
Thanks!
The text was updated successfully, but these errors were encountered: