-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fish_config: Add CLI-based theme selector #8132
Conversation
This is sweet! It looks awesome and works great for me. Some nits: for
I think we should be consistent with
Could we print a warning if there's a global shadowing the uvar? I really do think universal variables will go away eventually, and there will only be globals.
I love it how it is: prints to stdout and the user is free to redirect it.
That's a tough question. I suspect themes will end up being fish script, not JSON or other structured formats, so if the theme files are scripts then I don't think we'll paint ourselves into a corner. Do you have plans for how to populate the |
That makes sense!
We already do! > set -g fish_user_paths $fish_user_paths
> set -U fish_user_paths $fish_user_paths
set: Universal variable 'fish_user_paths' is shadowed by the global variable of the same name.
In my solution, they are not scripts. They really are just data. And I think that's quite important. The syntax is "each line contains whatever comes after I'm quite uncomfortable with making them actual scripts, especially if we end up making it available to third parties. (unfortunately "theme" is used by some third party things to mean "prompt and greeting and such", while this is about a color scheme)
If we don't have code here, it doesn't really matter. Someone could make a website, we could make a theme of the month contest on fishshell.com, a separate git repo, downloading random themes on startup, ... |
Okay, I moved the printing of the sample text to a new This makes it possible to display the current colorscheme first. I'm not quite sold on doing that, because it's too long for a single screen, so you'd need to scroll up to see it again. We could do it last, or we could remove a few themes? Are all of these really used? Or should we make the lines longer? Move the comment on the first line? |
The added spacing + comment motion makes it even better, it looks very nice to me.
My typical $LINES is 34 which fits 6.5 themes. I suppose it could be doubled if we used two columns, or even more columns if we shortened some of the text. "bright vixens jump; dozy fowl quack" is just a silly pangram I found. But we shouldn't allow perfect to be the enemy of the good. I personally don't mind scrolling, and printing a long theme list to stdout seems like a fine place to start. |
`fish_config theme`: - `list` to list all available themes (files in the two theme directories - either the web_config/themes one or ~/.config/fish/themes!) - `show` to show select (or all) themes right in the terminal - this starts another fish that reads the theme file and prints the sample text, manually colored - `choose` to load a theme *now*, setting the variables globally - `save` to load a theme and save the variables universally - `dump` to write the current theme in .theme format (to stdout) - `demo` to display the current theme
Alright, I added some docs and completions and made the web version also check ~/.config/fish/themes. Merging! |
Themes are new in Fish 3.4 (fish-shell/fish-shell/pull/8132).
Themes are new in Fish 3.4 (fish-shell/fish-shell/pull/8132).
Themes are new in Fish 3.4 (fish-shell/fish-shell/pull/8132).
Description
fish_config theme
:list
to list all available themes (files in the two themedirectories - either the web_config/themes one or
~/.config/fish/themes!)
show
to show select (or all) themes right in the terminal - thisstarts another fish that reads the theme file and prints the sample
text, manually colored
choose
to load a theme now, setting the variables globallysave
to load a theme and save the variables universallydump
to write the current theme in .theme format (to stdout)Part of #3625.
A screenshot:
TODOs:
Open questions:
choose
andsave
commands (likefish_config prompt
!)? Should we offer universal variables here, or a conf.d snippet? Should we havesave
at all?(and yes, docs and changelog and tests are still missing)