Commit Graph

345 Commits (4ef1cf5b35ca492154a6785281d334b909a24035)

Author SHA1 Message Date
Junegunn Choi 1833670fb9
Add $FZF_DEFAULT_OPTS_FILE (#3618)
For those who prefer to manage default options in a file.
If the file is not found, fzf will exit with an error.

We're not setting a default value for it because:

1. it's hard to find a default value that can be universally agreed upon
2. to avoid fzf having to check for the existence of the file even when it's not used
8 months ago
Junegunn Choi 17da165cfe
CHANGELOG: charlievieth/fastwalk 8 months ago
Junegunn Choi 208e556332
Replace "default find command" with built-in directory traversal 8 months ago
Junegunn Choi 2a1e5a9729
More test fixes for tcell on GitHub Actions 9 months ago
Junegunn Choi 76cf6559cc
junegunn/uniseg -> rivo/uniseg
https://github.com/rivo/uniseg/pull/47
9 months ago
Junegunn Choi beb2de2dd9
0.46.0 9 months ago
Junegunn Choi 687c2741b8
Add 'resize' event
Close #3570
9 months ago
Junegunn Choi 16f6473938
Change mattn/go-runewidth dependency to rivo/uniseg for accurate results
Related #3588 #3588 #3567
9 months ago
Junegunn Choi e7718b92b7
Kitty image support improvements
* Use `--unicode-placeholder` for consistent result in and out of tmux
* Use updated version of junegunn/go-runewidth that handles diacritics
  used in Kitty Unicode placeholder

Close #3567
9 months ago
Junegunn Choi cdfaf761df
Expose state information via environment variables to child processes
Close #3582
9 months ago
Junegunn Choi 250496c953
Add 'result' event that is triggered when the result list is ready
Close #3560
10 months ago
Junegunn Choi 2024010119
0.45.0 10 months ago
Junegunn Choi d210660ce8
Add actions: show-header and hide-header 10 months ago
Junegunn Choi 5d360180af
Add {fzf:prompt} placeholder expression
Close #3354
10 months ago
Junegunn Choi c4df0dd06e
Add TRANSFORM ACTIONS section to man page 10 months ago
Junegunn Choi 1707b8cdba
Add 'transform' action to conditionally perform a series of actions
'transform' action runs an external command that prints a series of
actions to perform.

  # Disallow selecting an empty line
  echo -e "1. Hello\n2. Goodbye\n\n3. Exit" |
    fzf --reverse --header 'Select one' \
        --bind 'enter:transform:[[ -n {} ]] && echo accept || echo "change-header:Invalid selection"'

  # Move cursor past the empty line
  echo -e "1. Hello\n2. Goodbye\n\n3. Exit" |
    fzf --reverse --header 'Select one' \
        --bind 'enter:transform:[[ -n {} ]] && echo accept || echo "change-header:Invalid selection"' \
        --bind 'focus:transform:[[ -n {} ]] && exit; [[ {fzf:action} =~ up$ ]] && echo up || echo down'

Close #3368
Close #2980
10 months ago
Junegunn Choi d7b61ede07
Add support for negative --height
fzf --height=-1

Close #3487
10 months ago
Junegunn Choi e8b34cb00d
Clarification on accept-or-print-query vs. become 10 months ago
Junegunn Choi c36a64be68
Add accept-or-print-query
Close #3528
10 months ago
Junegunn Choi d7d2ac3951
0.44.1 11 months ago
Junegunn Choi 38e3694d1c
Revert "Sixel and Kitty image support on Windows binary (#2544)"
This reverts commit 68db9cb499.
11 months ago
Junegunn Choi 230fc49ae2
(Experimental) Add support for iTerm2 inline image protocol
Close #1102

  fzf --preview 'imgcat -W $FZF_PREVIEW_COLUMNS -H $FZF_PREVIEW_LINES {}'

Notes:
* There is no good way to determine the height of the rendered image,
  so we assume that the image takes the full height of the preview
  window. So the image cannot be displayed with the other text.
* fzf-preview.sh script was updated to use `imgcat` if it's available
  but `chafa` is not.
* iTerm2 also supports Sixel, so adding support for this protocol is not
  quite necessary but it renders animated GIFs much better (e.g. looping).
12 months ago
Junegunn Choi 250d507bdf
Fix a typo on CHANGELOG 12 months ago
Junegunn Choi a818653174
Add --listen-unsafe=ADDR to allow remote process execution (#3498) 12 months ago
Junegunn Choi 3f78d76da1
Allow accepting remote connections
Close #3498

  # FZF_API_KEY is required for a non-localhost listen address
  FZF_API_KEY=xxx fzf --listen 0.0.0.0:6266
12 months ago
Junegunn Choi 68db9cb499
Sixel and Kitty image support on Windows binary (#2544) 12 months ago
Junegunn Choi 3277e8c89c
Remove $FZF_PREVIEW_PIXEL_{WIDTH,HEIGHT} (#2544)
They are not neccessary because we can use a program such as chafa that
can resize images by the terminal columns and lines.
12 months ago
Junegunn Choi d02b9442a5
(Experimental) Improve Sixel graphics support (#2544)
Progress:

* Sixel image can now be displayed with other text, and is scrollable
* If an image can't be displayed entirely due to the scroll offset, fzf
  will render a wireframe to indicate that an image should be displayed
* Renamed $FZF_PREVIEW_{WIDTH,HEIGHT} to $FZF_PREVIEW_PIXEL_{WIDTH,HEIGHT}
  for clarity
* Added bin/fzf-preview.sh script to demonstrate how to display an image
  using Kitty or Sixel protocol

An example:

  ls *.jpg | fzf --preview='seq $((FZF_PREVIEW_LINES*9/10)); fzf-preview.sh {}; seq 100'

A known issue:

* If you reduce the size of the preview window, the image may extend
  beyond the preview window
12 months ago
Junegunn Choi b1a0ab8086
Experimental Sixel support (#2544) 1 year ago
Junegunn Choi d3311d9f43
0.43.0 1 year ago
Junegunn Choi 404b6a864b
Add offset-up and offset-down
# Scrolling will behave similarly to CTRL-E and CTRL-Y of vim
  fzf --bind scroll-up:offset-up,scroll-down:offset-down \
      --bind ctrl-y:offset-up,ctrl-e:offset-down \
      --scroll-off=5

Close #3456
1 year ago
Junegunn Choi 391aa14845
Add mouse events for --bind
Close #3473
1 year ago
Junegunn Choi 2952737755
Update README: Experimental support for Kitty graphics protocol 1 year ago
Junegunn Choi d8188fce7b
Experimental support for Kitty image protocol in preview window
Close #3228

* Works inside and outside of tmux
* There is a problem where fzf unnecessarily displays the scroll offset
  indicator at the topbright of the screen when the image just fits the
  preview window. This is because `kitty icat` generates an extra line
  after the image area.

    # A 5-row images; an extra row at the end confuses fzf
    ["\e_Ga ... \e[9C􎻮̅̅ࠪ􎻮̅̍ࠪ􎻮̅̎ࠪ􎻮̅̐ࠪ􎻮̅̒ࠪ􎻮̅̽ࠪ􎻮̅̾ࠪ􎻮̅̿ࠪ􎻮̅͆ࠪ􎻮̅͊ࠪ􎻮̅͋ࠪ\n",
     "\r\e[9C􎻮̍̅ࠪ􎻮̍̍ࠪ􎻮̍̎ࠪ􎻮̍̐ࠪ􎻮̍̒ࠪ􎻮̍̽ࠪ􎻮̍̾ࠪ􎻮̍̿ࠪ􎻮̍͆ࠪ􎻮̍͊ࠪ􎻮̍͋ࠪ\n",
     "\r\e[9C􎻮̎̅ࠪ􎻮̎̍ࠪ􎻮̎̎ࠪ􎻮̎̐ࠪ􎻮̎̒ࠪ􎻮̎̽ࠪ􎻮̎̾ࠪ􎻮̎̿ࠪ􎻮̎͆ࠪ􎻮̎͊ࠪ􎻮̎͋ࠪ\n",
     "\r\e[9C􎻮̐̅ࠪ􎻮̐̍ࠪ􎻮̐̎ࠪ􎻮̐̐ࠪ􎻮̐̒ࠪ􎻮̐̽ࠪ􎻮̐̾ࠪ􎻮̐̿ࠪ􎻮̐͆ࠪ􎻮̐͊ࠪ􎻮̐͋ࠪ\n",
     "\r\e[9C􎻮̒̅ࠪ􎻮̒̍ࠪ􎻮̒̎ࠪ􎻮̒̐ࠪ􎻮̒̒ࠪ􎻮̒̽ࠪ􎻮̒̾ࠪ􎻮̒̿ࠪ􎻮̒͆ࠪ􎻮̒͊ࠪ􎻮̒͋ࠪ\n",
     "\r\e[39m\e8"]

* Example:

  fzf --preview='
    if file --mime-type {} | grep -qF 'image/'; then
      # --transfer-mode=memory is the fastest option but if you want fzf to be able
      # to redraw the image on terminal resize or on 'change-preview-window',
      # you need to use --transfer-mode=stream.
      kitty icat --clear --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 {}
    else
      bat --color=always {}
    fi
  '
1 year ago
Junegunn Choi 00809909ae
Update CHANGELOG 1 year ago
Junegunn Choi 0f50dc848e
Add 'GET /' endpoint for getting the program state (experimental)
Related #3372
1 year ago
Junegunn Choi f50a7058d6
Fix center-alignment of border/preview label
Fix #3421
1 year ago
Junegunn Choi ffd2314120
Restore --no-clear option in man page
Close #3411
1 year ago
Junegunn Choi f83491274f
Add toggle-header option
Close #3358
1 year ago
Boaz Yaniv c0435fdff4
Add API Keys for fzf --listen (#3374) 1 year ago
Junegunn Choi d471067e3f
0.42.0 1 year ago
Junegunn Choi d0b7780239
Add --info=right
Related: #3322
1 year ago
Junegunn Choi e627ca6bd7
Add --info=inline-right
Close #3322
1 year ago
Mike ce8a745fb4
Add new border style: 'thinblock' (#3327)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
1 year ago
Junegunn Choi 6eb1874c5a
0.41.1 1 year ago
Junegunn Choi 098ef4d7cf
0.41.0 1 year ago
Junegunn Choi 17a13f00f8
Allow customizing scrollbar of the preview window via --scrollbar=xy 1 year ago
Junegunn Choi 43436e48e0
Add new border style: 'block' 1 year ago
Junegunn Choi e619b7c4f4
Fix the background color of the scrollbar inside the preview window 1 year ago
Junegunn Choi b7c2e8cb67
Fix caching when reload and query change triggered by the same binding 1 year ago
Junegunn Choi cf95e44cb4
Add 'zero' event
Close #3263
2 years ago
Junegunn Choi 65dd2bb429
Add 'track' action 2 years ago
Junegunn Choi 6be855be6a
Add change-header and transform-header
Close #3237
2 years ago
Junegunn Choi b6e3f4423b
[man] Suggest setting RUNEWIDTH_EASTASIAN to 0 or 1
Close #2389
2 years ago
Junegunn Choi 0c61d81713
Add toggle-track action 2 years ago
Junegunn Choi 7c6f5dba63
Fixed --track when used with --tac
Fix #3234
2 years ago
Junegunn Choi 96670d5f16
Disallow using --track with --tac
Close #3234
2 years ago
Junegunn Choi 8ec917b1c3
Add 'one' event
Close #2629
Close #2494
Close #459
2 years ago
Junegunn Choi 1c7534f009
Add --track option to track the current selection
Close #3186
Related #1890
2 years ago
Junegunn Choi d7daf5f724
Render CR and LF as ␍ and ␊
Close #2529
2 years ago
Junegunn Choi fcd7e8768d
Omit port number in `--listen` for automatic port assignment
Close #3200
2 years ago
Junegunn Choi 352ea07226
0.38.0 2 years ago
Junegunn Choi 27018787af
Describe become(...) action and use it to simplify examples 2 years ago
Junegunn Choi 6ea38b4438
Add become(...) action that replaces current fzf process
Close #3159
2 years ago
Junegunn Choi aa2b9ec476
Add 'show-preview' and 'hide-preview'
For cases where 'toggle-preview' is not enough
2 years ago
Junegunn Choi fccab60a5c
`--preview-window 0,hidden` should not execute the preview command
Until `toggle-preview` action is triggered

Fix #3149
2 years ago
Junegunn Choi 2023012408
0.37.0 2 years ago
Junegunn Choi 618d317803
Support custom separator of inline info
Close #2030
Close #3084
2 years ago
Junegunn Choi 284d77fe2e
Add 'focus' event
Can we find a better name? I have considered the followings.

* 'point', because "the pointer" points to the current item.
* 'shift', 'switch', 'move', etc. These are not technically correct
  because the current item can change without cursor movement (--tac,
  reload, search update)
* 'change' is already taken. 'change-current' feels a bit wordy and
  sounds wrong, 'current-changed' is wordy and doesn't go well with the
  other event names
* 'target', not straightforward

Close #3053
2 years ago
Junegunn Choi d51980a3f5 Add 'transform-border-label' and 'transform-preview-label' 2 years ago
Junegunn Choi b077f6821d
Action argument in enclosed form should allow new lines
Close #3138
2 years ago
Junegunn Choi b46e40e86b
[vim] Automatically set RUNEWIDTH_EASTASIAN=1 when &ambiwidth == double 2 years ago
Junegunn Choi 0c5956c43c
Better support for Windows terminals
* Default border style on Windows is changed to `sharp` because some
  Windows terminals are not capable of displaying `rounded` border
  characters correctly.
* If your terminal emulator renders each box-drawing character with
  2 columns, set `RUNEWIDTH_EASTASIAN` environment variable to `1`.
2 years ago
Junegunn Choi e97e925efb
Resume preview following if the user scrolls the window to the bottom 2 years ago
Junegunn Choi 3b2244077d
Add scrollbar to the preview window 2 years ago
Junegunn Choi 435d8fa0a2
Colors for 'separator' and 'scrollbar' will default to that for 'border' 2 years ago
Junegunn Choi 5cd6f1d064
Add scrollbar
Close #3096
2 years ago
Junegunn Choi 62c7f59b94
Add transform-prompt(...) action 2 years ago
Junegunn Choi e97176b1d7
Update transform-query examples for zsh
Close #3107
2 years ago
Junegunn Choi d649f5d826
Always execute preview command if {q} is in the template
Even when {q} is empty. Because, why not?

While this can be seen as a breaking change, there is an easy workaround
to keep the old behavior.

    # This will show // even when the query is empty
    : | fzf --preview 'echo /{q}/'

    # But if you don't want it,
    : | fzf --preview '[ -n {q} ] || exit; echo /{q}/'

Close #2759
2 years ago
Junegunn Choi 6c37177cf5
Add reload-sync action
Close #2816
2 years ago
Junegunn Choi 14775aa975
Add 'load' event that is triggered when the input stream is complete
and the first search (with or without query) is complete
2 years ago
Junegunn Choi 36d2bb332b
Add transform-query(...) action
Test case authored by @SpicyLemon

Close #1930
Close #2465
Close #2559
Close #2509 (e.g. fzf --bind 'space:transform-query:printf %s%s {q} {}')
2 years ago
Junegunn Choi 4b3f0b9f08
Allow put action with an argument i.e. put(...) 2 years ago
Junegunn Choi 12af069dca
Add pos(...) action to move the cursor to the numeric position
# Put the cursor on the 10th item
  seq 100 | fzf --sync --bind 'start:pos(10)'

  # Put the cursor on the 10th to last item
  seq 100 | fzf --sync --bind 'start:pos(-10)'

Close #3069
Close #395
2 years ago
Junegunn Choi b7bb973118
Revert "Add GET endpoints for getting the state of the finder"
This reverts commit 750b2a6313.

This can cause a deadlock if the endpoints are accessed in the core event
loop via execute action.

  fzf --listen 6266 --bind 'space:execute:curl localhost:6266'

Technically, there's no reason to use the API because the information is
already available via `{}` and `{q}`, but I'd like to completely remove
the risk of misuse.
2 years ago
Junegunn Choi 750b2a6313
Add GET endpoints for getting the state of the finder
* GET / (or GET /current)
* GET /query
2 years ago
Junegunn Choi 1ba7484d60 Add --listen=HTTP_PORT option to receive actions
Supersedes #2019

See also:
* #1728
* https://github.com/junegunn/fzf.vim/pull/1044
2 years ago
Junegunn Choi 51c518da1e
Add change-query(...) action 2 years ago
Junegunn Choi 18e3b38c69
Add 'next-selected' and 'prev-selected' actions
Close #2749
2 years ago
Junegunn Choi 3d2376ab52
Add color name 'preview-label' (#3053) 2 years ago
Junegunn Choi 6b207bbf2b
Fix inconsistent bonus points in exact match
Exact match would assign a different bonus point to the first character
when non-default --scheme was used.

Fix #3073
2 years ago
Junegunn Choi 8f4c89f50e
Make 'double-click' behave the same as 'enter' by default
Close #3061
2 years ago
Junegunn Choi a38b63be18
Fix mouse event above fzf finder
Fix #2949
2 years ago
Junegunn Choi 1bebd6f4f5
Fix panic on inverse match query with `--tiebreak=chunk`
Fix #3055
2 years ago
Junegunn Choi 8868d7d188
Add --separator to customize the info separator 2 years ago
Junegunn Choi 01ae621f11
Add --border=[bold|double] and --preview-window=border-[bold|double] 2 years ago
Junegunn Choi a29944660e
Fix typo in CHANGELOG 2 years ago
Junegunn Choi c09ec8e4d1
Allow putting border label on the bottom line
Related #3022
2 years ago
Junegunn Choi 31bbaad06e
Add --preview-label and --preview-label-pos
Close #3022
2 years ago