Giter Club home page Giter Club logo

gt's Introduction

gt - fast directory jumping

With gt (go to), fly in the terminal, with completion.

Example

gt-gif

> article % gt add belief
Alias 'belief' successfully added.
> article % gt
belief   ->  /Users/gsprd/Documents/phd/work/belief/article
des      ->  /Users/gsprd/Desktop
dot      ->  /Users/gsprd/.dotfiles
exam     ->  /Users/gsprd/Documents/phd/teaching/info/exam
gt       ->  /Users/gsprd/Documents/projects/gt
> article % gt remove exam
Alias 'exam' successfully removed.

Usage

  • List aliases with gt or gt show.
  • Add alias to the current directory with gt add ALIAS.
  • Jump to this directory with gt ALIAS.
  • Remove an alias with gt remove ALIAS.
  • Update an alias to the current directory with gt update ALIAS.
  • Rename an alias with gt rename ALIAS ALIAS.
  • Open your file browser to an alias with gt open ALIAS.
  • Remove all broken aliases with gt clean.
> gt -h
Usage: gt [-h/--help]
Usage: gt show [ALIAS]

Usage: gt add ALIAS
Usage: gt remove ALIAS
Usage: gt update ALIAS
Usage: gt rename ALIAS ALIAS
Usage: gt open ALIAS
Usage: gt clean

Usage: gt [-t/--tmux] [-c/--current] ALIAS
Usage: gt config KEY [VALUE]

Tmux users

Start, switch and attach tmux sessions seamlessly by switching tmux on

gt config tmux on

Now, gt ALIAS joins a named tmux session directly at the directory pointed by ALIAS. It attaches if the session already exists!

You can force stay outside of tmux, or in the current tmux session, with the -c flag

gt -c ALIAS

Similarly, when tmux is configured to off, you can force join a tmux session with the -t flag

gt -t ALIAS

When you changed directory within tmux, you can go back to the base directory with

gt .

Installation

Download the executable with

mkdir -p ~/.config/gt
curl https://raw.githubusercontent.com/glambrechts/gt/main/gt > ~/.config/gt/.gt

Create the command by adding the following alias to your ~/.bashrc / ~/.zshrc.

alias gt='source ~/.config/gt/.gt'

Setup completion in zsh with

compdef '_files -W "/Users/gsprd/.config/gt"' .gt

or in bash with

_gt() {
    local cur files
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    files=$(ls ~/.config/gt)
    COMPREPLY=( $(compgen -W "${files}" -- ${cur}) )
}
complete -F _gt gt

gt's People

Contributors

glambrechts avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.