sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
16.29k stars 377 forks source link

Command to enter a directory or open the selected file #335

Closed Xgames123 closed 1 year ago

Xgames123 commented 1 year ago

Is your feature request related to a problem? Please describe

I always press \<Enter> on a directory to enter it but it opens it in the editor.

Will you be willing to contribute this feature?

Describe the solution you'd like

A open-enter option in the keymap.toml

{ on = [ "\<Enter\>" ],   exec = "open-enter",  desc = "Open/enter the selected files or directories" },

Describe alternatives you've considered

In open rules you could also have something like this [open] rules = [ { mime = "inode/directory", use = [ "enter" ] } ]

Additional context

No response

Xgames123 commented 1 year ago

I didn't read the docs https://yazi-rs.github.io/docs/faq#why-cant-open-and-enter-be-a-single-command

SolitudeSF commented 1 year ago

does the current plugin infrastructure allows for this to be implemented? this is the only fm i know that insists on splitting this functionality and it makes using it very obnoxious.

sxyazi commented 1 year ago

Hi @SolitudeSF, Sadly to say that Yazi's plugin system has not been available yet.

I'm refactoring the code to prepare for the plugin system recently, https://github.com/sxyazi/yazi/pull/338.

github-actions[bot] commented 11 months ago

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.

sxyazi commented 10 months ago

We've supported it now, see this tip https://yazi-rs.github.io/docs/tips/#smart-enter-enter-for-directory-open-for-file.

Note that Yazi main branch is currently required.