Commit Graph

367 Commits (b4ddffdc6167d23077139f5a24a2709097bc660c)

Author SHA1 Message Date
Junegunn Choi a4745626dd
Add jump and jump-cancel events
Close #3412

    # Default behavior
    fzf --bind space:jump

    # Same as jump-accept action
    fzf --bind space:jump,jump:accept

    # Accept on jump, abort on cancel
    fzf --bind space:jump,jump:accept,jump-cancel:abort

    # Change header on jump-cancel
    fzf --bind 'space:change-header(Type jump label)+jump,jump-cancel:change-header:Jump cancelled'
6 months ago
Junegunn Choi 62963dcefd
0.49.0 7 months ago
Junegunn Choi 8a2df79711
Do not hide separator by default on --info=inline-right|hidden 7 months ago
Matthieu Cneude f625c5aabe
Add environment variables: FZF_{BORDER,PREVIEW}_LABEL (#3693)
The environment variable get the value of the preview label, even if it
has been updated with an action. It can be useful to track the label of
the preview and be able to switch between previews using only one
binding.

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
7 months ago
Junegunn Choi 8a74976c1f
Add track-current, untrack-current, and toggle-track-current (#3699)
Close #3691
7 months ago
Junegunn Choi d579e335b5
0.48.1 7 months ago
Junegunn Choi 091b7eacba
0.48.0 7 months ago
Junegunn Choi e74b1251c0
Embed shell integration scripts in fzf binary (`--bash` / `--zsh` / `--fish`) (#3675)
This simplifies the distribution, and the users are less likely to have
problems caused by using incompatible scripts and binaries.

    # Set up fzf key bindings and fuzzy completion
    eval "$(fzf --bash)"

    # Set up fzf key bindings and fuzzy completion
    eval "$(fzf --zsh)"

    # Set up fzf key bindings
    fzf --fish | source
7 months ago
Junegunn Choi d282a1649d
Add walker options and replace 'find' with the built-in walker (#3649) 7 months ago
Junegunn Choi 98ee5e651a
0.47.0 7 months ago
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 3c0a630475
0.46.1 9 months ago
Junegunn Choi beb2de2dd9
0.46.0 9 months ago
Junegunn Choi 7484292e63
Avoid deadlocks by adding a 2 second timeout to GET / endpoint
Because fzf processes HTTP GET requests in the main event loop,
accessing the endpoint from within execute/transform actions would
result in a deadlock and hang fzf indefinitely. This commit sets
a 2 second timeout to avoid the deadlock.
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 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 c36a64be68
Add accept-or-print-query
Close #3528
10 months ago
Junegunn Choi d7d2ac3951
0.44.1 11 months ago
Junegunn Choi 7320b7df62
0.44.0 11 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 21ab64e962
sixel: Export $FZF_PREVIEW_TOP to the preview command (#2544)
So that it can determine if it should subtract 1 from $FZF_PREVIEW_LINES
to avoid scrolling issue of Sixel image that touches the bottom of the
screen.
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 0f50dc848e
Add 'GET /' endpoint for getting the program state (experimental)
Related #3372
1 year ago
Junegunn Choi ffd2314120
Restore --no-clear option in man page
Close #3411
1 year ago
Junegunn Choi 11e56403dd
[man] Clarify --scheme option
Close #3387
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 a7c41f3fcd
Add '--info=right' to the man page
Close #3333
1 year ago
Junegunn Choi d471067e3f
0.42.0 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
Syphdias 37f258b1bf
Add key combinations for ctrl-delete and shift-delete (#3284)
Currently there is not option to bind ctrl-delete and shift-delete. As
suggested by issue #3240, shift-delete could be used to bind "delete
entry from history" as it is a common way to do so in other
applications, e.g. browsers.

This, however, does only implement to use the key combination itself and
does not assign a default action to any of them. This does enable to
call one's all predefined actions. With the exec action this can
expanded like the issue #3240 suggested.
If desirable, the key combinations could later get a default behavior.

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
1 year ago
Junegunn Choi 17a13f00f8
Allow customizing scrollbar of the preview window via --scrollbar=xy 1 year ago
Junegunn Choi 5a39102405
Allow customizing the color of preview scrollbar via 'preview-scrollbar' 1 year ago
Junegunn Choi fb76893e18
0.40.0 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 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 20230402d0
0.39.0 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 fcd7e8768d
Omit port number in `--listen` for automatic port assignment
Close #3200
2 years ago
Zhizhen He 3364d4d147
Add spell check workflow (#3183) 2 years ago
Junegunn Choi 352ea07226
0.38.0 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 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
jpcrs c3d73e7ecb Add change-border-label and change-preview-label actions, update man 2 years ago
Junegunn Choi 2023011763
0.36.0 2 years ago
Junegunn Choi 3109b865d2
Fix typo on man page 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 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 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 4dbe45640a
Remove $FZF_LISTEN_PORT
It is not worth the added complexity.
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 73162a4bc3
Rewrite bind spec parser 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 0ad30063ff
Rename previous-history to prev-history
previous-history is still supported for backward compatibility
2 years ago
Junegunn Choi 3d2376ab52
Add color name 'preview-label' (#3053) 2 years ago
Junegunn Choi b55f555487
0.35.1 2 years ago
Bruno Heridet 3da63f394d
doc(man): complete the definition of what --no-unicode impacts (#3054) 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 c09ec8e4d1
Allow putting border label on the bottom line
Related #3022
2 years ago
Junegunn Choi b9ca1fe830
Add horizontal separator after info panel (counter)
Close #3029
2 years ago
Junegunn Choi e61585f2f3
Add --border-label and --border-label-pos
Close #3022
2 years ago
Junegunn Choi 168829b555
Add 'start' event that is triggered once when fzf finder starts
Close #1622
2 years ago
Bruno Heridet cefa6b9878
doc(man): add a hint about which UI element is the finder info (#2991)
While reading the description of the --info flag, it's not
immediately obvious that the "finder info" is in fact the
UI element representing the match counters.
2 years ago