mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-17 15:53:39 -05:00
Fish shell support - installer / key bindings (#33)
This commit is contained in:
35
README.md
35
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
|
||||
|
||||
Reference in New Issue
Block a user