GitXplorerGitXplorer
g

goto-tool

public
7 stars
4 forks
0 issues

Commits

List of commits on branch master.
Unverified
cac67449b1bf46f7a21b8465f7ecdd7ef3990850

Fix path resolving in subshells

committed 8 years ago
Unverified
90254262b9ca94a645ff4aa8b1fdfe36be9f2e91

Sourcing is now all you need to do

committed 8 years ago
Unverified
d614c7c2acdd9c4c26c35817c66c3aa4f403a306

Python 3 compatibility

committed 8 years ago
Unverified
df38435b1e9810fdbcdb430a44d9d13857b16709

Path argument is optional

committed 10 years ago
Unverified
8780de1b2f06d707e4b0f243894913935fdbf803

_directories is called _files now

committed 10 years ago
Unverified
643d59336db81e1397dc9c1ac7f79377f6d8847c

Version 3.3.1

committed 10 years ago

README

The README file for this repository.

goto myproject

Associates your favourite long filesystem paths with short names and makes it easy for you to go to them.

Examples

Add a path:

~$ goto-tool add project /my/very/long/path/to/my/project
Entry 'project' added, points to '/my/very/long/path/to/my/project'.
~$

Go to the path:

~$ goto project
/my/very/long/path/to/my/project$ ls
...

Go to a directory relative to the path:

~$ goto project subdir/anotherSubdir
/my/very/long/path/to/my/project/subdir/anotherSubdir$ ls
...

Removing entries:

~$ goto-tool rm project
Entry 'project' removed.

~$ goto project
Entry 'project' not found.

Listing entries:

~$ goto-tool list
ubin: /usr/bin

Using goto directories with other commands:

~$ ls "$(goget project)"
... contents of project directory ...

~$ gorun vim project foo/bar.c
... editing file foo/bar.c in projects directory ...

Installation

Clone this repository into a folder of your choosing, e.g.

cd ~/.local/
git clone https://github.com/githubnemo/goto-tool.git

Then proceed and configure your shell as described below.

Bash

Add the following line at the end of your configuration file, for example ~/.bashrc, to include the goto.bash file in your configuration:

source ~/.local/goto-tool/goto.bash

That's all. Now you're able to use the goto command as shown in the Examples section.

If you want tab completion for the goto and the goto-tools command, include the goto.completion file in your ~/.bashrc or ~/.bash_completion on debian/ubuntu like this:

source ~/.local/goto-tool/goto.completion

Note: you need bash_completion for tab completion to work.

Ubuntu/Debian users have it already.

For Mac OS X, you can find a detailled installation guide here.

ZSH

Add the following line at the end of your configuration file, for example ~/.zshrc, to include the goto.bash file in your configuration:

source ~/.local/goto/goto.bash

To add tab completion support, you may want to add the zsh_completions directory to the fpath in your .zshrc. For example:

fpath=(~/.local/goto-tool/zsh_completions $fpath)

Caveats

There is not much that can go wrong. The only thing that may bug you is that there does not seem to be a way to use goget comfortably in your shell. The reason for this is that whitespaces don't mix well with subshell commands.

This won't work:

$ goto-tool add foo '/foo/bar baz/'
$ ls $(goget foo)

This works:

$ ls "$(goget foo)"

In most cases it is quicker to use gorun to achieve the same:

$ gorun ls foo