iridakos / goto

Alias and navigate to directories with tab completion in Linux
https://iridakos.com/programming/2019/04/10/shell-navigation-with-autocomplete
MIT License
879 stars 63 forks source link

On zsh, goto is unable to create aliases if ~/.goto does not exist #39

Closed Calinou closed 6 years ago

Calinou commented 6 years ago

If ~/.goto does not exist, goto is unable to create aliases. It will print an error, claim success but will not effectively save anything:

~/Documents/Git/godotengine/godot
❯ goto -r godot .
_goto_register_alias:34: no such file or directory: /home/hugo/.goto
Alias 'godot' registered successfully.

~/Documents/Git/godotengine/godot
❯ goto -l
You haven't configured any directory aliases yet.

~/Documents/Git/godotengine/godot
❯ goto godot
goto error: unregistered alias godot

This can be worked around by entering touch ~/.goto. Note that this only applies to zsh — it seems to work fine with Bash when ~/.goto does not exist (i.e. the file will be created automatically).

pacharanero commented 5 years ago

Note that in ZSH there is an excellent and very similar tool called wd which does exactly what goto does

For ZSH / oh-my-zsh: https://github.com/mfaerevaag/wd For any shell: https://github.com/mfaerevaag/wd-c