This program stores location bookmarks in a json file in the the user's config directory
e.g. ~/.config on Linux.
Make sure your GOBIN environment variable is set.
git clone https://github.com/RafaelMDM/gt.git && cd gt/cmd/gt
go installThen add this function to your .bashrc or equivalent file:
function gt {
go_bin=$(go env GOBIN)
out=$("$go_bin/gt" "$@")
if [ "$#" -eq 1 ]; then
cd "$out"
else
echo "$out"
fi
}Since a child process can't change the cwd of its parent, this bash function will retrieve the path and cd to it.
To add a new location bookmark:
gt add [name] [path]
# OR
gt [name] [path]
# Example: Save the cwd as "foo"
gt foo .To remove a location bookmark:
gt rm [name]
# Example: Remove the "foo" bookmark:
gt rm fooTo list all locations:
gt list
# OR
gtTo go to a saved location bookmark:
gt [name]
# Example: Go to "foo"
gt foo