mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 16:45:38 -05:00
Updated Examples (markdown)
21
Examples.md
21
Examples.md
@@ -799,6 +799,27 @@ v() {
|
|||||||
|
|
||||||
#### Integration with [zsh-interactive-cd](https://github.com/changyuheng/zsh-interactive-cd).
|
#### Integration with [zsh-interactive-cd](https://github.com/changyuheng/zsh-interactive-cd).
|
||||||
|
|
||||||
|
Like normal cd but opens an interactive navigation window when called with no arguments
|
||||||
|
For ls, use -FG instead of --color=always on osx
|
||||||
|
function cd() {
|
||||||
|
if [[ "$#" != 0 ]]; then
|
||||||
|
builtin cd "$@";
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
while true; do
|
||||||
|
local lsd=$(echo; echo ".." && ls -p | grep '/$' | sed 's;/$;;')
|
||||||
|
local dir="$(echo "$lsd" |
|
||||||
|
fzf --height 40% --reverse --preview '
|
||||||
|
echo -n "$(pwd)/" | sed "s;//;/;";
|
||||||
|
echo {}; echo; nxt="$(echo {})";
|
||||||
|
[[ "$nxt" == "" ]] && echo "Close Navigator" ||
|
||||||
|
ls -p --color=always {}
|
||||||
|
')"
|
||||||
|
[[ ${#dir} != 0 ]] || return 0
|
||||||
|
builtin cd "$dir" &> /dev/null
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
Fish like interactive tab completion for cd in zsh.
|
Fish like interactive tab completion for cd in zsh.
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
Reference in New Issue
Block a user