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

Handle j -- -foo (for bash and zsh only)

Ref: #310
This commit is contained in:
Daniel Hahler 2014-08-23 03:07:27 +02:00 committed by William Ting
parent e621603e46
commit c0c9398794
3 changed files with 13 additions and 9 deletions

View File

@ -60,7 +60,7 @@ from autojump_utils import sanitize
from autojump_utils import take
from autojump_utils import unico
VERSION = '22.1.1-beta'
VERSION = '22.2.0-beta'
FUZZY_MATCH_THRESHOLD = 0.6
TAB_ENTRIES_COUNT = 9
TAB_SEPARATOR = '__'

View File

@ -54,7 +54,7 @@ esac
# default autojump command
j() {
if [[ ${@} =~ ^-{1,2}.* ]]; then
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@}
return
fi
@ -74,8 +74,9 @@ j() {
# jump to child directory (subdirectory of current path)
jc() {
if [[ ${@} == -* ]]; then
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@}
return
else
j $(pwd) ${@}
fi
@ -84,7 +85,7 @@ jc() {
# open autojump results in file browser
jo() {
if [[ ${@} == -* ]]; then
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@}
return
fi
@ -116,8 +117,9 @@ jo() {
# open autojump results (child directory) in file browser
jco() {
if [[ ${@} == -* ]]; then
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@}
return
else
jo $(pwd) ${@}
fi

View File

@ -44,7 +44,7 @@ chpwd_functions+=autojump_chpwd
# default autojump command
j() {
if [[ ${@} == -* ]]; then
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@}
return
fi
@ -65,8 +65,9 @@ j() {
# jump to child directory (subdirectory of current path)
jc() {
if [[ ${@} == -* ]]; then
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@}
return
else
j $(pwd) ${@}
fi
@ -75,7 +76,7 @@ jc() {
# open autojump results in file browser
jo() {
if [[ ${@} == -* ]]; then
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@}
return
fi
@ -108,8 +109,9 @@ jo() {
# open autojump results (child directory) in file browser
jco() {
if [[ ${@} == -* ]]; then
if [[ ${1} == -* ]] && [[ ${1} != "--" ]]; then
autojump ${@}
return
else
jo $(pwd) ${@}
fi