1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

Add jc function, jump to a subdirectory of the current working directory.

Closes #156.
This commit is contained in:
William Ting 2012-12-14 22:58:20 -06:00
parent da69e15efb
commit f0e45478a7
7 changed files with 50 additions and 11 deletions

View File

@ -2,13 +2,18 @@
# Summary of release changes, see commit history for more details: # Summary of release changes, see commit history for more details:
# https://github.com/joelthelion/autojump/commits/master/ # https://github.com/joelthelion/autojump/commits/master/
* Release v21.1: * Release v21.2.0:
- Add `jc` command (jump child). Jumps to a subdirectory of the current
working directory.
* Release v21.1.0:
- install.sh is rewritten to add support for --path and --destdir options, - install.sh is rewritten to add support for --path and --destdir options,
making it easier for package maintainers to install autojump specifically into making it easier for package maintainers to install autojump specifically into
certain locations. Thanks to jjk-jacky for his contributions. certain locations. Thanks to jjk-jacky for his contributions.
* Release v21: * Release v21.0.0:
- New mailing list for developer discussion and announcements: - New mailing list for developer discussion and announcements:
@ -83,7 +88,7 @@
- Miscellaneous refactoring, bug fixes, documentation updates. - Miscellaneous refactoring, bug fixes, documentation updates.
* Release v20: * Release v20.0.0:
- Python versions supported is now v2.7+ and v3.2+ due to rewrite using - Python versions supported is now v2.7+ and v3.2+ due to rewrite using
argparse. argparse.
@ -112,13 +117,13 @@
- Miscellaneous bug fixes. - Miscellaneous bug fixes.
* Release v19: * Release v19.0.0:
- prototype `cp` and `mv` directory tab completion - prototype `cp` and `mv` directory tab completion
- Debian post-installation instructions - Debian post-installation instructions
- minor Mac OS X fixes - minor Mac OS X fixes
* Release v18: * Release v18.0.0:
- add automated version numbering - add automated version numbering
- performance tweaks to reduce filesystem checks - performance tweaks to reduce filesystem checks

View File

@ -6,10 +6,15 @@ autojump - a faster way to navigate your filesystem
SYNOPSIS SYNOPSIS
-------- --------
Jump to a previously visited directory 'foobar': Jump to a previously visited directory that contains 'foo':
j foo j foo
Jump to a previously visited subdirectory of the current working
directory:
jc bar
Show all database entries and their respective key weights: Show all database entries and their respective key weights:
j --stat j --stat

View File

@ -34,7 +34,7 @@ import re
import shutil import shutil
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile
VERSION = 'release-v21.1.4' VERSION = 'release-v21.2.0'
MAX_KEYWEIGHT = 1000 MAX_KEYWEIGHT = 1000
MAX_STORED_PATHS = 1000 MAX_STORED_PATHS = 1000
COMPLETION_SEPARATOR = '__' COMPLETION_SEPARATOR = '__'

View File

@ -75,7 +75,7 @@ function j {
return return
fi fi
new_path="$(autojump $@)" new_path="$(autojump ${@})"
if [ -d "${new_path}" ]; then if [ -d "${new_path}" ]; then
echo -e "\\033[31m${new_path}\\033[0m" echo -e "\\033[31m${new_path}\\033[0m"
cd "${new_path}" cd "${new_path}"
@ -85,3 +85,11 @@ function j {
false false
fi fi
} }
function jc {
if [[ ${@} == -* ]]; then
j ${@}
else
j $(pwd) ${@}
fi
}

View File

@ -42,7 +42,7 @@ function j {
return return
fi fi
local new_path="$(autojump $@)" local new_path="$(autojump ${@})"
if [ -d "${new_path}" ]; then if [ -d "${new_path}" ]; then
echo -e "\\033[31m${new_path}\\033[0m" echo -e "\\033[31m${new_path}\\033[0m"
cd "${new_path}" cd "${new_path}"
@ -52,3 +52,11 @@ function j {
false false
fi fi
} }
function jc {
if [[ ${@} == -* ]]; then
j ${@}
else
j $(pwd) ${@}
fi
}

View File

@ -4,7 +4,7 @@
autojump - a faster way to navigate your filesystem autojump - a faster way to navigate your filesystem
.SS SYNOPSIS .SS SYNOPSIS
.PP .PP
Jump to a previously visited directory \[aq]foobar\[aq]: Jump to a previously visited directory that contains \[aq]foo\[aq]:
.IP .IP
.nf .nf
\f[C] \f[C]
@ -12,6 +12,15 @@ j\ foo
\f[] \f[]
.fi .fi
.PP .PP
Jump to a previously visited subdirectory of the current working
directory:
.IP
.nf
\f[C]
jc\ bar
\f[]
.fi
.PP
Show all database entries and their respective key weights: Show all database entries and their respective key weights:
.IP .IP
.nf .nf

View File

@ -3,10 +3,14 @@
autojump - a faster way to navigate your filesystem autojump - a faster way to navigate your filesystem
## SYNOPSIS ## SYNOPSIS
Jump to a previously visited directory 'foobar': Jump to a previously visited directory that contains 'foo':
j foo j foo
Jump to a previously visited subdirectory of the current working directory:
jc bar
Show all database entries and their respective key weights: Show all database entries and their respective key weights:
j --stat j --stat