Skip to content
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

[Feature request] Sort tinty list #74

Open
alix-artus opened this issue Oct 12, 2024 · 6 comments
Open

[Feature request] Sort tinty list #74

alix-artus opened this issue Oct 12, 2024 · 6 comments
Assignees

Comments

@alix-artus
Copy link

Is your feature request related to a problem? Please describe.

I am using the following command to preview themes in my terminal:

$ tinty list | fzf --preview "tinty apply {}; ~/tinted-shell/colortest {}"

The list is ordered alphabetically, meaning that themes like base16-atelier-estuary and base16-atelier-estuary-light are next to each other. When browsing, switching from a light theme to a dark theme is quite violent for the eyes, making the browsing experience pretty bad.

Describe the solution you'd like

A way to sort the themes, from dark background to light background for example, would fix this issue.

A command like:

$ tinty colortest

would also be quite nice.

Describe alternatives you've considered

  • An alternative would be to implement a command like:
$ tinty preview
@JamyGolden
Copy link
Member

Have you tried using tinty info? I can look at modifying tinty info to be more interactive instead of a long list

@alix-artus alix-artus changed the title [Feature request] [Feature request] Sort tinty list Oct 13, 2024
@alix-artus
Copy link
Author

I tried tinty info but the display does not seem to work well in my terminal (macos default terminal).

The main point is to have some ways to call tinty apply to check how the theme is being rendered with an opened vim or in tmux.

@windowsrefund
Copy link
Contributor

windowsrefund commented Oct 16, 2024

I've got shell alias I wrote which may be of some value to you but I can't speak to how it would interact with vim/neovim as I do not use a base16 theme in my editor. As you can see, this also doesn't "see" any custom themes you have have setup.

alias tint='tinty list | \
fzf \
--height 30% \
--info hidden \
--border rounded \
--cycle \
--bind "enter:execute(tinty apply {})+reload(tinty list)"'

Though not perfect, you can build upon the above by adding one or more excludes by way of grep -v. For example, I know I don't want to see any of the windows themes:

alias tint='tinty list | grep -v windows \
fzf \
--height 30% \
--info hidden \
--border rounded \
--cycle \
--bind "enter:execute(tinty apply {})+reload(tinty list | grep -v windows)"'

It's not perfect as we're filtering based on theme name rather than the variant. That said, it may provide a starting place for something more robust. Perhaps a more mature version would add add an additional keybinding to dump the selected scheme into a excludes file which would be used instead of the hard-coded string...

@JamyGolden
Copy link
Member

Something worth mentioning (maybe this will solve your needs), we have a gallery page which is created by rendering the theme in vim and then converting that to html, so you can preview themes, albeit with static content: https://tinted-theming.github.io/base16-gallery/

@alix-artus
Copy link
Author

The gallery is really nice but please note that it has the same issue than the original issue: it is sorted by alphabetical order as opposed to an ordering like from dark background to light background. Sorting by name is useful when you know already what you are looking for. But when someone looks for a new theme, sorting based on colours or background darkness would probably be much more useful.

PS: a dark background in the gallery would probably help to highlight each individual themes.

@JamyGolden
Copy link
Member

I still need to add to tinty, but I've created a PR which adds a "group by variant" and "darkmode" feature: tinted-theming/base16-gallery#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants