Skip to content

Commit

Permalink
add man page, update README to sync with it.
Browse files Browse the repository at this point in the history
  • Loading branch information
rupa committed Feb 23, 2011
1 parent 107fa3e commit 30d6eb1
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 34 deletions.
112 changes: 78 additions & 34 deletions README
Original file line number Diff line number Diff line change
@@ -1,34 +1,78 @@
z is the new j

First, there was j: http://github.com/rupa/j/.

Then, there was j2: http://github.com/rupa/j2/, with some python added. Made
it easier to experiment with some stuff I'd been thinking about.

Now there's this, where I rewrote j2 back in bash. I like it. Sorry about all
the repos , but it kind of grew this way.

The biggest change from j is the use of 'frecency' for weighting. Directories
that have low ranking but were accessed recently, will quickly have higher rank.

The -r switch preserves the old behavior.

# maintains a jump-list of the directories you actually use
#
# INSTALL:
# * put something like this in your .bashrc:
# . /path/to/z.sh
# * put something like this in your .zshrc:
# . /path/to/z.sh
# function precmd () {
# z --add "$(pwd -P)"
# }
# * cd around for a while to build up the db
# * PROFIT!!
#
# USE:
# * z foo # cd to most frecent dir matching foo
# * z foo bar # cd to most frecent dir matching foo and bar
# * z -r foo # cd to highest ranked dir matching foo
# * z -t foo # cd to most recently accessed dir matching foo
# * z -l foo # list all dirs matching foo (by frecency)
Z(1) User Commands Z(1)



NAME
z - jump around


SYNOPSIS
z [-h] [-l] [-r] [-t] [regex1 regex2 ... regexn]


AVAILABILITY
bash, zsh


DESCRIPTION
Tracks your most used directories, based on 'frecency'.

After a short learning phase, z will take you to the most 'frecent'
directory that matches ALL of the regexes given on the command line.


OPTIONS
-h show a brief help message
-l list only
-r match by rank only
-t match by recent access only


EXAMPLES
z foo cd to most frecent dir matching foo
z foo bar cd to most frecent dir matching foo and bar
z -r foo cd to highest ranked dir matching foo
z -t foo cd to most recently accessed dir matching foo
z -l foo list all dirs matching foo (by frecency)


NOTES
Installation:

put something like this in your $HOME/.bashrc:

. /path/to/z.sh

put something like this in your $HOME/.zshrc:

. /path/to/z.sh
function precmd () {
z --add "$(pwd -P)"
}

cd around for a while to build up the db.
PROFIT!!

Frecency:

Frecency is a portmantaeu of 'recent' and 'frequency'. It is a weighted
rank that depends on 'how often' and 'how recently' something occured.
As far as I know, Mozilla came up with the term.

In z, a directory that has low ranking but has been accessed recently
will quickly have higher rank than a directory accessed frequently a
long time ago.


FILES
data is stored in $HOME/.z


SEE ALSO
regex(7), cdargs, pushd, popd, autojump, cdargs

Please file bugs at https://github.com/rupa/z/



z February 2011 Z(1)
73 changes: 73 additions & 0 deletions z.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
.TH Z "1" "February 2011" "z" "User Commands"

.SH NAME
z \- jump around

.SH SYNOPSIS
z [\-h] [\-l] [\-r] [\-t] [regex1 regex2 ... regexn]

.SH AVAILABILITY
bash, zsh

.SH DESCRIPTION
Tracks your most used directories, based on 'frecency'.
.P
After a short learning phase, \fBz\fR will take you to the most 'frecent'
directory that matches ALL of the regexes given on the command line.

.SH OPTIONS
\fB\-h\fR show a brief help message
.br
\fB\-l\fR list only
.br
\fB\-r\fR match by rank only
.br
\fB\-t\fR match by recent access only

.SH EXAMPLES
\fBz foo\fR cd to most frecent dir matching foo
.br
\fBz foo bar\fR cd to most frecent dir matching foo and bar
.br
\fBz -r foo\fR cd to highest ranked dir matching foo
.br
\fBz -t foo\fR cd to most recently accessed dir matching foo
.br
\fBz -l foo\fR list all dirs matching foo (by frecency)

.SH NOTES

\fBInstallation:\fR
.P
put something like this in your $HOME/.bashrc:
.P
. /path/to/z.sh
.P
put something like this in your $HOME/.zshrc:
.P
. /path/to/z.sh
function precmd () {
z --add "$(pwd -P)"
}
.P
cd around for a while to build up the db.
.br
PROFIT!!

\fBFrecency:\fR
.P
Frecency is a portmantaeu of 'recent' and 'frequency'. It is a weighted rank
that depends on 'how often' and 'how recently' something occured. As far as I
know, Mozilla came up with the term.
.P
In \fBz\fR, a directory that has low ranking but has been accessed recently
will quickly have higher rank than a directory accessed frequently a long time
ago.

.SH FILES
data is stored in \fB$HOME/.z\fR

.SH SEE ALSO
regex(7), cdargs, pushd, popd, autojump, cdargs
.P
Please file bugs at https://github.com/rupa/z/

0 comments on commit 30d6eb1

Please sign in to comment.