Commit Graph

196 Commits (22cbd9fa58512ffdcc975bab37a55467d5e10968)

Author SHA1 Message Date
Junegunn Choi 22cbd9fa58
Implement height range (--height ~[VALUE][%])
Close #2953
2 years ago
Junegunn Choi 6fb41a202a
Add --scheme=[default|path|history] option to choose scoring scheme
Close #2909
Close #2930
2 years ago
Emil Vanherp 4bef330ce1
Add support for ANSI strike-through (#2932)
Close #2932

Co-authored-by: Emil Vanherp <emil@vanherp.me>
2 years ago
Junegunn Choi c1c355160d
Support border-{up,down} as the synonyms for border-{top,bottom} 2 years ago
Junegunn Choi 19f9bbca0d
Allow specifying fzf options in $FZF_TMUX_OPTS without '--' 2 years ago
Junegunn Choi f0bfeba733
Add new tiebreak: 'chunk'
Favors the line with shorter matched chunk. A chunk is a set of
consecutive non-whitespace characters.

Unlike the default `length`, this new scheme works well with tabular input.

  # length prefers item #1, because the whole line is shorter,
  # chunk prefers item #2, because the matched chunk ("foo") is shorter
  fzf --height=6 --header-lines=2 --tiebreak=chunk --reverse --query=fo << "EOF"
  N | Field1 | Field2 | Field3
  - | ------ | ------ | ------
  1 | hello  | foobar | baz
  2 | world  | foo    | bazbaz
  EOF

If the input does not contain any spaces, `chunk` is equivalent to
`length`. But we're not going to set it as the default because it is
computationally more expensive.

Close #2285
Close #2537
- Not the exact solution to --tiebreak=length not taking --nth into account,
  but this should work. And the added benefit is that it works well even
  when --nth is not provided.
- Adding a bonus point to the last character of a word didn't turn out great.
  The order of the result suddenly changes when you type in the last
  character in the word producing a jarring effect.
2 years ago
Junegunn Choi bbbcd780c9
Allow "--version" to be used as the argument to --query, --header, et al.
But why?
2 years ago
Junegunn Choi 3af5b7f2ac
Do not validate other options when --version is present
Close #2690
2 years ago
Junegunn Choi 7a7cfcacbe
Lift unicode.IsGraphic constraint for pointer, marker, and ellipsis
Use at your own risk.

Close #2709
Close #2055
2 years ago
Junegunn Choi 821fc9feed
Fix failing test case 2 years ago
Junegunn Choi 82b46726fc
Add support for an alternative preview window layout
Close #2804
Close #2844

Related #2277
2 years ago
Junegunn Choi d56f605b63
Add `rebind` action for restoring bindings after `unbind`
Fix #2752
Close #2564
2 years ago
Junegunn Choi ef67a45702
Add --ellipsis=.. option
Close #2432

Also see
- #1769
- https://github.com/junegunn/fzf/pull/1844#issuecomment-586663660
2 years ago
Junegunn Choi 43f0d0cacd
change-preview-window to take multiple option sets separated by '|'
So you can "rotate" through the different options with a single binding.

  fzf --preview 'cat {}' \
      --bind 'ctrl-/:change-preview-window(70%|down,40%,border-horizontal|hidden|)'

Close #2376
2 years ago
Junegunn Choi 20b4e6953e
Implement change-preview and change-preview-window actions
The new actions are named with 'change-' prefix to differentiate from
the pre-existing, one-off 'preview(...)' action.

Fix #2360
Fix #2505
Fix #2666

Related #2435
Related #2376
  - Can set up multiple bindings with different change-preview-window actions
  - Not possible to "rotate" through the options with a single binding
  - Enlarge or shrink not possible
3 years ago
Junegunn Choi 673c5d886d
Add 'put' action for putting the character to the prompt
fzf --bind 'space:preview(date)+put'

Close #2456
3 years ago
Junegunn Choi 7bff4661f6
Add --header-first option to display header before prompt line
Close #2422
3 years ago
Junegunn Choi 02cee2234d
Implement --scroll-off=LINES
Close #2533
3 years ago
Junegunn Choi 4173e94c6f
Do not check for --height support on --version
https://github.com/junegunn/fzf.vim/issues/1329
3 years ago
Junegunn Choi a4bc08f5a3
Allow specifying 16 base ANSI colors by their names
Close #2502
3 years ago
Junegunn Choi 347c4b2625
Add 'unbind' action
Fix #2486
3 years ago
Junegunn Choi 3f75a8369f
Replace RuneWidth to StringWidth to handle grapheme clusters
Fix #2482
3 years ago
Junegunn Choi da1f645670
Change --preview-window delimiter from : to , for consistency
Delimiter : was chosen when --preview-option only supported position and
size attributes. e.g. up:50%
3 years ago
Junegunn Choi 15f4cfb6d9
More border optins for preview window
Close #2431
3 years ago
Junegunn Choi 1b08f43f82
Advanced preview scroll offset expression to better support fixed header 3 years ago
Junegunn Choi 4c4c6e626e
Add support for preview window header
Fix #2373

  # Display top 3 lines as the fixed header
  fzf --preview 'bat --style=header,grid --color=always {}' --preview-window '~3'
3 years ago
Junegunn Choi 76bbf57b3d
Add select and deselect actions
Close #2358
3 years ago
Junegunn Choi f55c990e86
Add `close` action
Close #2331
3 years ago
Elliott Sales de Andrade 82791f7efc Use more explicit int-to-string conversion.
This fixes the following errors with Go 1.15:
```
src/options.go:452:69: conversion from untyped int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
src/options.go:463:33: conversion from untyped int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
```
3 years ago
Junegunn Choi d779ff7e6d
Make search toggleable
- `--phony` renamed to `--disabled` for consistency
    - `--no-phony` is now `--enabled`
- Added `enable-search`, `disable-search`, and `toggle-search` actions
  for `--bind`
- Added `--color` options: `query` and `disabled`

Close #2303
3 years ago
Junegunn Choi 151252e33a
Add preview-top and preview-bottom actions 3 years ago
Junegunn Choi 7136cfc68b
Fix alt-, for --expect 3 years ago
Junegunn Choi 7f8e0dbc40
Extend support for alt key chords
"alt-" with any case-sensitive character is allowed
3 years ago
Junegunn Choi 0de7ab18f6
Add "last" action to move the cursor to the last match
This is the opposite of "first" (previously known as "top").
3 years ago
Junegunn Choi e0a22e76f8
Make --color attributes mergeable
So you can override the colors and still have the text attributes

    # Default colors and attributes
    fzf

    export FZF_DEFAULT_OPTS='--color hl👎underline,hl+👎underline:reverse'

    # Default colors with underline+reverse attributes
    fzf

    # Different colors with underline+reverse attributes
    fzf --color hl:176,hl+:177

Related: https://github.com/junegunn/fzf.vim/issues/1197#issuecomment-739804363
3 years ago
Junegunn Choi 2ec382ae0e
Add --preview-window follow option 4 years ago
Junegunn Choi 6d647e13ff
Add change-prompt action
Close #2270
4 years ago
Junegunn Choi 3fe8eeedc5
Fix handling of arrow keys with alt and/or shift modifier
Fix #2254

- Properly handle extra chars in the buffer. Patch suggested by @mckelly2833.
- Support alt-arrow sequences in \e[1;3A format
- Support shift-alt-arrow sequences in \e[1;10A format
4 years ago
Junegunn Choi f6269f0193
Add --padding option
Close #2241
4 years ago
Junegunn Choi e7ca237b07
Fix nil error on --color=bw
Fix #2229
4 years ago
Junegunn Choi 2e8e63fb0b
Add more --border options
Instead of drawing the window border in Vim using an extra window,
extend the --border option so that we do can it natively.

Close #2223
Fix #2184
4 years ago
Junegunn Choi 11841f688b
Add support for text styling using --color
Close #1663
4 years ago
Junegunn Choi 3248153d9f
Add --preview-window=default for resetting the options 4 years ago
Junegunn Choi 865144850d
Add nowrap, nocycle, nohidden for --preview-window
Close #2203
4 years ago
Junegunn Choi d9752a4c21
Reset preview window flags that are not style-related
Fix #2203
4 years ago
Junegunn Choi 1d8bd11b67
Fix preview window size calculation 4 years ago
Junegunn Choi bafb99d520
Allow splitting preview-window options
e.g. --preview-window sharp --preview-window cycle
4 years ago
Junegunn Choi 3cc8a74a91
Add --preview-window option for cyclic scrolling
Close #2182
4 years ago
Tinmarino c0aa5a438f
Add preview-half-page-down and preview-half-page-up (#2145) 4 years ago
Junegunn Choi 43798fc2e8
Revert 1ab4289: Preview window of size 0 is allowed 4 years ago