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

Idea: merge z and zi - enter interactive mode by using z without argument #932

Closed
WieeRd opened this issue Nov 6, 2024 · 2 comments
Closed

Comments

@WieeRd
Copy link

WieeRd commented Nov 6, 2024

Currently, z without any argument changes cwd to the home directory.
I assume this is meant to replicate the behavior of cd, but I don't find this particularly useful.
Wouldn't it be much more useful and ergonomic if z without any argument enters the interactive mode of zi?

@ajeetdsouza
Copy link
Owner

This is certainly a nice idea. The problem is that opening up zi with no arguments typically produces too many results and is not very helpful. I personally tend to prefer Space+Tab completions where I can type out some part of the query before opening up the fuzzy finder.

However, if you'd like to set it up on your own shell, you can just create a function that wraps __zoxide_z (the equivalent of "z") and calls __zoxide_zi (equivalent of "zi") when there are no arguments.

@WieeRd
Copy link
Author

WieeRd commented Nov 6, 2024

I've just tried it, and it was pretty simple to implement.
I guess this is trivial enough to not need to be upstreamed to zoxide itself.
Here's my snippet using Nushell, for the people who came up with the same idea as me.

# env.nu
zoxide init nushell --no-cmd | save -f zoxide.nu
# config.nu
def --env z [search?: string] {
    if $search != null {
        __zoxide_z $search
    } else {
        __zoxide_zi
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants