Add explanation for the `g:fzf_colors` setting (#1878)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Kahlil (Kal) Hodgson · committed by GitHub · parent 7d5985b · Browse files · 2 files·+49 added−2 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
Diff stats
2 files+49 added−2 removed
- other:+49 added−2 removed
Provenance
- Commit
7085e5b- Tree
cee4df5- Author
Kahlil (Kal) Hodgson <tartansandal@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
7d5985b
2 files changed+49 added−2 removed
modified:man/man1/fzf.1+2 added-2 removed
286 unmodified lines287 \fBfg+ \fRText (current line)288 \fBbg+ \fRBackground (current line)289 \fBgutter \fRGutter on the left (defaults to \fBbg+\fR)290 \fBhl+ \fRHighlighted substrings (current line)291- \fBinfo \fRInfo292- \fBborder \fRBorder of the preview window and horizontal separators (\fB--border\fR)291+ \fBinfo \fRInfo line (match counters)292+ \fBborder \fRBorder around the window (\fB--border\fR and \fB--preview\fR)293 \fBprompt \fRPrompt294 \fBpointer \fRPointer to the current line295 \fBmarker \fRMulti-select marker296 \fBspinner \fRStreaming input indicator491 unmodified linesmodified:README-VIM.md+47 added
157 unmodified lines158 " 'previous-history' instead of 'down' and 'up'.159 let g:fzf_history_dir = '~/.local/share/fzf-history'160 ```161 162+##### Explanation of `g:fzf_colors`163+164+`g:fzf_colors` is a dictionary mapping fzf elements to a color specification165+list:166+167+ element: [ component, group1 [, group2, ...] ]168+169+- `element` is an fzf element to apply a color to:170+171+ | Element | Description |172+ | --- | --- |173+ | `fg` / `bg` / `hl` | Item (foreground / background / highlight) |174+ | `fg+` / `bg+` / `hl+` | Current item (foreground / background / highlight) |175+ | `hl` / `hl+` | Highlighted substrings (normal / current) |176+ | `gutter` | Background of the gutter on the left |177+ | `pointer` | Pointer to the current line (`>`) |178+ | `marker` | Multi-select marker (`>`) |179+ | `border` | Border around the window (`--border` and `--preview`) |180+ | `header` | Header (`--header` or `--header-lines`) |181+ | `info` | Info line (match counters) |182+ | `spinner` | Streaming input indicator |183+ | `prompt` | Prompt before query (`> `) |184+185+- `component` specifies the component (`fg` / `bg`) from which to extract the186+ color when considering each of the following highlight groups187+188+- `group1 [, group2, ...]` is a list of highlight groups that are searched (in189+ order) for a matching color definition190+191+For example, consider the following specification:192+193+```vim194+ 'prompt': ['fg', 'Conditional', 'Comment'],195+```196+197+This means we color the **prompt**198+- using the `fg` attribute of the `Conditional` if it exists,199+- otherwise use the `fg` attribute of the `Comment` highlight group if it exists,200+- otherwise fall back to the default color settings for the **prompt**.201+202+You can examine the color option generated according the setting by printing203+the result of `fzf#wrap()` function like so:204+205+```vim206+:echo fzf#wrap()207+```208+209 `fzf#run`210 ---------211 212 `fzf#run()` function is the core of Vim integration. It takes a single210 unmodified lines