diff --git a/Examples.md b/Examples.md index 2d2d542..b03dc39 100644 --- a/Examples.md +++ b/Examples.md @@ -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: