tiernacity / linky

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why?
----
Linky maintains a list of links that store directory paths for you. It gives you commands to easily change directory
to the path you stored in a link - and to add, remove and examine your links. There are also a couple of aliases for
pushd and popd.

Use it to quickly jump to some directory that you often have to visit, but that has a long path that's a pain to type out.

You even get tab-completion!

To install
----------
There's a file in this directory called .linky. Copy it to your home directory (or just use it from here) and source
in your .bashrc by adding this line:

  [ -f ~/.linky ] && . ~/.linky

Start a new shell.

Note: On Mac OSX, read something like this first: https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/

Quick start
-----------

$ # record a couple of new links
$ cd /some/long/path/thats/a/pain/to/type/and/remember
$ red foo
$ cd /some/new/path
$ red bar

$ # We can look at our links
$ lsd
[bar] /some/new/path
[foo] /some/long/path/thats/a/pain/to/type/and/remember

$ # Let's go home for a moment
$ cd ; pwd
/home/me

$ # We can use our links to change paths
$ cdd foo ; pwd 
/some/long/path/thats/a/pain/to/type/and/remember

$ # We can use our links with the directory stack
$ tod bar ; pwd 
/some/new/path
$ ot ; pwd 
/some/long/path/thats/a/pain/to/type/and/remember


To use
------
You get these shortcuts for using the regular bash directory stack:

to [path]
- perform a silent pushd. Change to the supplied directory by pushing its path onto the directory
stack. This command takes a regular path (not a link name) - it's just pushd under the hood

ot
- perform a silent popd. Change to a new directory by popping the directory stack, then changing to
the path at the top of the stack. This is just popd under the hood


You get these commands for keeping/using links:

red [link name]
- "record directory". Record the current working directory under a new link name, or the name "default".

rmd [link name]
- "remove directory". Remove the link stored under the name, or the name "default".

cdd [link name]
- change directory to the link stored under the name name, or the name "default".

tod [link name]
- change directory to the link stored under the name, or the name "default", by using pushd to push
onto the directory stack. Hint: you can use "ot" or "popd" to return back to the previous path.

pwdd [link name]
- print the path stored under link name, or the name "default"

lsd
- List the stored links (and their paths) on stdout.


Notes:
If you omit the link name, most of the above commands default to a link called "default".
Most of the commands tab-complete against the current list of link names.
All of the links are kept as regular symlinks in a directory called ~/linky, so you can acces them there also if you need to.

About