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

Do not "short-circuit" multiple-character keymaps #2353

Closed
2 of 3 tasks
randoragon opened this issue Feb 17, 2025 · 2 comments
Closed
2 of 3 tasks

Do not "short-circuit" multiple-character keymaps #2353

randoragon opened this issue Feb 17, 2025 · 2 comments
Labels
feature New feature request

Comments

@randoragon
Copy link

randoragon commented Feb 17, 2025

yazi --debug output

Yazi
    Version: 25.2.7 (Nixpkgs 2025-02-07)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.84.0 (9fc6b431 2025-01-07)

Ya
    Version: 25.2.7 (Nixpkgs 2025-02-07)

Emulator
    TERM                : Some("foot")
    TERM_PROGRAM        : None
    TERM_PROGRAM_VERSION: None
    Brand.from_env      : Some(Foot)
    Emulator.detect     : Emulator { kind: Left(Foot), light: false, cell_size: Some((8, 18)) }
    Emulator.detect_full: Ok(Emulator { kind: Left(Foot), light: false, cell_size: Some((8, 18)) })

Adapter
    Adapter.matches: Sixel

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-1")
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Neovim
    NVIM          : false
    Neovim version: 0.10.4

Variables
    SHELL           : Some("/run/current-system/sw/bin/zsh")
    EDITOR          : Some("nvim")
    VISUAL          : None
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: None

Text Opener
    default     : Some(Opener { run: "xdg-open \"$1\"", block: false, orphan: false, desc: "Open", for_: None, spread: false })
    block-create: None
    block-rename: None

Multiplexers
    TMUX               : false
    tmux version       : tmux 3.5a
    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.02.0
    magick        : 7.1.1-43
    fzf           : 0.59.0
    fd/fdfind     : 10.2.0 / No such file or directory (os error 2)
    rg            : 14.1.1
    chafa         : 1.14.5
    zoxide        : 0.9.6
    7zz/7z        : 24.09 / 17.05
    jq            : 1.7.1

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

Please describe the problem you're trying to solve

Currently, when creating a longer keymap, e.g.

[[manager.prepend_keymap]]
on   = [ "c", "d", "d", "m", "u" ]
run  = 'cd ~/Downloads/Music'

yazi will execute the command as soon as it runs out of other candidates for a keymap match. So in this example, typing anywhere from 1 to 5 letters of "cddmu" would change the directory. Exactly how many will depend on other defined keymaps.

This is surely an intentional feature, but as someone who relies on muscle memory more than visual feedback, it's quite annoying. Sometimes a keymap will trigger before I've finished typing, and the last few inputs are messing up my workflow. Another unpleasant consequence of the current behavior is that a keymap can "change" merely by removing or adding other keymaps.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

I would like to see an option to turn this behavior off and always require the full-length input.

Checklist

  • I have searched the existing issues/discussions
  • The latest nightly build doesn't already have this feature
@randoragon randoragon added the feature New feature request label Feb 17, 2025
@randoragon
Copy link
Author

After some consideration, I've decided that yazi is not a project for me and moved back to using lf. I'm hugely impressed by what yazi can do, but I just prefer lf's configuration model, particularly the ability to embed small shell scripts and load dynamic configuration.

I still think this would be a nice feature for yazi to have for completeness, but I'm no longer interested in implementing it. Feel free to do whatever you want with it. Thanks!

@sxyazi
Copy link
Owner

sxyazi commented Feb 18, 2025

Ah I see, thanks for the update!

I'll close this issue for now since it's no longer valuable to you, and I'm also not interested in/using it. If anyone needs it, feel free to raise a PR. Thanks!

@sxyazi sxyazi closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

2 participants