m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 08:13:40 -05:00

Updated Examples (markdown)

Mazin Bokhari
2017-07-12 22:43:29 -07:00
parent f0caedc213
commit 6fac7bc191

@@ -515,6 +515,16 @@ v() {
}
```
Suggested by [@mazinbokhari](https://github.com/mazinbokhari/dotfiles)
```
# fasd & fzf change directory - open best matched file using `fasd` if given argument, filter output of `fasd` using `fzf` else
v() {
[ $# -gt 0 ] && fasd -f -e ${EDITOR} "$*" && return
local file
file="$(fasd -Rfl "$1" | fzf -1 -0 --no-sort +m)" && vi "${file}" || return 1
}
```
### cd
#### Integration with [zsh-interactive-cd](https://github.com/changyuheng/zsh-interactive-cd).
@@ -580,6 +590,17 @@ z() {
}
```
Suggested by [@mazinbokhari](https://github.com/mazinbokhari/dotfiles)
```
# fasd & fzf change directory - jump using `fasd` if given argument, filter output of `fasd` using `fzf` else
z() {
[ $# -gt 0 ] && fasd_cd -d "$*" && return
local dir
dir="$(fasd -Rdl "$1" | fzf -1 -0 --no-sort +m)" && cd "${dir}" || return 1
}
```
### Shell bookmarks
Yet another useful application for `fzf`: shell bookmarks. It looks as follows: