kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.43k stars 151 forks source link

how to use cmd_aliases for command with user input? #452

Closed xj-m closed 6 months ago

xj-m commented 11 months ago

in joshuto.toml I configed

[cmd_aliases]

j = "z"

Expected j could be used as same as z, but cmd_aliases was not able to take the shell input from user and used for zoxide.

Is there a way to replace a command?🙏

eljamm commented 8 months ago

Perhaps you can try remapping the j key in keymap.toml:

[default_view]

keymap = [
...
  { keys = ["j"], commands = [":z "] },
  { keys = ["j", "i"], commands = [":zi "] },
...
]

To do this, it's better to copy the template keymap to your config and modify it as necessary, since writing it from scratch might override your default keymaps, leaving them unmapped.