mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-17 15:53:39 -05:00
autojump j() for sh should now support directories with spaces.
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user