1
0
mirror of https://github.com/wting/autojump synced 2026-03-02 03:49:26 +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

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

View File

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

View File

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