replace-query action replaces the query string with the current
selection. If the selection is too long, it will be truncated.
If the line contains meta-characters of fzf search syntax, it is
possible that the line is no longer included in the updated result.
e.g.
echo '!hello' | fzf --bind ctrl-v:replace-query
Close#1137
In #1061 we changed the default command to retry with a simpler find
command with fewer arguments if the first find command failed. This was
to support stripped-down verions of find that do not support -fstype
argument.
However, this caused an unwanted side-effect of yielding duplicate
entries when the first command failed after producing some lines.
We revert the change in this commit, so the default command will not
work with find without -fstype support. But we now print better error
message in that case so that the user can set up a working
$FZF_DEFAULT_COMMAND.
Close#1120#1167
Close#1018
Run the command as is in cmd.exe with no parsing and escaping.
Explicity set cmd.SysProcAttr so execCommand does not escape the command.
Technically, the command should be escaped with ^ for special characters,
including ". This allows cmd.exe commands to be chained together.
See https://github.com/neovim/neovim/pull/7343#issuecomment-333350201
This commit also updates quoteEntry to use strings.Replace instead of
strconv.Quote which escapes more than \ and ".
Remove code that is no longer relevant after the removal of ncurses
renderer. This commit also fixes background color issue on tcell-based
FullscreenRenderer (Windows).
One can escape meta characters in extended-search mode with backslashes.
Prefixes:
\'
\!
\^
Suffix:
\$
Term separator:
\<SPACE>
To keep things simple, we are not going to support escaping of escaped
sequences (e.g. \\') for matching them literally.
Since this is a breaking change, we will bump the minor version.
Close#444
When --with-nth is used, fzf used to preprocess each line and store the
result as rune array, which was wasteful if the line only contains ascii
characters.
By not storing item index twice, we can cut down the size of Result
struct and now it makes more sense to store and pass Results by values.
Benchmarks show no degradation of performance by additional pointer
indirection for looking up index.
Do not automatically decide to use alternate screen when the value of
height exceeds the height of the terminal.
# Use alternate screen
fzf
fzf --height 100%
fzf --no-height
# Still use current screen
fzf --height 10000
- Move cursor to the top-left corner when starting a command in
alternate screen
- Fix cursor position when returning to alternate screen when fzf is
running in full screen mode
- Fix display of CJK wide characters
- Fix horizontal offset of header lines
- Add support for keys with ALT modifier, shift-tab, page-up and down
- Fix util.ExecCommand to properly parse command-line arguments
- Fix redraw on resize
- Implement Pause/Resume for execute action
- Remove runtime check of GOOS
- Change exit status to 2 when tcell failed to start
- TBD: Travis CI build for tcell renderer
- Pending. tcell cannot reliably ingest keys from tmux send-keys
Close#669
You can use your mouse or binadble preview-up and preview-down actions
to scroll the content of the preview window.
fzf --preview 'highlight -O ansi {}' --bind alt-j:preview-down,alt-k:preview-up
Use hard-coded limit to keep it simple. An alternative is to dynamically
calculate the width of the visible area and use it as the limit, but it
can cause unwanted truncation of the query on screen resize/split.
- Make structs smaller
- Introduce Result struct and use it to represent matched items instead of
reusing Item struct for that purpose
- Avoid unnecessary memory allocation
- Avoid growing slice from the initial capacity
- Code cleanup
In the best case (all ascii), this reduces the memory footprint by 60%
and the response time by 15% to 20%. In the worst case (every line has
non-ascii characters), 3 to 4% overhead is observed.
- Slightly more efficient processing of Options
- Do not return reference type arguments that are mutated inside the
function
- Use util.Constrain function when appropriate
Note that $SHELL only points to the default shell instead of the current
shell. If you're on a non-default shell, you might want to override the
value like follows.
SHELL=zsh fzf --bind 'enter:execute:echo $ZSH_VERSION; sleep 1'
fzf defers the initial rendering of the screen up to 100ms if the input
stream is ongoing to prevent unnecessary redraw during the initial
phase. However, 100ms delay is quite noticeable and might give the
impression that fzf is not snappy enough. This commit reduces the
maximum delay down to 20ms when --tac is not specified, in which case
the input list quickly fills the entire screen.
Related: #452
When `--multi` is set, tab key will bring your cursor down, and
shift-tab up. But since fzf by default draws the screen in bottom-up
fashion, one may feel that the opposite of the behavior is more
desirable and choose to customize the key bindings as follows.
export FZF_DEFAULT_OPTS="--bind tab:toggle-up,shift-tab:toggle-down"
This configuration, however, becomes no longer straightforward when
`--reverse` is set and fzf switches to top-down layout. To address the
requirement, this commit adds `toggle-in` and `toggle-out` option which
switch direction depending on `--reverse`-ness.
export FZF_DEFAULT_OPTS="--bind tab:toggle-out,shift-tab:toggle-in"
- Add `--history` option (e.g. fzf --history ~/.fzf.history)
- Add `--history-max` option for limiting the size of the file (default 1000)
- Add `previous-history` and `next-history` actions for `--bind`
- CTRL-P and CTRL-N are automatically remapped to these actions when
`--history` is used
Closes#249, #251
- dark: the current default for 256-color terminal
- light: color scheme for 256-color terminal with light background
- 16: the default color scheme for 16-color terminal (`+2`)
- bw: no colors (`+c`)
I profiled fzf and it turned out that it was spending significant amount
of time repeatedly converting character arrays into Unicode codepoints.
This commit greatly improves search performance after the initial scan
by memoizing the converted results.
This commit also addresses the problem of unbounded memory usage of fzf.
fzf is a short-lived process that usually processes small input, so it
was implemented to cache the intermediate results very aggressively with
no notion of cache expiration/eviction. I still think a proper
implementation of caching scheme is definitely an overkill. Instead this
commit introduces limits to the maximum size (or minimum selectivity) of
the intermediate results that can be cached.