From 2f51eb2b414f3e27f0d3ab3f4ef1a3f3a48c6d06 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 27 May 2024 01:20:56 +0900 Subject: Different marker for the first and last line of multi-line entries Can be configured via `--marker-multi-line` --- src/options.go | 297 +++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 182 insertions(+), 115 deletions(-) (limited to 'src/options.go') diff --git a/src/options.go b/src/options.go index c5b939e4..461db313 100644 --- a/src/options.go +++ b/src/options.go @@ -27,136 +27,137 @@ Author: Junegunn Choi Usage: fzf [options] Search - -x, --extended Extended-search mode - (enabled by default; +x or --no-extended to disable) - -e, --exact Enable Exact-match - -i, --ignore-case Case-insensitive match (default: smart-case match) - +i, --no-ignore-case Case-sensitive match - --scheme=SCHEME Scoring scheme [default|path|history] - --literal Do not normalize latin script letters before matching - -n, --nth=N[,..] Comma-separated list of field index expressions - for limiting search scope. Each can be a non-zero - integer or a range expression ([BEGIN]..[END]). - --with-nth=N[,..] Transform the presentation of each line using - field index expressions - -d, --delimiter=STR Field delimiter regex (default: AWK-style) - +s, --no-sort Do not sort the result - --track Track the current selection when the result is updated - --tac Reverse the order of the input - --disabled Do not perform search - --tiebreak=CRI[,..] Comma-separated list of sort criteria to apply - when the scores are tied [length|chunk|begin|end|index] - (default: length) - + -x, --extended Extended-search mode + (enabled by default; +x or --no-extended to disable) + -e, --exact Enable Exact-match + -i, --ignore-case Case-insensitive match (default: smart-case match) + +i, --no-ignore-case Case-sensitive match + --scheme=SCHEME Scoring scheme [default|path|history] + --literal Do not normalize latin script letters before matching + -n, --nth=N[,..] Comma-separated list of field index expressions + for limiting search scope. Each can be a non-zero + integer or a range expression ([BEGIN]..[END]). + --with-nth=N[,..] Transform the presentation of each line using + field index expressions + -d, --delimiter=STR Field delimiter regex (default: AWK-style) + +s, --no-sort Do not sort the result + --track Track the current selection when the result is updated + --tac Reverse the order of the input + --disabled Do not perform search + --tiebreak=CRI[,..] Comma-separated list of sort criteria to apply + when the scores are tied [length|chunk|begin|end|index] + (default: length) Interface - -m, --multi[=MAX] Enable multi-select with tab/shift-tab - --no-mouse Disable mouse - --bind=KEYBINDS Custom key bindings. Refer to the man page. - --cycle Enable cyclic scroll - --no-multi-line Disable multi-line display of items when using --read0 - --keep-right Keep the right end of the line visible on overflow - --scroll-off=LINES Number of screen lines to keep above or below when - scrolling to the top or to the bottom (default: 0) - --no-hscroll Disable horizontal scroll - --hscroll-off=COLS Number of screen columns to keep to the right of the - highlighted substring (default: 10) - --filepath-word Make word-wise movements respect path separators - --jump-labels=CHARS Label characters for jump mode + -m, --multi[=MAX] Enable multi-select with tab/shift-tab + --no-mouse Disable mouse + --bind=KEYBINDS Custom key bindings. Refer to the man page. + --cycle Enable cyclic scroll + --no-multi-line Disable multi-line display of items when using --read0 + --keep-right Keep the right end of the line visible on overflow + --scroll-off=LINES Number of screen lines to keep above or below when + scrolling to the top or to the bottom (default: 0) + --no-hscroll Disable horizontal scroll + --hscroll-off=COLS Number of screen columns to keep to the right of the + highlighted substring (default: 10) + --filepath-word Make word-wise movements respect path separators + --jump-labels=CHARS Label characters for jump mode Layout - --height=[~]HEIGHT[%] Display fzf window below the cursor with the given - height instead of using fullscreen. - A negative value is calculated as the terminal height - minus the given value. - If prefixed with '~', fzf will determine the height - according to the input size. - --min-height=HEIGHT Minimum height when --height is given in percent - (default: 10) - --tmux=OPTS Start fzf in a tmux popup (requires tmux 3.3+) - [center|top|bottom|left|right][,SIZE[%]][,SIZE[%]] - --layout=LAYOUT Choose layout: [default|reverse|reverse-list] - --border[=STYLE] Draw border around the finder - [rounded|sharp|bold|block|thinblock|double|horizontal|vertical| - top|bottom|left|right|none] (default: rounded) - --border-label=LABEL Label to print on the border - --border-label-pos=COL Position of the border label - [POSITIVE_INTEGER: columns from left| - NEGATIVE_INTEGER: columns from right][:bottom] - (default: 0 or center) - --margin=MARGIN Screen margin (TRBL | TB,RL | T,RL,B | T,R,B,L) - --padding=PADDING Padding inside border (TRBL | TB,RL | T,RL,B | T,R,B,L) - --info=STYLE Finder info style - [default|right|hidden|inline[-right][:PREFIX]] - --separator=STR String to form horizontal separator on info line - --no-separator Hide info line separator - --scrollbar[=C1[C2]] Scrollbar character(s) (each for main and preview window) - --no-scrollbar Hide scrollbar - --prompt=STR Input prompt (default: '> ') - --pointer=STR Pointer to the current line (default: '▌' or '>') - --marker=STR Multi-select marker (default: '┃' or '>') - --header=STR String to print as header - --header-lines=N The first N lines of the input are treated as header - --header-first Print header before the prompt line - --ellipsis=STR Ellipsis to show when line is truncated (default: '..') + --height=[~]HEIGHT[%] Display fzf window below the cursor with the given + height instead of using fullscreen. + A negative value is calculated as the terminal height + minus the given value. + If prefixed with '~', fzf will determine the height + according to the input size. + --min-height=HEIGHT Minimum height when --height is given in percent + (default: 10) + --tmux=OPTS Start fzf in a tmux popup (requires tmux 3.3+) + [center|top|bottom|left|right][,SIZE[%]][,SIZE[%]] + --layout=LAYOUT Choose layout: [default|reverse|reverse-list] + --border[=STYLE] Draw border around the finder + [rounded|sharp|bold|block|thinblock|double|horizontal|vertical| + top|bottom|left|right|none] (default: rounded) + --border-label=LABEL Label to print on the border + --border-label-pos=COL Position of the border label + [POSITIVE_INTEGER: columns from left| + NEGATIVE_INTEGER: columns from right][:bottom] + (default: 0 or center) + --margin=MARGIN Screen margin (TRBL | TB,RL | T,RL,B | T,R,B,L) + --padding=PADDING Padding inside border (TRBL | TB,RL | T,RL,B | T,R,B,L) + --info=STYLE Finder info style + [default|right|hidden|inline[-right][:PREFIX]] + --separator=STR String to form horizontal separator on info line + --no-separator Hide info line separator + --scrollbar[=C1[C2]] Scrollbar character(s) (each for main and preview window) + --no-scrollbar Hide scrollbar + --prompt=STR Input prompt (default: '> ') + --pointer=STR Pointer to the current line (default: '▌' or '>') + --marker=STR Multi-select marker (default: '┃' or '>') + --marker-multi-line=STR Multi-select marker for multi-line entries; + 3 elements for top, middle, and bottom (default: '╻┃╹') + --header=STR String to print as header + --header-lines=N The first N lines of the input are treated as header + --header-first Print header before the prompt line + --ellipsis=STR Ellipsis to show when line is truncated (default: '..') Display - --ansi Enable processing of ANSI color codes - --tabstop=SPACES Number of spaces for a tab character (default: 8) - --color=COLSPEC Base scheme (dark|light|16|bw) and/or custom colors - --highlight-line Highlight the whole current line - --no-bold Do not use bold text + --ansi Enable processing of ANSI color codes + --tabstop=SPACES Number of spaces for a tab character (default: 8) + --color=COLSPEC Base scheme (dark|light|16|bw) and/or custom colors + --highlight-line Highlight the whole current line + --no-bold Do not use bold text History - --history=FILE History file - --history-size=N Maximum number of history entries (default: 1000) + --history=FILE History file + --history-size=N Maximum number of history entries (default: 1000) Preview - --preview=COMMAND Command to preview highlighted line ({}) - --preview-window=OPT Preview window layout (default: right:50%) - [up|down|left|right][,SIZE[%]] - [,[no]wrap][,[no]cycle][,[no]follow][,[no]hidden] - [,border-BORDER_OPT] - [,+SCROLL[OFFSETS][/DENOM]][,~HEADER_LINES] - [,default][, markerLen { + padded := *opts.Marker + " " + opts.Marker = &padded + } else if markerMultiLen < markerLen { + for idx := range opts.MarkerMulti { + opts.MarkerMulti[idx] += " " + } } // Default actions for CTRL-N / CTRL-P when --history is set -- cgit v1.2.3