0.52.0

junegunn/fzf0.52.0May 7, 2024by junegunn

Upgrading?

Release notes summary

Introduced visual enhancements like full line highlighting and color customization for selected lines, along with a new click-header event and environment variables for completion customization.

Key Highlights

  • Added `--highlight-line` to highlight the whole current line.
  • Added color names for selected lines: `selected-fg`, `selected-bg`, and `selected-hl`.
  • Added `click-header` event with `$FZF_CLICK_HEADER_COLUMN` and `$FZF_CLICK_HEADER_LINE` variables.
  • Added `$FZF_COMPLETION_{DIR,PATH}_OPTS` for separately customizing directory and path completion.
  • Refactored code to allow using fzf as a library in Go programs.

New Features

  • --highlight-line
  • selected-fg, selected-bg, selected-hl colors
  • click-header event
  • $FZF_COMPLETION_DIR_OPTS
  • $FZF_COMPLETION_PATH_OPTS

Full Release Notes

- Added `--highlight-line` to highlight the whole current line (à la `set cursorline` of Vim)
- Added color names for selected lines: `selected-fg`, `selected-bg`, and `selected-hl`
  ```sh
  fzf --border --multi --info inline-right --layout reverse --marker ▏ --pointer ▌ --prompt '▌ '  \
      --highlight-line --color gutter:-1,selected-bg:238,selected-fg:146,current-fg:189
  ```
    <img width="777" alt="image" src="https://github.com/junegunn/fzf/assets/700826/fd8a2728-2fcb-4a88-a76d-7984e79ab510">
- Added `click-header` event that is triggered when the header section is clicked. When the event is triggered, `$FZF_CLICK_HEADER_COLUMN` and `$FZF_CLICK_HEADER_LINE` are set.
  ```sh
  fd --type f |
    fzf --header $'[Files] [Directories]' --header-first \
        --bind 'click-header:transform:
          (( FZF_CLICK_HEADER_COLUMN <= 7 )) && echo "reload(fd --type f)"
          (( FZF_CLICK_HEADER_COLUMN >= 9 )) && echo "reload(fd --type d)"
        '
  ```
- Added `$FZF_COMPLETION_{DIR,PATH}_OPTS` for separately customizing the behavior of directory and path completion
  ```sh
  # Set --walker options without 'follow' not to follow symbolic links
  FZF_COMPLETION_PATH_OPTS="--walker=file,dir,hidden"
  FZF_COMPLETION_DIR_OPTS="--walker=dir,hidden"
  ```
- Fixed Windows argument escaping
- Bug fixes and improvements
- The code was heavily refactored to allow using fzf as a library in Go programs. The API is still experimental and subject to change.
    - https://gist.github.com/junegunn/193990b65be48a38aac6ac49d5669170

Related Repositories