Moving in the list 9
When fzf is started with --history, Ctrl + N and Ctrl + P step through the saved queries instead of moving in the list.
| Action | Shortcut |
|---|---|
| Move upSteps the cursor to the item above the current one. | Ctrl+KorUp |
| Move downSteps the cursor to the item below the current one. | Ctrl+JorDown |
| Move to match aboveActs like moving up, except in raw mode, where it skips the non-matching items shown between matches. | Ctrl+PorAlt+Up |
| Move to match belowThe downward counterpart; with raw mode off it simply goes one item down. | Ctrl+NorAlt+Down |
| Page upScroll the candidate list one page up. | Page Up |
| Page downScroll the candidate list one page down. | Page Down |
| Scroll preview upScrolls the text shown in the preview window and leaves the list cursor where it is. | Shift+Up |
| Scroll preview downThe preview window can also be scrolled with the mouse. | Shift+Down |
| Clear and redraw screen | Ctrl+L |
Selecting and leaving 6
| Action | Shortcut |
|---|---|
| Accept selectionConfirm the highlighted item and close the finder. | Enter |
| Accept clicked itemThe mouse equivalent of Enter; mouse support can be turned off with --no-mouse. | Double-click |
| Toggle and move downIn multi-select mode (-m), marks or unmarks the item and goes to the next one down. | Tab |
| Toggle and move upIn multi-select mode, marks or unmarks the item and goes one up. | Shift+Tab |
| Toggle clicked itemMarks or unmarks an item with the mouse when multi-select is on. | Right-click |
| AbortLeaves the finder without a selection; fzf then exits with status 130. | EscorCtrl+CorCtrl+GorCtrl+Q |
Editing the query 18
| Action | Shortcut |
|---|---|
| Start of queryMove the cursor to the beginning of the query. | Ctrl+AorHome |
| End of queryMove the cursor to the end of the query. | Ctrl+EorEnd |
| Back one characterMoves the query cursor a single position to the left. | Ctrl+BorLeft |
| Forward one characterMoves the query cursor a single position to the right. | Ctrl+ForRight |
| Back one wordJumps the query cursor to the previous word. | Alt+BorShift+LeftorAlt+Left |
| Forward one wordJumps the query cursor past the next word. | Alt+ForShift+RightorAlt+Right |
| Delete previous characterErases the character to the left of the query cursor. | Ctrl+HorCtrl+BackspaceorBackspace |
| Delete character at cursor | Delete |
| Delete character or abortDeletes at the cursor like Delete, but closes the finder when nothing has been typed. | Ctrl+D |
| Delete word before cursorThe action is called backward-kill-word, the reverse of Alt + D. | Alt+Backspace |
| Delete word after cursorRuns the kill-word action, the forward counterpart of Alt + Backspace. | Alt+D |
| Discard the query lineBound to the action named unix-line-discard, one of the Emacs-style editing keys. | Ctrl+U |
| Delete wordDelete the word before the cursor in the query. | Ctrl+W |
| Yank killed text | Ctrl+Y |
| Toggle word wrapSwitches wrapping of long lines at word boundaries on or off. | Ctrl+/ |
| Toggle word wrapSecond default key for the same action; the manual warns that some terminal emulators may lack Ctrl bindings. | Alt+/ |
| Previous query from historyTakes over this key only when fzf was started with --history, which saves queries to a file. | Ctrl+P |
| Next query from historyThe forward direction of the same list; without --history the key moves in the item list. | Ctrl+N |
Shell integration keys 9
Each of the three shell keys can be switched off by giving its *_COMMAND variable an empty value on the line that sources the integration script; setting it afterwards changes nothing.
| Action | Shortcut |
|---|---|
| Insert file pathFuzzy-find a file or directory and paste its path at the cursor. | Ctrl+T |
| Fuzzy history searchSearches the shell command history and puts the chosen command on the prompt line. | Ctrl+R |
| cd into directoryFuzzy-find a directory and cd into it. | Alt+C |
| Toggle sorting by relevancePressed again inside the history finder, it switches to chronological order and back. | Ctrl+R |
| Toggle raw modeIn the history finder, shows the entries around each match; Ctrl + N and Ctrl + P then visit matches only. | Alt+R |
| Delete selected history entriesRemoves the marked commands from the shell history; documented for bash and fish. | Shift+Delete |
| Reformat and insert commandsFish shell only, inside the history finder opened with Ctrl + R. | Alt+Enter |
| Cycle command prefixIn fish, rotates what precedes each history entry: a timestamp, date and time, or nothing. | Alt+T |
| Fuzzy completion in fishFish needs no trigger sequence: this key opens fzf on the native completion candidates, and Tab stays unchanged. | Shift+Tab |
Running fzf and shell setup 6
| Action | Shortcut |
|---|---|
| Filter a list from a pipefzf takes the list on standard input and prints the chosen item on standard output. | find * -type f | fzf > selected |
| Open a picked fileWithout piped input fzf walks the current directory itself and lists its files. | vim $(fzf) |
| Pass selections to xargsThe README calls this the more robust way to open the chosen files in an editor. | fzf --print0 | xargs -0 -o vim |
| Set up bash integrationGoes in the bash configuration file; turns on the shell keys and fuzzy completion. | eval "$(fzf --bash)" |
| Set up zsh integrationThe zsh counterpart, added to the zsh configuration file. | source <(fzf --zsh) |
| Set up fish integrationAdd it to the fish configuration file; in fish, completion runs on Shift + Tab. | fzf --fish | source |
Fuzzy completion 14
| Action | Shortcut |
|---|---|
| Trigger fuzzy completionBash and zsh start it when the text left of the cursor ends in **, the default trigger. | COMMAND [DIRECTORY/][FUZZY_PATTERN]**<TAB> |
| Complete files in current directorySeveral files can be marked with Tab before accepting. | vim **<TAB> |
| Complete files in parent directoryAny path typed before the trigger becomes the starting directory. | vim ../**<TAB> |
| Complete with a starting patternLimits the candidates in the parent directory to those matching fzf. | vim ../fzf**<TAB> |
| Complete files in home directory | vim ~/**<TAB> |
| Complete directoriesLists directories only and allows a single selection. | cd **<TAB> |
| Complete process IDsTab and Shift + Tab mark more than one process. | kill -9 **<TAB> |
| Complete host namesHost names come from ~/.ssh/config and /etc/hosts. | ssh **<TAB> |
| Complete environment variablesOffers environment variable names; the README lists it for bash and zsh. | unset **<TAB> |
| Complete a variable to export | export **<TAB> |
| Complete aliases | unalias **<TAB> |
| Change the trigger sequenceReplaces ** with ~~ for completion in bash and zsh. | export FZF_COMPLETION_TRIGGER='~~' |
| Set options for completionThese fzf options apply whenever fuzzy completion opens the finder. | export FZF_COMPLETION_OPTS='--border --info=inline' |
| Enable completion for more commandsBash enables it only for a preset list of commands; the first argument is path, dir, var, alias or host. | _fzf_setup_completion path ag git kubectl |
Search syntax 10
Started with -e or --exact, fzf matches every term exactly, and a leading single quote then turns a term back into a fuzzy one.
| Action | Shortcut |
|---|---|
| Fuzzy matchA plain term matches fuzzily, so characters may be left out of what you type. | sbtrkt |
| Exact matchThe leading single quote makes fzf look for the term as typed, not fuzzily. | 'wild |
| Exact match at word boundariesQuoted at both ends, the term has to begin and end at a word boundary. | 'wild' |
| Prefix matchKeeps the items whose text begins with the term, matched exactly. | ^music |
| Suffix matchKeeps the items whose text finishes with the term, matched exactly. | .mp3$ |
| Exclude a termDrops items containing the term; negated terms are matched exactly, not fuzzily. | !fire |
| Exclude a prefixDrops the items that begin with the term. | !^music |
| Exclude a suffixDrops the items that finish with the term. | !.mp3$ |
| OR operatorA lone bar joins alternatives: here items starting with core that finish in go, rb or py. | ^core go$ | rb$ | py$ |
| Combine several termsTerms separated by spaces narrow the result together; a backslash before a space matches a literal space. | ^music .mp3$ sbtrkt !fire |
Everyday options 26
| Action | Shortcut |
|---|---|
| Enable multi-selectLets Tab and Shift + Tab mark several items; --multi=MAX caps how many. | -m / --multi |
| Exact-match modeEvery term is matched exactly; a leading single quote then makes a term fuzzy again. | -e / --exact |
| Ignore caseOverrides the default smart-case, which turns case-sensitive once the query has an uppercase letter. | -i / --ignore-case |
| Match case | +i / --no-ignore-case |
| Start with a queryOpens the finder with STR already typed; the long form is --query=STR. | -q STR |
| Auto-select a single matchWhen the initial query leaves one candidate, fzf prints it without opening the finder. | -1 / --select-1 |
| Exit when nothing matchesWhen the initial query has no candidates, fzf quits at once instead of opening. | -0 / --exit-0 |
| Filter without the finderPrints the matches for STR non-interactively; the long form is --filter=STR. | -f STR |
| Keep input orderMatches stay in the order they were read instead of being ranked. | +s / --no-sort |
| Reverse input orderThe manual pairs it with --no-sort to list shell history newest first. | --tac |
| Wrap around the listMoving past the last item jumps to the first, and the other way round. | --cycle |
| Process ANSI colorsTurns on interpretation of the color escape sequences found in the input. | --ansi |
| Read NUL-separated inputSplits the input at NUL bytes, not at line ends. | --read0 |
| Print NUL-separated outputPairs with xargs -0, as in fzf --print0 | xargs -0 -o vim. | --print0 |
| Set field delimiterA regular expression that splits each line into fields; the long form is --delimiter=STR. | -d STR |
| Limit search to fieldsOnly the listed fields are searched; the long form is --nth. | -n N[,..] |
| Show only chosen fieldsChanges only how each line is displayed; --with-nth 2.. for example hides the first field. | --with-nth N[,..] |
| Bind a key to an actionSeveral bindings are separated by commas, and an event name can replace the key. | --bind KEY:ACTION |
| Rebind two keys at onceThe manual's example: Ctrl + J accepts and Ctrl + K kills the line. | --bind=ctrl-j:accept,ctrl-k:kill-line |
| Run a command on the itemexecute starts the command without leaving fzf; here Enter opens the item in less. | --bind "enter:execute(less {})" |
| Hand the selection to a programbecome replaces the fzf process with the command, here vim on the chosen file. | --bind 'enter:become(vim {})' |
| Choose what the walker listsThe four flags make the built-in walker list files and directories, follow symlinks and include hidden ones. | --walker file,dir,follow,hidden |
| Skip directories while walkingNames the directories the walker does not enter; the default is .git,node_modules. | --walker-skip .git,node_modules,target |
| Show the man page | --man |
| Show the help message | --help |
| Show the version | --version |
Layout and preview options 19
| Action | Shortcut |
|---|---|
| Use part of the screenStarts fzf under the cursor at that height instead of taking over the full screen. | --height 40% |
| Set a maximum heightWith the ~ prefix fzf takes only as many lines as the list needs, up to the limit. | --height ~100% |
| Height relative to the screenA negative value is subtracted from the terminal height. | --height -3 |
| Prompt at the topDraws the list from the top of the screen downward; the default layout starts at the bottom. | --layout=reverse / --reverse |
| Top-down list, prompt at bottom | --layout reverse-list |
| Draw a borderAccepts an optional style such as rounded (the default), sharp, bold or double. | --border |
| Open in a floating paneWorks inside tmux (3.3 or later) or Zellij (0.44 or later); elsewhere the option does nothing. | --popup / --tmux |
| Centered popupThe default placement, half the width and half the height of the terminal. | --popup center |
| Popup at the bottomThe two sizes are width, then height: here 80% wide and 40% tall. | --popup bottom,80%,40% |
| Apply a style presetPresets are default, full and minimal. | --style full |
| Preview the current itemRuns the command for the highlighted line and shows its output in a split window; {} stands for that line. | --preview 'cat {}' |
| Place and size the previewPosition, size and border are given as one comma-separated value; the default position is right. | --preview-window up,1,border-horizontal |
| Start with preview hiddenThe window stays closed until an action such as toggle-preview opens it. | --preview-window hidden |
| Follow preview outputKeeps the preview scrolled to its last line, the way tail -f does. | --preview-window follow |
| Wrap long preview linesWithout it, lines wider than the preview window are cut off. | --preview-window wrap |
| Cycle preview layouts with a keyEach press of Ctrl + / moves to the next option set: below the list, hidden, then the default again. | --bind 'ctrl-/:change-preview-window(down|hidden|)' |
| Show a sticky header | --header STR |
| Use first input lines as headerTakes N lines off the start of the input and pins them as the header. | --header-lines N |
| Change the promptReplaces the default input prompt, which is '> '. | --prompt STR |
Environment variables 9
FZF_DEFAULT_COMMAND does not feed the shell integration: Ctrl + T runs $FZF_CTRL_T_COMMAND and Alt + C runs $FZF_ALT_C_COMMAND.
| Action | Shortcut |
|---|---|
| Command that builds the listRuns when nothing is piped into fzf; the shell integration keys do not use it. | FZF_DEFAULT_COMMAND |
| Options for every runApplies to each fzf start, including the finders opened by the shell integration keys. | FZF_DEFAULT_OPTS |
| File holding the default optionsPoints to a file such as ~/.fzfrc, for those who prefer a file to a variable. | FZF_DEFAULT_OPTS_FILE |
| List command for Ctrl + TReplaces the built-in walker for that key; an empty value at setup time disables the binding. | FZF_CTRL_T_COMMAND |
| Options for Ctrl + TExtra fzf options for the file finder, such as a --preview command. | FZF_CTRL_T_OPTS |
| Options for Ctrl + RExtra options for the history finder, for instance a --bind that copies the command to the clipboard. | FZF_CTRL_R_OPTS |
| Switch off the Ctrl + R bindingGive it an empty value on the line that loads the integration; a custom command is not supported yet. | FZF_CTRL_R_COMMAND |
| List command for Alt + CSupplies the directory list; an empty value at setup time turns the key off. | FZF_ALT_C_COMMAND |
| Options for Alt + CFor instance --preview 'tree -C {}' to show a directory tree next to the list. | FZF_ALT_C_OPTS |
No row on this page matches that filter.
Notes
Shell integration
With shell integration loaded from the shell configuration file — eval "$(fzf --bash)" in .bashrc, source <(fzf --zsh) in .zshrc — Ctrl + R replaces the shell's history search with a fuzzy one: type fragments and the matching commands appear, ranked by relevance; press Ctrl + R again for chronological order. Ctrl + T opens a finder over files and directories under the current directory and pastes the selected paths into the command line, which is how vim or cat reach a deeply nested file without typing the path. Alt + C lists directories and changes into the one you pick. In bash and zsh, Tab after a trigger sequence (** by default) fuzzy-completes paths, process IDs for kill, and hostnames for ssh; fish uses Shift + Tab with no trigger.
Inside the finder
Down is Ctrl + J and up is Ctrl + K (arrow keys work too), Enter accepts the highlighted line and Esc aborts, leaving the command line untouched. Multi-select has to be switched on with -m; then Tab and Shift + Tab toggle the current line and move — so several files can be picked for one command. Page Up and Page Down jump through long lists. The query line uses Emacs-style keys: Ctrl + U discards it, Ctrl + W deletes a word, while the query's beginning and end are one keypress away on Ctrl + A and Ctrl + E. Every one of these defaults can be changed with --bind.
Query syntax
Typing matches fuzzily, but prefixes change that: a leading ' makes a term exact, ^ anchors to the start, $ to the end and ! negates; terms separated by spaces all have to match, and a lone | between terms means OR. --preview shows a command's output beside the list; the README advises against putting it in FZF_DEFAULT_OPTS, because fzf filters any kind of list, and sets it per key instead — a file preview in FZF_CTRL_T_OPTS turns Ctrl + T into a file browser.
Questions
Which key opens the fzf history search in the shell?
Ctrl + R, once shell integration is set up. It pastes the command you pick onto the command line; pressing Ctrl + R again inside the finder toggles sorting by relevance, so the commands appear in chronological order.
Why do Ctrl + T and Alt + C do nothing after installing fzf?
They belong to the shell integration, which has to be loaded in the shell configuration file: eval "$(fzf --bash)" for bash, source <(fzf --zsh) for zsh, fzf --fish | source for fish. A binding is also off when its *_COMMAND variable was set to an empty string on that line.
How do I select several items in fzf?
Start fzf with -m (multi-select mode), mark items with Tab or Shift + Tab, then press Enter. The history finder on Ctrl + R and fuzzy completion for files already allow it: the README notes that several entries can be selected there with Tab.
How do I search for an exact string instead of a fuzzy match?
Put a single quote in front of the term, as in 'wild, or start fzf with -e (--exact) to make every term exact. Anchored terms such as ^music and .mp3$ and negated terms such as !fire are exact matches as well.
Does fzf use different keys on macOS, Linux and Windows?
The README and man page document one set of default bindings for all systems, written with Ctrl, Alt and Shift; there is no separate Cmd-based list. The man page adds that some terminal emulators may not support ctrl-* bindings, so a key that does nothing is usually a terminal matter rather than an fzf setting.
Sources and checks
- fzf 0.74.4 — README.md at release tag v0.74.4 (junegunn/fzf on GitHub) Shell integration keys, fuzzy completion, search syntax, environment variables, display-mode examples
- fzf 0.74.4 — man page man/man1/fzf.1 at release tag v0.74.4 (junegunn/fzf on GitHub) Default key bindings of the finder (section "Available actions") and command-line options
- fzf Reference — the man page as published on the project site Mouse bindings (double-click, right-click), same table as the man page
Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.
Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.