gt your desired path with minimal keystrokes

Overview

goto (gt)

CI Status Crates.io License: MIT

gt is a simple and user-friendly way to jump to your indexed directories.

gt is short for "goto", which is basically what you want to do with minimal keystrokes.

Features

  • Convenient syntax gt XXX to jump to XXX's path
  • Easy indexing of sub-directories by using gt add -a
  • Pretty tree-like index listing using gt ls

Demo

Demo

Installation

Step 1. Getting the binary

wget https://github.com/slai11/goto/releases/download/v0.3.0/goto-rs-v0.3.0-x86_64-apple-darwin.tar.gz
tar -xvf goto-rs-v0.3.0-x86_64-apple-darwin.tar.gz
cp goto-rs-v0.3.0-x86_64-apple-darwin/goto-rs /usr/local/bin

Or you could clone the project and build from source. You will need rust (brew install rust) to do so.

git clone https://github.com/slai11/goto.git
cd goto 
cargo build --release
cp target/release/goto-rs /path/to/modules/

Step 2. Setting up your bash/zsh Paste eval "$(goto-rs init)" in your bashrc or zshrc.

The binary's name is goto-rs while the command you should be using is gt.

A shell-based workaround inspired by https://github.com/ajeetdsouza/zoxide and https://github.com/gsamokovarov/jump is used as it is not possible to change the working directory of your shell programmatically. The awkward naming of the binary is due to lack of namespace.

Coming Soon: Brew install!

Command-Line Options

❯ gt help
gt

USAGE:
    goto-rs [name]... [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <name>...    Refers to name of index. Must be specific for now.

SUBCOMMANDS:
    add      Add directories and sub-directories to index.
    help     Prints this message or the help of the given subcommand(s)
    init     Initialises bash-script and database.
    ls       List all indexed directories.
    prune    Removes invalid indexes in the database.
    rm       Remove directories and sub-directories to index.

Guide

Jumping to an indexed directory

Use gt <PATH> to jump to your desired folder. The <PATH> is the folder name. For example to jump to Users/xxx/project/personal, the command gt personal will change your shell directory to the desired path.

Indexing a directory

To add the current working directory into your indexs:

gt add

To add the current directory with its subdirectories (-a for all subdirectories):

gt add -a

To add multiple levels of subdirectory, use the following command, where n is the levels of subdirectories to add.

gt add -r n

List indexed directories

If you wish to list and inspect your current indexed directories.

gt ls

Cleaning up index to ensure all paths are valid

Use gt prune to update and remove non-existent directories.

Removing indexes

Removing indexes works the same way as gt add but in the reverse manner.

To remove the directory you are in from the indexes:

gt rm

To remove the current directory with its subdirectories:

gt rm -a

To add multiple levels of subdirectory, use the following command, where n is the levels of subdirectories to add.

gt rm -r n
Comments
  • feat(goto): order by inter-char distance

    feat(goto): order by inter-char distance

    Use a new distance measure. Calculate distance between position of each found character. This allows for more relevant searches to be selected instead of the shortest alias.

    feat size/M 
    opened by slai11 0
  • fix(add): handle alias clashing

    fix(add): handle alias clashing

    Aliases are typically the folder name, but identical folders with different paths are common. This PR performs reverse comparison to find the shortest distinct subpath between 2 identical folders.

    Closes issue #15.

    fix size/L 
    opened by slai11 0
  • fix overriding of key-value in index

    fix overriding of key-value in index

    Adding patha/special_name after pathb/special_name will override the first instance.

    special_name,/pathb/special_name
    
    becomes
    
    special_name,/patha/special_name
    
    bug 
    opened by slai11 0
  • feat(add): add -a option for single level indexing

    feat(add): add -a option for single level indexing

    -a or 'all' refers to adding all subdirectories in the current working directory since that is the most common use-case I have encountered. Personally i feel users will not add more than 1 level of subdir.

    feat size/M 
    opened by slai11 0
  • Deprecation messages related to 'home_dir'

    Deprecation messages related to 'home_dir'

    These warnings could probably be fixed using the dirs crate. I use dirs for one of my projects at https://github.com/theimpossibleastronaut/oxi-rmw/blob/b1c90d8450e74fbec4a56a8f732d73075574ad3c/src/main.rs#L8

    andy@oceanus:~/src/rust/goto$ cargo clippy
    warning: use of deprecated item 'std::env::home_dir': This function's behavior is unexpected and probably not what you want. Consider using a crate from crates.io instead.
      --> src/db.rs:17:11
       |
    17 |     match env::home_dir().map(|p| format!("{}/{}", p.display(), ".config/goto")) {
       |           ^^^^^^^^^^^^^
       |
       = note: `#[warn(deprecated)]` on by default
    
    warning: use of deprecated item 'std::env::home_dir': This function's behavior is unexpected and probably not what you want. Consider using a crate from crates.io instead.
      --> src/db.rs:41:11
       |
    41 |     match env::home_dir().map(|p| format!("{}/{}", p.display(), ".config/goto/db.txt")) {
       |           ^^^^^^^^^^^^^
    
    
    opened by andy5995 0
  • font color doesn't reset predictably

    font color doesn't reset predictably

    I installed v0.3.0 from crates.io using rustc 1.45.1 (c367798cf 2020-07-26)

    You can see in this image that after I ran goto-rs ls that the font color of the terminal stayed blue until after I ran ls.

    ``

    image

    opened by andy5995 0
Releases(v0.3.0)
Owner
Sylvester Chin
Rakuten Viki (present) | NUS Msc. Comp Sci (2019-present)
Sylvester Chin
Checks if there are enough space in a specified path.

@planetarium/check-free-space This package uses native OS APIs to get free size available on specified path. It is powered by fs2 under the hood. APIs

Planetarium 8 Dec 5, 2022
MILD - Minimal Install Linux Desktop

MILD - Minimal Install Linux Desktop MILD is a simple and straightforward text-mode installer that aims to install a "D.E."(Desktop Environment) with

Pedro Rosendo 3 Jul 23, 2022
A faster way to navigate your filesystem

zoxide A faster way to navigate your filesystem Table of contents Introduction Examples Getting started Step 1: Install zoxide Step 2: Install fzf (op

Ajeet D'Souza 8.7k Jan 8, 2023
:stars: Manage your shell commands.

Pueue Pueue is a command-line task management tool for sequential and parallel execution of long-running tasks. Simply put, it's a tool that processes

Arne Beer 3.3k Jan 8, 2023
Count your code, quickly.

Tokei (時計) Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code,

null 7.5k Jan 9, 2023
Your project’s nix-env [maintainer=@Profpatsch]

lorri https://github.com/nix-community/lorri lorri is a nix-shell replacement for project development. lorri is based around fast direnv integration f

Nix community projects 442 Jan 1, 2023
📊 Fetch & monitor your server's resource usage through Lua

?? gmsv_serverstat Simple serverside binary module which can expose information about system resource usage to Lua. Installation Download the relevant

William 21 Jul 30, 2022
subd - a place to reward your subscribers from any platform

subd subd's goal is to create a link between the various ways viewers support you as a live content creator, and the interactions that can be triggere

TJ DeVries 37 Jul 6, 2023
A simple overlay for OBS to display consecutive keystrokes. Primarily for programming, especially for Vim.

Keystroke-Display A simple overlay for OBS to display consecutive keystrokes. Primarily for programming, especially for Vim. This will work on Windows

null 7 May 13, 2023
Split text into semantic chunks, up to a desired chunk size. Supports calculating length by characters and tokens

Large language models (LLMs) can be used for many tasks, but often have a limited context size that can be smaller than documents you might want to use. To use documents of larger length, you often have to split your text into chunks to fit within this context size.

Ben Brandt 4 May 8, 2023
A skyline mod that enables manual choosing of desired input latency in Smash Ultimate, compatible with every online mode.

Latency Slider (Definitive Edition) This is a fork of - and an improvement upon - the original "Arena Latency Slider". Unfortunately, upon SSBU updati

null 8 Mar 5, 2024
CLI utility to move (or rename) your files to a new location and redirect all of its symbolic links, to the new path

Move Links CLI utility to move (or rename) your files to a new location and redirect all of its symbolic links, to the new path (or name). Usage execu

Ben Mefteh 18 May 22, 2022
A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.

Pup A command line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the return

SteveLau 11 Aug 17, 2022
Walk an Amazon s3 path hierarchy

s3find A command line utility to walk an Amazon S3 hierarchy. An analog of find for Amazon S3. Distribution Release page distributions Github Release

Andrii Radyk 31 Nov 18, 2022
Fuse filesystem that returns symlinks to executables based on the PATH of the requesting process.

Envfs Fuse filesystem that returns symlinks to executables based on the PATH of the requesting process. This is useful to execute shebangs on NixOS th

Jörg Thalheim 98 Jan 2, 2023
Fast shortest path calculations for Rust

Fast Paths The most famous algorithms used to calculate shortest paths are probably Dijkstra's algorithm and A*. However, shortest path calculation ca

Andi 226 Jan 2, 2023
Add path effects to open glyphs in a UFO file

ufostroker Add path effects to open contours in a UFO file Given a glyph with open contours: You can apply a noodle effect: ufostroker -i Open.ufo -o

Simon Cozens 5 Jun 28, 2021
A small tool to clone git repositories to a standard location, organised by domain name and path.

A small tool to clone git repositories to a standard location, organised by domain name and path. Runs on BSD, Linux, macOS, Windows, and more.

Wesley Moore 68 Dec 19, 2022
🧹 Quick & dirty fuzzy path comparison

?? fuzzypath Quick & dirty fuzzy path comparison Comparison rules ✅ Case insensitive ✅ Backslashes are normalized to forward slashes ✅ Trailing slashe

William 4 May 19, 2022
Explore the WWW and find the shortest path between two HTML documents

explore Find shortest path between two web resources. About I decided to create this project because some day I started to wonder: In how many clicks

Eryk Andrzejewski 1 Apr 10, 2022