GithubHelp home page GithubHelp logo

jihadxtn / goto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iridakos/goto

0.0 1.0 0.0 2.99 MB

A bash utility to quickly navigate to aliased directories supporting auto-completion :feet:

License: MIT License

Shell 100.00%

goto's Introduction

goto

goto is a bash utility allowing users to change faster to aliased directories supporting auto-completion ๐Ÿพ

How does it work?

User registers directory aliases, for example:

goto -r dev /home/iridakos/development

and then cds to that directory with:

goto dev

goto demo gif

goto completion

goto comes with a nice auto-completion script so that whenever you press the tab key after the goto command, bash prompts with suggestions of the available aliases:

$ goto <tab>
bc /etc/bash_completion.d                     
dev /home/iridakos/development
rubies /home/iridakos/.rvm/rubies

Installation

Copy the file goto.bash somewhere in your filesystem and add a line in your .bashrc to source it.

For example, if you placed the file in your home folder, all you have to do is add the following line to your .bashrc file:

source ~/goto.bash

Usage

Change to an aliased directory

To change to an aliased directory, type:

goto <alias>

Example:

goto dev

Register an alias

To register a directory alias, type:

goto -r <alias> <directory>

or

goto --register <alias> <directory>

Example:

goto -r blog /mnt/external/projects/html/blog

or

goto --register blog /mnt/external/projects/html/blog

Notes

  • goto expands the directories hence you can easily alias your current directory with:
goto -r last_release .

and it will automatically be aliased to the whole path.

  • Pressing the tab key after the alias name, you have the default directory suggestions by bash.

Unregister an alias

To unregister an alias, use:

goto -u <alias>

or

goto --unregister <alias>

Example

goto -u last_release

or

goto --unregister last_release

Notes

Pressing the tab key after the command (-u or --unregister), the completion script will prompt you with the list of registered aliases for your convenience.

List aliases

To get the list of your currently registered aliases, use:

goto -l

or

goto --list

Cleanup

To cleanup the aliases from directories that are no longer accessible in your filesystem, use:

goto -c

or

goto --cleanup

Help

To view the tool's help information, use:

goto -h

or

goto --help

TODO

  • Test on macOS extensively
  • Test in zsh
  • Write tests

Contributing

  1. Fork it ( https://github.com/iridakos/goto/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

This tool is open source under the MIT License terms.

goto's People

Contributors

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