-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
per-filetype theme overrides? #20166
Comments
As a workaround I have this solution now.
"experimental.theme_overrides": {
"editor.foreground": "#e06c75"
}
{
"label": "Toggle Primary Color",
"command": "/my/path/to/toggle_zed_primary_color.sh",
"reveal": "never",
"hide": "always",
"shell": "system"
}
{
"context": "Workspace",
"bindings": {
"ctrl-t": ["task::Spawn", { "task_name": "Toggle Primary Color" }]
}
},
#!/bin/bash
# Define the JSON file location
JSON_FILE="/home/username/.config/zed/settings.json"
# Define the colors to toggle between
COLOR1="#cad6eb"
COLOR2="#e06c75"
# Check if the JSON file exists
if [[ ! -f "$JSON_FILE" ]]; then
echo "Error: JSON file not found at $JSON_FILE"
exit 1
fi
# Check if the file contains COLOR1 or COLOR2 and toggle between them
if grep -q "\"editor.foreground\": \"$COLOR1\"" "$JSON_FILE"; then
# Replace COLOR1 with COLOR2
sed -i "s/\"editor.foreground\": \"$COLOR1\"/\"editor.foreground\": \"$COLOR2\"/" "$JSON_FILE"
elif grep -q "\"editor.foreground\": \"$COLOR2\"" "$JSON_FILE"; then
# Replace COLOR2 with COLOR1
sed -i "s/\"editor.foreground\": \"$COLOR2\"/\"editor.foreground\": \"$COLOR1\"/" "$JSON_FILE"
else
echo "No matching color found in $JSON_FILE"
fi Pressing |
I believe this is a duplicate of: Thanks for reporting. While I'm excited to see your workaround @machin3io I'm sad it's come to that. |
I'm not 'so sure @ duplicate :) Thanks for looking into it though. I appreciate the responsiveness. Per-project themes may not be the same as per-filetype theming. I want my themes consistent across projects, but not necessarily across file types. I thought about per-filetype themes too, but disregarded it as the theme includes a lot of non-editor declarations too. So I'm really only interested in specific syntax/highlight group colors really. And ideally of course the primary color I'm tweaking above, should be part of the syntax key too. |
Interesting. I'll leave it open for the moment then. Practically speaking we could add support experimental theme overrides under the language key too. |
Check for existing issues
Describe the feature
To do the syntax highlighting like I prefer it in python , I have to set
editor.forground
color.See
vs
with the second being my preferred look, which closely mirrors the astronvim theme, which itself seems to be a variation of One Dark (Pro?).
Now, changing
editor.forground
will of course also affect other filetypes. For markdown for instance, I don't want all my base text in this color. And so while theexperimental.theme_overrides
work well in general, the don't work when specified on a per language level.So, if possible I would just be able to do the following:
But it has no effect.
Or maybe I'm missing something obvious? Is it possible to completely disable syntax highlighting in some file types?
I would find that acceptable, even though I prefer having markdown headlines be a discrete color, and potentially other elements too.
The text was updated successfully, but these errors were encountered: