Age | Commit message (Collapse) | Author |
|
`-fstype dev` is invalid. It's devfs on macOS and devtmpfs on Linux.
|
|
|
|
It doesn't short circuit like we expect, causing trouble when $dir is
empty
Use shell builtin instead
|
|
|
|
Handle uppercase letters in program names. This also deals with `-` and
`.`, both of which are quite common in program names, e.g., `xdg-open`
and `foo.sh`.
|
|
The command substitution and following word splitting to determine the default
zle widget for ^I formerly only works if the IFS parameter contains a space. Now
it specifically splits at spaces, regardless of IFS.
|
|
Close #607
|
|
Close #615
|
|
Related: #616
|
|
|
|
Close #611
|
|
zle automatically calls zle-line-init when it starts to read a new line. Many
Zsh setups use this hook to set the terminal into application mode, since this
will then allow defining keybinds based on the $terminfo variable (the escape
codes in said variable are only valid in application mode).
However, fzf resets the terminal into raw mode, rendering $terminfo values
invalid once the widget has finished. Accordingly, keyboard bindings defined
via $terminfo won’t work anymore.
This fixes the issue by calling zle-line-init when widgets finish. Care is taken
to not call this widget when it is undefined.
Fixes #279
|
|
This allows to have a custom widget like the following, which would
additionally accept the line, but only in case of entries being
selected:
fzf-file-widget-with-accept() {
zle fzf-file-widget
if [[ "$?" == 0 ]] && (( $#BUFFER )); then
zle accept-line
fi
}
zle -N fzf-file-widget-with-accept
bindkey '\e^T' fzf-file-widget-with-accept
With this `<C-a>t` will launch fzf, and simulate the pressing of "Enter"
afterwards.
|
|
Close #596
|
|
|
|
|
|
|
|
Signed-off-by: Junegunn Choi <junegunn.c@gmail.com>
|
|
Close #580
|
|
|
|
|
|
e.g. Remapping fzf-file-widget to CTRL-X CTRL-T intead of CTRL-T
bind -x '"\C-x\C-t": fzf-file-widget'
bind '"\C-t": transpose-chars'
|
|
- fzf-file-widget
- fzf-history-widget
- fzf-cd-widget
|
|
Related: 23244bb
|
|
[bash] Update completion.bash
|
|
Faster startup. Use internal bash globbing instead of external grep binary (adapter from Gentoo's `/etc/bash/bashrc` TERM checking). Insignificant on Linux, but on Cygwin this cuts startup time by 40 ms on my Core i7 laptop.
|
|
Fixes #548. Avoid using a subshell in _fzf_defc().
|
|
|
|
Summary:
Fix adapted from [@adamheins: fzf, vi-mode, and fixing delays][1].
[1]: https://adamheins.com/blog/fzf-vi-mode-and-fixing-delays
The basic problem is that
fzf presses <Esc> to enter vi-movement-mode
(as opposed to insert mode)
and then presses a bunch of keys to set up the buffer.
But the <Esc> keypress is also the prefix for a bunch of other commands,
so Bash will dutifully wait an excruciating half-second
before actually executing this command.
Instead, we bind <C-x><C-a>, which is unused by default
and seems reasonably unlikely to be custom-bound,
to be another way to enter vi-movement-mode;
this binding is unambiguous, so fzf can use it without delay.
This change was made by just `:s/\\e/\\C-x\\C-a/gc`
in the relevant section,
after adding the actual binding and comment at the top.
|
|
|
|
|
|
Close #526
|
|
Close #516
|
|
|
|
|
|
|
|
e.g.
_fzf_complete_foo() {
_fzf_complete "--multi --reverse --header-lines=3" "$@" < <(
ls -al
)
}
_fzf_complete_foo_post() {
awk '{print $NF}'
}
[ -n "$BASH" ] && complete -F _fzf_complete_foo -o default -o bashdefault foo
|
|
Notes:
- You can now override _fzf_compgen_path and _fzf_compgen_dir functions
to use custom commands such as ag instead of find for listing
completion candidates.
- The first argument is the base path to start traversal
- Removed file-only completion in bash, i.e. _fzf_file_completion.
Maintaining a list of commands that only expect files, not
directories, is cumbersome (there are too many) and error-prone.
TBD:
- Added $FZF_COMPLETION_DIR_COMMANDS to customize the list of commands
which use directory-only completion. The default is "cd pushd rmdir".
Not sure if it's the best approach to address the requirement, I'll
leave it as an undocumented feature.
Related: #406 (@thomcom), #456 (@frizinak)
|
|
This seems like a bug of fish, but sometimes when you select an item
fish complains:
"insertion mode switches can not be used when not in insertion mode"
This only happens when using tmux pane. Injecting a dummy command
somehow fixes the issue.
|
|
|
|
Close #456 and #457
|
|
|
|
Instead of choosing one at initialization, choose the correct one
when it's actually called, so that the behavior is correct even after
resizing.
Bonus fixes for tmux with bash 4+:
- No extra space when cancelling CTRL-T.
- Fix cursor position problem in vi mode.
|
|
- Don't assume ~/.fzf.bash exists.
- Source the current script for __fzf_select__.
- Forward $PATH.
|
|
This also fixes the completion causing a bell / flickering in case
"shwordsplit" was not set, because then the function would return false.
|
|
|
|
|
|
|
|
|
|
|