From e70b972d3034c807048eb763ede23689d4395abb Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 4 Jul 2014 02:47:05 -0700 Subject: [PATCH] Updated examples (markdown) --- examples.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/examples.md b/examples.md index 68e99a7..d78c8a1 100644 --- a/examples.md +++ b/examples.md @@ -1,8 +1,8 @@ -Useful examples -=============== - Feel free to edit this page if you have a nice example of using fzf. +Shell scripts +============= + Opening files ------------- @@ -15,6 +15,13 @@ fe() { file=$(fzf --query="$1" --select-1 --exit-0) [ -n "$file" ] && ${EDITOR:-vim} "$file" } + +# Equivalent to above, but opens it with `open` command +fo() { + local file + file=$(fzf --query="$1" --select-1 --exit-0) + [ -n "$file" ] && open "$file" +} ``` Changing directory @@ -101,8 +108,8 @@ fco() { } ``` -ctags ------ +Tags +---- ```sh # ftags - search ctags @@ -132,18 +139,12 @@ fs() { } ``` -open files ----- -```sh -fo() { - local file - file=$(fzf --query="$1" --select-1 --exit-0) - [ -n "$file" ] && open "$file" -} -``` +Vim scripts +=========== -narrow ag results within vim + +Narrow ag results within vim ---- add this to your .vimrc