After writing about [[nnn is so close to being great]] yesterday I ended up asking AI to go find alternatives, and it did! Amongst them were:
- yazi (what i'm currently using)
- joshuto (like Ranger but faster)
Unsurprisingly these are all written in Rust, the lingua franca of rewriting command line functionality with more features.
I tried both `yazi` and `joshuto` and for now am going to see if `yazi` sticks. I don't actually do _that much_ directory traversal in my terminal since i've stopped doing IC coding work for the time being. So these tools really just scratch my itch to constantly improve my workflow.
It's also just frustrating to type out filepaths, something the computer is far better suited to than my human fingers.
# Yazi 🦆
- Docs: https://yazi-rs.github.io/
- Repo: https://github.com/sxyazi/yazi
Who doesn't like Chinese-named Github projects? When i saw this I had to imagine people reading it like "Yahtzee", which is how I read it at first. It's not every day that some Chinese pinyin has a plausible sounding English pronounciation.
Regardless, I was on the fence until i checked out the authors blog. One of their posts about customizing macOS settings really resonated, as I have one of these files to customize new macs quickly.
Link (in Chinese): https://sxyz.blog/macos-setup/
## Why?
It's vim like, and relatively easy to customize. That's pretty much it. It's also supposedly fast, but on a dev machine... who cares? We (I assume) all run machines with far more memory than we actually need outside of running Docker so I'm not too concerned about memory consumption.
As long as it responds as fast as a computer should (read instantly) then i'm happy, and so far it meets that bar. As does joshuto, mentioned above.
More specifically, you can customize the key bindings fairly easily.
```
mkdir -p ~/.config/yazi
touch ~/.config/keymap.toml
```
Then in that toml customize things using `prepend_keymap`:
```toml
# keymap.toml
[manager]
prepend_keymap = [
# Use y for copy, i.e. "yank", vim style
{ on = [ "y", "y" ], run = "copy path", desc = "Copy the file path" },
{ on = [ "y", "d" ], run = "copy dirname", desc = "Copy the directory path" },
{ on = [ "y", "f" ], run = "copy filename", desc = "Copy the filename" },
{ on = [ "y", "n" ], run = "copy name_without_ext", desc = "Copy the filename without extension" },
]
```
Or using `yazi ~` you can also utilize the `a` key to create `~/.config/yazi/keymap.toml` and it handles the interim directory creation for you.
The built-in keymap is extensive: https://github.com/sxyazi/yazi/blob/shipped/yazi-config/preset/keymap-default.toml
There is also an `append_keymap`, although i'm not sure what that does.