Code Monkey home page Code Monkey logo

fzf-1's Introduction

Fzf

Integrate fzf functionality into fish! Includes handy functions to do the following using fzf

  • command tab completion
  • search command history
  • find and cd into sub-directories
  • find and open files

All functions

  • are lazily-loaded to keep shell startup time down
  • have preset but configurable key bindings

Heavily adapted from @hauleth's PR.

Note that the fzf utility has its own out-of-the-box fish package. What sets this package apart is that it has a couple more integrations, most notably tab completion, and will probably be updated more frequently. They are not compatible so either use one or the other.

Installation

With fisher

fisher add jethrokuan/fzf

With oh-my-fish

omf install https://github.com/jethrokuan/fzf

Requirements

About the fzf binary

This package will fail if the fzf binary is not detected in your PATH.

See the fzf documentation for instructions to install fzf on your system.

Usage

Legacy New Keybindings Remarks
Ctrl-t Ctrl-o Find a file.
Ctrl-r Ctrl-r Search through command history.
Alt-c Alt-c cd into sub-directories (recursively searched).
Alt-Shift-c Alt-Shift-c cd into sub-directories, including hidden ones.
Ctrl-o Alt-o Open a file/dir using default editor ($EDITOR)
Ctrl-g Alt-Shift-o Open a file/dir using xdg-open or open command

Legacy keybindings are kept by default, but these have conflict with keybindings in fish 2.4.0. If you want to use the new keybindings, enter the following into your terminal:

set -U FZF_LEGACY_KEYBINDINGS 0

NOTE: On OS X, Alt-c (Option-c) types รง by default. In iTerm2, you can send the right escape sequence with Esc-c. If you configure the option key to act as +Esc (iTerm2 Preferences > Profiles > Default > Keys > Left option (โŒฅ) acts as: > +Esc), then alt-c will work for fzf as documented.

Commands

Variable Remarks Example
FZF_FIND_FILE_COMMAND Modify the command used to generate the list of files set -U FZF_FIND_FILE_COMMAND "ag -l --hidden --ignore .git . \$dir 2> /dev/null" or set -U FZF_FIND_FILE_COMMAND "fd --type f . \$dir" ($dir represents the directory being completed)
FZF_CD_COMMAND Similar to ^ Similar to ^
FZF_CD_WITH_HIDDEN_COMMAND Similar to ^ Similar to ^
FZF_OPEN_COMMAND Similar to ^ Similar to ^
FZF_PREVIEW_FILE_CMD Modify the command used to generate preview of files. set -U FZF_PREVIEW_FILE_CMD "head -n 10"
FZF_PREVIEW_DIR_CMD Modify the command used to generate preview of directories. set -U FZF_PREVIEW_DIR_CMD "ls"

Variables

Variable Remarks Example
FZF_DEFAULT_OPTS Default options passed to every fzf command set -U FZF_DEFAULT_OPTS "--height 40"
FZF_FIND_FILE_OPTS Pass in additional arguments to the fzf command for find file set -U FZF_FIND_FILE_OPTS "--reverse --inline-info"
FZF_CD_OPTS Similar to ^ Similar to ^
FZF_CD_WITH_HIDDEN_OPTS Similar to ^ Similar to ^
FZF_REVERSE_ISEARCH_OPTS Similar to ^ Similar to ^
FZF_OPEN_OPTS Similar to ^ Similar to ^
FZF_COMPLETE_OPTS Similar to ^ Similar to ^
FZF_TMUX Runs a tmux-friendly version of fzf instead. set -U FZF_TMUX 1
FZF_ENABLE_OPEN_PREVIEW Enable preview window open command. set -U FZF_ENABLE_OPEN_PREVIEW 1

FZF Tab Completions

This package ships with a fzf widget for fancy tab completions. Please see the wiki page for details.

License

fzf is MIT licensed. See the LICENSE for details.

fzf-1's People

Contributors

arbuztw avatar asymmetric avatar brettm12345 avatar cariandrum22 avatar carlosdagos avatar cjbassi avatar cormacrelf avatar danielschemmel avatar dfrommi avatar dpayne avatar gpanders avatar itmammoth avatar jethrokuan avatar jingyenloh avatar jojibucaran avatar jorgebucaran avatar junjuew avatar martinpelikan avatar mkazutaka avatar mllg avatar neersighted avatar patrickf1 avatar rominf avatar sergio-u avatar skorokithakis avatar tchajed avatar vic avatar zeekozhu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.