m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 07:43:39 -05:00

FZF_DEFAULT_COMMAND

This commit is contained in:
Junegunn Choi
2013-11-02 12:56:43 +09:00
parent 682583e88f
commit 6a9970c98e
3 changed files with 14 additions and 7 deletions

View File

@@ -46,8 +46,8 @@ fzf can be installed as a Ruby gem
gem install fzf
```
However, this is not recommended since the Ruby gem version of fzf takes
slightly longer to start.
It's a bit easier to install and update the script but the Ruby gem version
takes slightly longer to start.
### 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
files (excluding hidden ones).
files excluding hidden ones. (You can override the default command with
`FZF_DEFAULT_COMMAND`)
```sh
vim `fzf`
@@ -156,9 +157,14 @@ fkill() {
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 '"\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