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

Add an init subcommand #8

Closed
lugoues opened this issue Mar 8, 2020 · 6 comments
Closed

Add an init subcommand #8

lugoues opened this issue Mar 8, 2020 · 6 comments

Comments

@lugoues
Copy link

lugoues commented Mar 8, 2020

Would be great to have an init method. This would allow us to source $(eval zoxide init zsh) and stay up to date if you make a script change in the future.

@lugoues lugoues changed the title Add an init method? Add an init method Mar 8, 2020
@lugoues lugoues changed the title Add an init method Add an init subcommand Mar 8, 2020
@cole-h
Copy link
Contributor

cole-h commented Mar 9, 2020

I actually really like this idea. It's something that the "competing" pazi does and would alleviate the concern re: the fish script ("Creating a separate folder with a name like functions in the repository can be confusing." #4 (comment)).

Without thinking too deeply, I can't see many downsides to this approach (there are probably more than I'm thinking of, however). The upside is that there is no need for a plugin manager, because the user only needs to add one eval to their config, and everything is then on pace with the binary itself.

Overall, I'm a fan.

@ajeetdsouza
Copy link
Owner

I agree, this is a great idea! I will work on this today.

@ifreund
Copy link

ifreund commented Mar 10, 2020

I hope this can be implemented without hard coding the default aliases of z, zi, za, etc. I prefer to use j for mine since autojump was the first such program I used and because j is right under my index finger on the homerow.

@cole-h
Copy link
Contributor

cole-h commented Mar 10, 2020

I think the best way to do this is to check for environment variables, like z.lua does. Alternatively (not really a fan of this one, but...): could use command line flags for each thing to change.

@ajeetdsouza
Copy link
Owner

I've added an init subcommand in f0c5e28. Currently, I still haven't added the environment variable, so I'll leave this issue open for now.

@ajeetdsouza
Copy link
Owner

I've added a command line flag in 34ab8f3. I felt a flag would be better than an environment variable here since it only affects this particular command and not the entire program.

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

4 participants