Update README
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Junegunn Choi · committed by Junegunn Choi · parent 5e120e7 · Browse files · 1 file·+14 added−73 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+14 added−73 removed
- other:+14 added−73 removed
Provenance
- Commit
3b84c80- Tree
4f54a5a- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
5e120e7
1 file changed+14 added−73 removed
modified:README.md+14 added-73 removed
43 unmodified lines44 git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf45 ~/.fzf/install46 ```47 48-#### Using curl49-50-In case you don't have git installed:51-52-```sh53-mkdir -p ~/.fzf54-curl -L https://github.com/junegunn/fzf/archive/master.tar.gz |55- tar xz --strip-components 1 -C ~/.fzf56-~/.fzf/install57-```58-48 #### Using Homebrew49 50 On OS X, you can use [Homebrew](http://brew.sh/) to install fzf.51 93 unmodified lines145 - Sort is disabled by default to respect chronological ordering146 - Press `CTRL-R` again to toggle sort147 - `ALT-C` - cd into the selected directory148 160-If you're on a tmux session, `CTRL-T` will launch fzf in a new split-window. You161-may disable this tmux integration by setting `FZF_TMUX` to 0, or change the162-height of the window with `FZF_TMUX_HEIGHT` (e.g. `20`, `50%`).149+If you're on a tmux session, fzf will start in a split pane. You may disable150+this tmux integration by setting `FZF_TMUX` to 0, or change the height of the151+pane with `FZF_TMUX_HEIGHT` (e.g. `20`, `50%`).152 153 If you use vi mode on bash, you need to add `set -o vi` *before* `source154 ~/.fzf.bash` in your .bashrc, so that it correctly sets up key bindings for vi155 mode.156 168-If you want to customize the key bindings, consider editing the169-installer-generated source code: `~/.fzf.bash`, `~/.fzf.zsh`, and170-`~/.config/fish/functions/fzf_key_bindings.fish`.171-157 `fzf-tmux` script158 -----------------159 160 [fzf-tmux](bin/fzf-tmux) is a bash script that opens fzf in a tmux pane.109 unmodified lines270 `CTRL-T`, `CTRL-X` or `CTRL-V` to open selected files in the current window,271 in new tabs, in horizontal splits, or in vertical splits respectively.272 273 Note that the environment variables `FZF_DEFAULT_COMMAND` and289-`FZF_DEFAULT_OPTS` also apply here. Refer to [the wiki page][vim-examples] for274+`FZF_DEFAULT_OPTS` also apply here. Refer to [the wiki page][fzf-config] for275 customization.276 292-[vim-examples]: https://github.com/junegunn/fzf/wiki/Examples-(vim)277+[fzf-config]: https://github.com/junegunn/fzf/wiki/Configuring-FZF-command-(vim)278 279 #### `fzf#run([options])`280 281 For more advanced uses, you can call `fzf#run()` function which returns the list77 unmodified lines359 360 #### Articles361 362 - [fzf+vim+tmux](http://junegunn.kr/2014/04/fzf+vim+tmux)363+- [Browsing git commits with fzf](http://junegunn.kr/2015/03/browsing-git-commits-with-fzf/)364+- [Browsing Chrome history with fzf](http://junegunn.kr/2015/04/browsing-chrome-history-with-fzf/)365+- [Browsing Chrome bookmarks with fzf](http://junegunn.kr/2015/04/browsing-chrome-bookmarks-with-fzf/)366 367 Tips368 ----369 1 unmodified line371 372 If you have any rendering issues, check the followings:373 374 1. Make sure `$TERM` is correctly set. fzf will use 256-color only if it387- contains `256` (e.g. `xterm-256color`)375+ contains `256` (e.g. `xterm-256color`)376 2. If you're on screen or tmux, `$TERM` should be either `screen` or389- `screen-256color`377+ `screen-256color`378 3. Some terminal emulators (e.g. mintty) have problem displaying default391- background color and make some text unable to read. In that case, try `--black`392- option. And if it solves your problem, I recommend including it in393- `FZF_DEFAULT_OPTS` for further convenience.379+ background color and make some text unable to read. In that case, try380+ `--black` option. And if it solves your problem, I recommend including it381+ in `FZF_DEFAULT_OPTS` for further convenience.382 4. If you still have problem, try `--no-256` option or even `--no-color`.383 384 #### Respecting `.gitignore`, `.hgignore`, and `svn:ignore`385 22 unmodified lines408 (git ls-tree -r --name-only HEAD ||409 find * -name ".*" -prune -o -type f -print -o -type l -print) 2> /dev/null'410 ```411 424-#### Using fzf with tmux panes425-426-The supplied [fzf-tmux](bin/fzf-tmux) script should suffice in most of the427-cases, but if you want to be able to update command line like the default428-`CTRL-T` key binding, you'll have to use `send-keys` command of tmux. The429-following example will show you how it can be done.430-431-```sh432-# This is a helper function that splits the current pane to start the given433-# command ($1) and sends its output back to the original pane with any number of434-# optional keys (shift; $*).435-fzf_tmux_helper() {436- [ -n "$TMUX_PANE" ] || return437- local cmd=$1438- shift439- tmux split-window -p 40 \440- "bash -c \"\$(tmux send-keys -t $TMUX_PANE \"\$(source ~/.fzf.bash; $cmd)\" $*)\""441-}442-443-# This is the function we are going to run in the split pane.444-# - "find" to list the directories445-# - "sed" will escape spaces in the paths.446-# - "paste" will join the selected paths into a single line447-fzf_tmux_dir() {448- fzf_tmux_helper \449- 'find * -path "*/\.*" -prune -o -type d -print 2> /dev/null |450- fzf --multi |451- sed "s/ /\\\\ /g" |452- paste -sd" " -' Space453-}454-455-# Bind CTRL-X-CTRL-D to fzf_tmux_dir456-bind '"\C-x\C-d": "$(fzf_tmux_dir)\e\C-e"'457-```458-412 #### Fish shell413 414 It's [a known bug of fish](https://github.com/fish-shell/fish-shell/issues/1362)415 that it doesn't allow reading from STDIN in command substitution, which means416 simple `vim (fzf)` won't work as expected. The workaround is to store the result417 of fzf to a temporary file.418 419 ```sh467-function vimf468- if fzf > $TMPDIR/fzf.result469- vim (cat $TMPDIR/fzf.result)470- end471-end472-473-function fe474- set tmp $TMPDIR/fzf.result475- fzf --query="$argv[1]" --select-1 --exit-0 > $tmp476- if [ (cat $tmp | wc -l) -gt 0 ]477- vim (cat $tmp)478- end479-end420+fzf > $TMPDIR/fzf.result; and vim (cat $TMPDIR/fzf.result)421 ```422 423 #### Handling UTF-8 NFD paths on OSX424 15 unmodified lines