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

git.yazi: Configure the themes in the setup function instead of using THEME.git #44

Closed
2 tasks done
hankertrix opened this issue Dec 26, 2024 · 3 comments
Closed
2 tasks done
Labels
feature New feature request

Comments

@hankertrix
Copy link

yazi --debug output

Yazi
    Version: 0.4.3 (Arch Linux 2024-12-25)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.83.0 (90b35a62 2024-11-26)

Ya
    Version: 0.4.3 (Arch Linux 2024-12-25)

Emulator
    Brand.from_env      : Some(Ghostty)
    Emulator.detect     : Emulator { kind: Left(Ghostty), light: true, cell_size: Some((15, 30)) }
    Emulator.detect_full: Ok(Emulator { kind: Left(Ghostty), light: true, cell_size: Some((15, 30)) })

Adapter
    Adapter.matches: Kgp

Desktop
    XDG_SESSION_TYPE           : Some("x11")
    WAYLAND_DISPLAY            : None
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

NVIM
    NVIM          : false
    Neovim version: 0.10.3

Variables
    SHELL           : Some("/bin/bash")
    EDITOR          : Some("nvim")
    VISUAL          : Some("nvim")
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: None

Text Opener
    default     : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-create: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-rename: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : 0
    tmux version       : No such file or directory (os error 2)
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file          : 5.46
    ueberzugpp    : No such file or directory (os error 2)
    ffmpeg/ffprobe: 7.1 / 7.1
    pdftoppm      : 24.12.0
    magick        : 7.1.1-43
    fzf           : 0.57.0
    fd/fdfind     : 10.2.0 / No such file or directory (os error 2)
    rg            : 14.1.1
    chafa         : No such file or directory (os error 2)
    zoxide        : No such file or directory (os error 2)
    7z/7zz        : 24.09 / No such file or directory (os error 2)
    jq            : 1.7.1

Clipboard
    wl-copy/paste: No such file or directory (os error 2) / No such file or directory (os error 2)
    xclip        : 0.13
    xsel         : No such file or directory (os error 2)

Please describe the problem you're trying to solve

Most plugins are set up by passing options to the setup function, but the git.yazi plugin themes itself using a global variable.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

Maybe have a table inside the options passed to the plugin to set up the theme.

Additional context

No response

Checklist

  • I have searched the existing issues/discussions
@hankertrix hankertrix added the feature New feature request label Dec 26, 2024
@sxyazi
Copy link
Member

sxyazi commented Dec 26, 2024

Using THEME is just a workaround before theme.toml supports custom configurations ("theme.toml supports plugin-specific styles within [plugin]" tracked by sxyazi/yazi#51).

Once theme.toml allows custom configurations like:

[git]
modified = { fg = "blue" }

There will be no need to set them in Lua anymore, and neither users nor plugins will have to change anything, since they are equivalent.

@sxyazi sxyazi closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2024
@hankertrix
Copy link
Author

Ahh I see. That way of styling sounds great! Flavours can easily theme plugins that way and it seems quite easy to maintain.

Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳
This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

2 participants