From 0f928103c1f3cf3a84ff6161cd3f595719f039ef Mon Sep 17 00:00:00 2001 From: agausto <69407729+agausto@users.noreply.github.com> Date: Thu, 23 Mar 2023 12:46:04 -0500 Subject: [PATCH] autojump j() for sh should now support directories with spaces. --- Examples.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples.md b/Examples.md index ac337cd..470d5d8 100644 --- a/Examples.md +++ b/Examples.md @@ -1645,13 +1645,13 @@ like normal autojump when used with arguments but displays an fzf prompt when us ```sh j() { - local preview_cmd="ls {2}" + local preview_cmd="ls {2..}" if command -v exa &> /dev/null; then preview_cmd="exa -l {2}" fi if [[ $# -eq 0 ]]; then - cd "$(autojump -s | sort -k1gr | awk '$1 ~ /[0-9]:/ && $2 ~ /^\// {print $1 " " $2}' | fzf --height 40% --reverse --inline-info --preview "$preview_cmd" --preview-window down:50% | awk '{print $2}')" + cd "$(autojump -s | sort -k1gr | awk -F : '$1 ~ /[0-9]/ && $2 ~ /^\s*\// {print $1 $2}' | fzf --height 40% --reverse --inline-info --preview "$preview_cmd" --preview-window down:50% | awk '{print $2}')" else cd $(autojump $@) fi