Age | Commit message (Collapse) | Author |
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
In the case that fzf-tmux returns a user-selected result but with a
non-zero exit status (which can happen if a function inside $PS1 returns
non-zero) this allows CTRL-R to continue working as expected.
Addresses #203 (Tranquility's comment)
|
|
|
|
Close #400
|
|
|
|
* _fzf_complete is the helper function for custom completion
* _fzf_complete FZF_OPTS ARGS
* Reads the output of the source command instead of the command string
* In zsh, you can use pipe to feed the data into the function, but
it's not possible in bash as by doing so COMPREPLY is set from the
subshell and thus nullified
* Change the naming convention for consistency:
* _fzf_complete_COMMAND
e.g.
# pass completion suggested by @d4ndo (#362)
_fzf_complete_pass() {
_fzf_complete '+m' "$@" < <(
local pwdir=${PASSWORD_STORE_DIR-~/.password-store/}
local stringsize="${#pwdir}"
find "$pwdir" -name "*.gpg" -print |
cut -c "$((stringsize + 1))"- |
sed -e 's/\(.*\)\.gpg/\1/'
)
}
# Only in bash
complete -F _fzf_complete_pass -o default -o bashdefault pass
|
|
While in bash you can externally register custom completion functions
using `complete` command, it was not possible to do so in zsh without
changing completion.zsh as the name of the supported commands are
hard-coded within the code (See #362). With this commit, fzf-completion
of zsh will first look if `_fzf_COMMAND_completion` exists and calls the
function, so one can externally define completion functions for specific
commands.
This commit also tries to make the interface of (yet undocumented)
_fzf_list_completion helper function consistent across bash and zsh.
So the following code works both on bash and zsh.
_fzf_pass_completion() {
local pwdir=${PASSWORD_STORE_DIR-~/.password-store/}
local stringsize="${#pwdir}"
let "stringsize+=1"
_fzf_list_completion '+m' "$@" << "EOF"
find "$pwdir" -name "*.gpg" -print | cut -c "$stringsize"- | sed -e 's/\(.*\)\.gpg/\1/'
EOF
}
# Only on bash
complete -F _fzf_pass_completion -o default -o bashdefault pass
Note that the suggested convention and the interface are not yet final
and subject to change.
/cc @d4ndo
|
|
Fixes #363.
|
|
and allow using --header and --header-lines at the same time.
Close #346.
|
|
|
|
|
|
Close #299
|
|
|
|
Note that it still can't handle properly multi-line commands.
Thanks to @jpcirrus for the bug report and the fix.
|
|
See http://unix.stackexchange.com/q/213432/120177
|
|
Close #40
|
|
Since we now use fzf-tmux instead of tmux split-window
|
|
ALT-C can fail with the following aliases as pointed out in #272
alias find='noglob find'
alias command='command '
|
|
|
|
In addition to being simpler, it allows subsequent up/down history
or accept-line-and-down-history widgets to work.
Also allow for find being and alias if alias expansion
after command is enabled.
|
|
- 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
|
|
|
|
|
|
|
|
Close #146
|
|
|
|
|
|
|
|
Close #233
setopt extendedglob on zsh caused caret in grep pattern to be expanded.
Problem identified and patch submitted by @lazywei.
|
|
|
|
|
|
|
|
|
|
|
|
at least my version of head wants -n1 to only display the first line
|