m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 07:43:39 -05:00

autojump j() for sh should now support directories with spaces.

agausto
2023-03-23 12:46:04 -05:00
parent 0d76f0d485
commit 0f928103c1

@@ -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