Skip to content

RafaelMDM/gt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GT

About

This program stores location bookmarks in a json file in the the user's config directory e.g. ~/.config on Linux.

Installation

Make sure your GOBIN environment variable is set.

git clone https://github.com/RafaelMDM/gt.git && cd gt/cmd/gt
go install

Then 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.

Usage

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 foo

To list all locations:

gt list
# OR
gt

To go to a saved location bookmark:

gt [name]

# Example: Go to "foo"
gt foo

Author

Rafael Marques

About

Save and GoTo important locations in an instant

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages