Skip to content
Myr

Update ADVANCED.md: Use --tmux instead of fzf-tmux

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 c295339 · Browse files · 1 file+35 added−37 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+35 added−37 removed

  • other:+35 added−37 removed

1 file+35 added−37 removed

modified:ADVANCED.md+35 added-37 removed
1Advanced fzf examples2======================34* *Last update: 2024/01/20*5* *Requires fzf 0.46.0 or above*4* *Last update: 2024/06/03*5* *Requires fzf 0.53.0 or later*67---89<!-- vim-markdown-toc GFM -->1011* [Introduction](#introduction)12* [Screen Layout](#screen-layout)12* [Display modes](#display-modes)13 * [`--height`](#--height)14 * [`fzf-tmux`](#fzf-tmux)15 * [Popup window support](#popup-window-support)14 * [`--tmux`](#--tmux)15* [Dynamic reloading of the list](#dynamic-reloading-of-the-list)16 * [Updating the list of processes by pressing CTRL-R](#updating-the-list-of-processes-by-pressing-ctrl-r)17 * [Toggling between data sources](#toggling-between-data-sources)18 * [Toggling with a single key binding](#toggling-with-a-single-key-binding)
42 unmodified lines
6162This document will guide you through some examples that will familiarize you63with the advanced features of fzf.6466Screen Layout65Display modes66-------------6768### `--height`69
32 unmodified lines
102```sh103export FZF_DEFAULT_OPTS="--height=40% --layout=reverse --info=inline --border --margin=1 --padding=1"104```105107### `fzf-tmux`106### `--tmux`107109Before fzf had `--height` option, we would open fzf in a tmux split pane not110to take up the whole screen. This is done using `fzf-tmux` script.108(Requires tmux 3.3 or later)109110If you're using tmux, you can open fzf in a tmux popup using `--tmux` option.111112```sh113# Open fzf on a tmux split pane below the current pane.114# Takes the same set of options.115fzf-tmux --layout=reverse113# Open fzf in a tmux popup at the center of the screen with 70% width and height114fzf --tmux 70%115```116118![image](https://user-images.githubusercontent.com/700826/113379973-f1cc6500-93b5-11eb-8860-c9bc4498aadf.png)117![image](https://github.com/junegunn/fzf/assets/700826/9c365405-c700-49b2-8985-60d822ed4cff)118120The limitation of `fzf-tmux` is that it only works when you're on tmux unlike121`--height` option. But the advantage of it is that it's more flexible.122(See `man fzf-tmux` for available options.)119`--tmux` option is silently ignored if you're not on tmux. So if you're trying120to avoid opening fzf in fullscreen, try specifying both `--height` and `--tmux`.121122```sh125# On the right (50%)126fzf-tmux -r127128# On the left (30%)129fzf-tmux -l30%130131# Above the cursor132fzf-tmux -u30%123# --tmux is specified later so it takes precedence over --height when on tmux.124# If you're not on tmux, --tmux is ignored and --height is used instead.125fzf --height 70% --tmux 70%126```127135![image](https://user-images.githubusercontent.com/700826/113379983-fa24a000-93b5-11eb-93eb-8a3d39b2f163.png)128You can also specify the position, width, and height of the popup window in129the following format:130137![image](https://user-images.githubusercontent.com/700826/113380001-0577cb80-93b6-11eb-95d0-2ba453866882.png)131* `[center|top|bottom|left|right][,SIZE[%]][,SIZE[%]]`132139![image](https://user-images.githubusercontent.com/700826/113380040-1d4f4f80-93b6-11eb-9bef-737fb120aafe.png)133```sh134# 100% width and 60% height135fzf --tmux 100%,60% --border horizontal136```137141#### Popup window support138![image](https://github.com/junegunn/fzf/assets/700826/f80d3514-d69f-42f2-a8de-a392a562bfcf)139143But here's the really cool part; tmux 3.2 added support for popup windows. So144you can open fzf in a popup window, which is quite useful if you frequently145use split panes.146140```sh148# Open tmux in a tmux popup window (default size: 50% of the screen)149fzf-tmux -p141# On the right (50% width)142fzf --tmux right143```144151# 80% width, 60% height152fzf-tmux -p 80%,60%145![image](https://github.com/junegunn/fzf/assets/700826/4033ade4-7efa-421b-a3fb-a430d197098a)146147```sh148# On the left (40% width and 70% height)149fzf --tmux left,40%,70%150```151155![image](https://user-images.githubusercontent.com/700826/113380106-4a9bfd80-93b6-11eb-8cee-aeb1c4ce1a1f.png)152![image](https://github.com/junegunn/fzf/assets/700826/efe43881-2bf0-49ea-ab2e-1377f778cd52)153154> [!TIP]155> You might also want to check out my tmux plugins which support this popup156> window layout.157>158> - https://github.com/junegunn/tmux-fzf-url
520 unmodified lines