Skip to content
Myr

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

2 files+49 added−2 removed

modified:man/man1/fzf.1+2 added-2 removed
286 unmodified lines
287 \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 indicator
491 unmodified lines
modified:README-VIM.md+47 added
157 unmodified lines
158" 'previous-history' instead of 'down' and 'up'.159let g:fzf_history_dir = '~/.local/share/fzf-history'160```161162##### Explanation of `g:fzf_colors`163164`g:fzf_colors` is a dictionary mapping fzf elements to a color specification165list:166167 element: [ component, group1 [, group2, ...] ]168169- `element` is an fzf element to apply a color to:170171 | 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 (`> `) |184185- `component` specifies the component (`fg` / `bg`) from which to extract the186 color when considering each of the following highlight groups187188- `group1 [, group2, ...]` is a list of highlight groups that are searched (in189 order) for a matching color definition190191For example, consider the following specification:192193```vim194 'prompt': ['fg', 'Conditional', 'Comment'],195```196197This 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**.201202You can examine the color option generated according the setting by printing203the result of `fzf#wrap()` function like so:204205```vim206:echo fzf#wrap()207```208209`fzf#run`210---------211212`fzf#run()` function is the core of Vim integration. It takes a single
210 unmodified lines