From f0144b06d078743eeec8bab0112f8220f3d70155 Mon Sep 17 00:00:00 2001 From: Mark Milstein Date: Wed, 30 Sep 2015 14:10:58 +0300 Subject: [PATCH] Updated Examples (markdown) --- Examples.md | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/Examples.md b/Examples.md index 0cf6b99..1fe0194 100644 --- a/Examples.md +++ b/Examples.md @@ -56,17 +56,6 @@ cdf() { file=$(fzf +m -q "$1") && dir=$(dirname "$file") && cd "$dir" } ``` -### Changing directory with fasd - -Suggested by [@l4u](https://github.com/l4u): - -```sh -# fj - changing directory with fasd -fj() { - local dir - dir=$(fasd -Rdl | fzf --no-sort +m) && cd "$dir" -} -``` ### Searching file contents @@ -348,7 +337,8 @@ ftpane () { ``` ### v -Inspired by [v](https://github.com/rupa/v). Opens files in ~/.viminfo + +#### Inspired by [v](https://github.com/rupa/v). Opens files in ~/.viminfo ```sh # v - open files in ~/.viminfo @@ -361,10 +351,22 @@ v() { } ``` +#### With [fasd](https://github.com/clvv/fasd). + +Suggested by [@epiloque](https://github.com/epiloque) + +```sh +v() { + local file + file="$(fasd -Rfl "$1" | fzf -1 -0 --no-sort +m)" && vi "${file}" || return 1 +} +``` + ### z -Integration with [z](https://github.com/rupa/z), like normal z when used with -arguments but displays an fzf prompt when used without. +#### Integration with [z](https://github.com/rupa/z). + +like normal z when used with arguments but displays an fzf prompt when used without. ```sh unalias z 2> /dev/null @@ -403,6 +405,17 @@ alias j=z alias jj=zz ``` +#### With [fasd](https://github.com/clvv/fasd). + +Suggested by [@l4u](https://github.com/l4u) and [@epiloque](https://github.com/epiloque) + +```sh +z() { + 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: