Closed pfmoore closed 2 months ago
zoxide is designed for scriptability, you should be able to add a customization like this very easily. First initialize zoxide without a z
command:
eval "$(zoxide init <your shell> --no-cmd)"
Then, you can write a custom function that handles the case with zero arguments, and calls __zoxide_z
otherwise.
When I start up a new shell, I have it configured to start in my "scratch" directory,
C:\Work\Scratch
. Because of this, I think of that directory as my "base location", and as a result it's where I would prefer thez
command to take me by default. In contrast, my "home" directory isC:\Users\<myname>
and is a place where applications store settings, configuration, etc - but it is not where I routinely store my files and/or projects.It would be nice to have a way to set an alternative "default location". I guess the way to do this would be via an environment variable, say
_ZO_DEFAULT_DIR
.To be clear, I would expect this to only affect the result when running
z
with no arguments. I don't want it to change the meaning of~
(which is why I suggested_ZO_DEFAULT_DIR
rather than_ZO_HOME
).