summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2014-05-02 11:27:32 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2014-05-02 11:27:32 +0900
commit7d15071c63a4107197f7725834f0f75a6f054a4c (patch)
treea630bbfd4109c999c1eb2f11eb4f711e85e0a42b /README.md
parent89eb1575e7f29d94a04a4045dcae688a25cddd1f (diff)
Fish shell support - installer / key bindings (#33)
Diffstat (limited to 'README.md')
-rw-r--r--README.md35
1 files changed, 29 insertions, 6 deletions
diff --git a/README.md b/README.md
index d9959e8b..e47b26ff 100644
--- a/README.md
+++ b/README.md
@@ -35,13 +35,13 @@ curl -L https://github.com/junegunn/fzf/archive/master.tar.gz |
The script will setup:
-- `fzf` executable
-- Key bindings (`CTRL-T`, `CTRL-R`, and `ALT-C`) for bash and zsh
-- Fuzzy auto-completion for bash
+- `fzf` function (bash, zsh, fish)
+- Key bindings (`CTRL-T`, `CTRL-R`, and `ALT-C`) (bash, zsh, fish)
+- Fuzzy auto-completion (bash)
-If you don't use bash or zsh, you have to manually place fzf executable in a
-directory included in `$PATH`. Key bindings and auto-completion will not be
-available in that case.
+If you don't use any of the aforementioned shells, you have to manually place
+fzf executable in a directory included in `$PATH`. Key bindings and
+auto-completion will not be available in that case.
### Install as Vim plugin
@@ -458,6 +458,29 @@ export FZF_DEFAULT_COMMAND='ag -l -g ""'
fzf
```
+### Fish shell
+
+It's [a known bug of fish](https://github.com/fish-shell/fish-shell/issues/1362)
+that it doesn't allow reading from STDIN in command substitution, which means
+simple `vim (fzf)` won't work as expected. The workaround is to store the result
+of fzf to a temporary file.
+
+```sh
+function vimf
+ if fzf > $TMPDIR/fzf.result
+ vim (cat $TMPDIR/fzf.result)
+ end
+end
+
+function fe
+ set tmp $TMPDIR/fzf.result
+ fzf --query="$argv[1]" --select-1 --exit-0 > $tmp
+ if [ (cat $tmp | wc -l) -gt 0 ]
+ vim (cat $tmp)
+ end
+end
+```
+
### Windows
fzf works on [Cygwin](http://www.cygwin.com/) and