FZF_DEFAULT_COMMAND

pull/4/head
Junegunn Choi 11 years ago
parent 682583e88f
commit 6a9970c98e

@ -46,8 +46,8 @@ fzf can be installed as a Ruby gem
gem install fzf gem install fzf
``` ```
However, this is not recommended since the Ruby gem version of fzf takes It's a bit easier to install and update the script but the Ruby gem version
slightly longer to start. takes slightly longer to start.
### Install as Vim plugin ### Install as Vim plugin
@ -87,7 +87,8 @@ find * -type f | fzf > selected
``` ```
Without STDIN pipe, fzf will use find command to fetch the list of Without STDIN pipe, fzf will use find command to fetch the list of
files (excluding hidden ones). files excluding hidden ones. (You can override the default command with
`FZF_DEFAULT_COMMAND`)
```sh ```sh
vim `fzf` vim `fzf`
@ -156,9 +157,14 @@ fkill() {
ps -ef | sed 1d | fzf | awk '{print $2}' | xargs kill -${1:-9} ps -ef | sed 1d | fzf | awk '{print $2}' | xargs kill -${1:-9}
} }
# CTRL-T - Open fuzzy finder and paste the selected item to the command line # Assuming you don't use the default CTRL-T and CTRL-R
# CTRL-T - Paste the selected file path into the command line
bind '"\er": redraw-current-line' bind '"\er": redraw-current-line'
bind '"\C-t": " \C-u \C-a\C-k$(fzf)\e\C-e\C-y\C-a\C-y\ey\C-h\C-e\er"' bind '"\C-t": " \C-u \C-a\C-k$(fzf)\e\C-e\C-y\C-a\C-y\ey\C-h\C-e\er"'
# CTRL-R - Paste the selected command from history into the command line
bind '"\C-r": " \C-e\C-u$(history | fzf +s | sed \"s/ *[0-9]* *//\")\e\C-e\er"'
``` ```
License License

5
fzf

@ -10,7 +10,7 @@
# URL: https://github.com/junegunn/fzf # URL: https://github.com/junegunn/fzf
# Author: Junegunn Choi # Author: Junegunn Choi
# License: MIT # License: MIT
# Last update: October 29, 2013 # Last update: November 2, 2013
# #
# Copyright (c) 2013 Junegunn Choi # Copyright (c) 2013 Junegunn Choi
# #
@ -269,7 +269,8 @@ end
@read = @read =
if $stdin.tty? if $stdin.tty?
if !`which find`.empty? if !`which find`.empty?
IO.popen("find * -path '*/\\.*' -prune -o -type f -print -o -type l -print 2> /dev/null") IO.popen(ENV.fetch('FZF_DEFAULT_COMMAND',
"find * -path '*/\\.*' -prune -o -type f -print -o -type l -print 2> /dev/null"))
else else
exit 1 exit 1
end end

@ -1,7 +1,7 @@
# coding: utf-8 # coding: utf-8
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.name = 'fzf' spec.name = 'fzf'
spec.version = '0.1.1' spec.version = '0.1.2'
spec.authors = ['Junegunn Choi'] spec.authors = ['Junegunn Choi']
spec.email = ['junegunn.c@gmail.com'] spec.email = ['junegunn.c@gmail.com']
spec.description = %q{Fuzzy finder for your shell} spec.description = %q{Fuzzy finder for your shell}

Loading…
Cancel
Save