All Projects → iridakos → Goto

iridakos / Goto

Licence: mit
Alias and navigate to directories with tab completion in Linux

Programming Languages

shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to Goto

pino-caller
🌲 Include call site of pino log messages
Stars: ✭ 35 (-94.99%)
Mutual labels:  productivity, utility
powerlet
⚡️ Chrome Extension to quickly find and run bookmarklets
Stars: ✭ 17 (-97.56%)
Mutual labels:  productivity, utility
goto
Goto - The Good Way to Program
Stars: ✭ 14 (-97.99%)
Mutual labels:  zsh, utility
Dotfiles
Zsh, Karabiner, VS Code, Sublime, Neovim, Nix
Stars: ✭ 634 (-9.17%)
Mutual labels:  productivity, zsh
Resh
Rich Enhanced Shell History - Contextual shell history for zsh and bash
Stars: ✭ 310 (-55.59%)
Mutual labels:  productivity, zsh
DropPoint
Make drag-and-drop easier using DropPoint. Drag content without having to open side-by-side windows
Stars: ✭ 303 (-56.59%)
Mutual labels:  productivity, utility
cdc
☣️ Shell plugin for zsh/bash that allows you to cd to subdirectories of user-defined directories from anywhere, without editing CDPATH.
Stars: ✭ 17 (-97.56%)
Mutual labels:  zsh, productivity
Ohmyzsh
🙃 A delightful community-driven (with 1900+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
Stars: ✭ 138,057 (+19678.94%)
Mutual labels:  productivity, zsh
Thirsty
Reminds you to drink water - on your terminal.
Stars: ✭ 296 (-57.59%)
Mutual labels:  productivity, zsh
vscode-snippet-generator
📜 Generate snippets from code in VSCode
Stars: ✭ 31 (-95.56%)
Mutual labels:  productivity, utility
Zsh Iterm Touchbar
Display feedback of terminal in the 🍏 Touchbar
Stars: ✭ 632 (-9.46%)
Mutual labels:  productivity, zsh
Wd
🚀 Jump to custom directories in zsh
Stars: ✭ 555 (-20.49%)
Mutual labels:  productivity, zsh
linearmouse
🖱 The mouse and trackpad utility for Mac.
Stars: ✭ 1,151 (+64.9%)
Mutual labels:  productivity, utility
flawesome
Productivity Tool
Stars: ✭ 56 (-91.98%)
Mutual labels:  productivity, utility
UnitySettings
Runtime debugging menu (like setting on Android) for Unity.
Stars: ✭ 26 (-96.28%)
Mutual labels:  productivity, utility
vscode-jump
🏃‍♂️ Jump/Select to the Start/End of a word in VSCode
Stars: ✭ 67 (-90.4%)
Mutual labels:  productivity, utility
Ridereceipts
🚕 Simple automation desktop app to download and organize your receipts from Uber/Lyft. Try out our new Ride Receipts PRO !
Stars: ✭ 117 (-83.24%)
Mutual labels:  productivity, utility
Synth Shell
Boost your terminal, script by script
Stars: ✭ 217 (-68.91%)
Mutual labels:  productivity, utility
glitter
Display git status information in your shell prompt
Stars: ✭ 47 (-93.27%)
Mutual labels:  zsh, utility
Dtags
Directory Tags for Lazy Programmers
Stars: ✭ 351 (-49.71%)
Mutual labels:  productivity, zsh

goto

A shell utility allowing users to navigate to aliased directories supporting auto-completion 🐾

Generic badge

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 or zsh prompts with suggestions of the available aliases:

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

Installation

Via script

Clone the repository and run the install script as super user or root:

git clone https://github.com/iridakos/goto.git
cd goto
sudo ./install

Manually

Copy the file goto.sh somewhere in your filesystem and add a line in your .zshrc or .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 .zshrc or .bashrc file:

source ~/goto.sh

macOS - Homebrew

A formula named goto is available for the bash shell in macOS.

brew install goto

Add colored output

echo -e "\$include /etc/inputrc\nset colored-completion-prefix on" >> ~/.inputrc

Note:

  • you need to restart your shell after installation
  • you need to have the bash completion feature enabled for bash in macOS (see this issue):
    • you can install it with brew install bash-completion in case you don't have it already

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 the shell.

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

Expand an alias

To expand an alias to its value, use:

goto -x <alias>

or

goto --expand <alias>

Example

goto -x last_release

or

goto --expand last_release

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

Version

To view the tool's version, use:

goto -v

or

goto --version

Extras

Push before changing directories

To first push the current directory onto the directory stack before changing directories, type:

goto -p <alias>

or

goto --push <alias>

Revert to a pushed directory

To return to a pushed directory, type:

goto -o

or

goto --pop

Notes

This command is equivalent to popd, but within the goto command.

Troubleshooting

Updating from 1.x to 2.x

From version 2.x and after, the goto DB file is located in the $XDG_CONFIG_HOME or in the ~/.config directory under the name goto.

If you updated from version 1.x to 2.x or newer, you need to move this file which was previously located at ~/.goto.

Note that the new file is not hidden, it does not start with a dot .

zsh

command not found: compdef

In case you get such an error, you need to load the bashcompinit. Append this to your .zshrc file:

autoload bashcompinit
bashcompinit

TODO

  • Test on macOS extensively
  • 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. Make sure that the script does not have errors or warning on ShellCheck
  6. Create a new Pull Request

License

This tool is open source under the MIT License terms.

[Back To Top]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].