Commit Graph

159 Commits (0fdb71f7e4a2bb7f65c53ee905a74eb4ae0cfd44)

Author SHA1 Message Date
Junegunn Choi 12ce76b56a
[bash] Make sure to execute builtin history
Fix #1592
5 years ago
Jesus Briales 03e8ed4d88 [bash-completion] Fix custom completion with dynamic loader enabled for non-standard command names (#1564)
Related to #1170.

Fix the solution for commands with non-standard names
where `$cmd` and `$orig_cmd` differ. e.g. `s.foo` -> `s_foo`
5 years ago
Junegunn Choi 309bae423c
[zsh-completion] Suppress "no matches found" message 5 years ago
Rui Coelho 3bd8441079
[completion] Look up on ~/.ssh/config.d/* files when doing ssh host complete (#1420) 5 years ago
Junegunn Choi 8cf45a5197
[shell] Skip loading completion code on non-interactive shell
This change is not required if you use the install script to generate
~/.fzf.bash or ~/.fzf.zsh which already has the proper guard statement.

Close #1474
5 years ago
Paul Frybarger fd8d371ac7 [zsh] Fix multiline prompt issue with 'zle reset-prompt' (#1397)
Close #867 
Close #1256
6 years ago
Jay 6de1ad9d3d [completion] Filter out non-hostnames in SSH config file (#1329)
* Correctly exclude SSH config options with Host

SSH config files have 14 options containing 'Host'.
Previously The zsh and bash completion scripts would include lines
containing these options when doing command-line completion of SSH hosts
with `ssh **`.

This commit fixes that problem by only including lines with 'host '.

* Don't autocomplete SSH hostnames using ?

SSH config files support ? as well as * for wildcards in Host lines.
This commit excludes lines containing ? for zsh/bash command line
completeion using `ssh **`
6 years ago
Oliver Schrenk 5004ae3457 [fish] Use $version instead of $FISH_VERSION (#1100)
$FISH_VERSION is dropped in 2.7, but every version has $version

- https://github.com/fish-shell/fish-shell/issues/4414
- fb8ae04f80

Comment from @faho in #1316:

Unfortunately, $FISH_VERSION was only ever a thing from fish 2.0 to fish 2.7.1.

All fish versions from the very beginning though used a variable called simply "$version" to store their version, so that is the one that should be used.
6 years ago
ptzz 2b19c0bc68 [bash/zsh] Fix missing fuzzy completions (#1303)
* [bash/zsh] Fix missing fuzzy completions

`cat foo**<TAB>` did not display the file `foobar` if there was a directory
named `foo`.

Fixes #1301

* [zsh] Evaluate completion prefix

  cat $HOME**
  cat ~username**
  cat ~username/foo**
6 years ago
ptzz 1fb0fbca58 [bash] Do not print error when falling back to default completion (#1279)
Fixes #1278
6 years ago
Junegunn Choi 87504a528e
[bash] Fix infinite loop on tab completion
awk may not set OFS to match FS depending on the implementation.

Close #1227
6 years ago
Junegunn Choi 89de1340af
[bash] Add --sync to the default CTRL-R options
This compensates the use of --tac. fzf will not render on the screen
until the complete list of commands are loaded.
6 years ago
Avindra Goolcharan 7add75126d ZSH and Bash completion: remove shebang (#1248)
Shebangs are only for files that are directly executable. In cases
where files are only sourced (such as completion scripts), these
are unneeded.
6 years ago
Junegunn Choi 3f868fd792
[bash] Fix CTRL-R to preserve the latest yank
Close #1216

1. Append a single space so that step 3 won't fail
2. CTRL-E to move to the end of the line
3. CTRL-U to delete the whole line before the cursor
4. CTRL-Y to paste the deleted line
5. ESC+Y to rotate the kill ring and bring back the previous yank before step 3
6. CTRL-U to delete the whole line again
7. Paste `__fzf_history__`
8. ESC+CTRL-E to expand the command substitution
9. ESC+R to redraw the line
10. ESC+^ to expand the history entry (!NUMBER)
6 years ago
Junegunn Choi cce6aef557
[bash] Fix extra space issue of dynamic completion with 'nospace'
Close #1203
6 years ago
Junegunn Choi 93aeae1985
[bash] Trigger redraw-current-line before history-expand-line
Close #681
7 years ago
Junegunn Choi d6588fc835
[bash-completion] Fix custom completion with dynamic loader enabled
After _completion_loader is called, instead of loading the entire
completion.bash file, just restore the fzf completion for the current
command. `_fzf_orig_completion_$cmd` is only set if _completion_loader
actually changed the completion options to avoid infinite loop.

Close #1170
7 years ago
Aaron Jensen 2cd0d4a9f7 [zsh] Fire zsh precmd functions after cd (#1136)
Fixes #915
7 years ago
Igor Urazov eaf6eb8978 [completion] Ensure ps called as command (#1098)
When `ps` is aliased for something uncommon, like `alias ps=grc ps` which colorizes ps output, the output of `ps` can be unexpected and/or undesired.

This change makes ps to be always executed as command, even if it's aliased.
7 years ago
Daniel Schaffrath 3af63bcf1f [zsh] Use fc -r instead of fzf --tac to speed up loadtime (#1097)
Reference: http://zsh.sourceforge.net/Doc/Release/Shell-Builtin-Commands.html

> The flag -r reverses the order of the events
7 years ago
Andrey Chernih 80a21f7a75 [completion] Fix known_hosts completion for custom port number (#1092)
Handles records like "[20.20.7.168]:9722 ssh-rsa ..."

This is a standard format for servers running on custom port according to http://man.openbsd.org/sshd.8#SSH_KNOWN_HOSTS_FILE_FORMAT

    A hostname or address may optionally be enclosed within ‘[’ and ‘]’
    brackets then followed by ‘:’ and a non-standard port number.
7 years ago
Ionel Cristian Mărieș 0580fe9046 Don't do shell quoting for weird chars (#1079)
* Don't do shell quoting for weird chars

This would prevent tabs from being escaped as `$'\t'` (definitely not what I would want to see as initial value in the search).

* Do different escape.
7 years ago
Josh Pencheon 45d4c57d91 [completion] Include host aliases in ssh completion (#1062) 7 years ago
Junegunn Choi 9d2c6a95f4
Revert "[bash] Do not append space when path completion is cancelled"
This reverts commit 376a76d1d3 as it
affects normal completion
7 years ago
Junegunn Choi 376a76d1d3
[bash] Do not append space when path completion is cancelled
Close #990
7 years ago
Tom Fitzhenry 7b5ccc45bc [fish] Fix ctrl-r regression in versions <2.4 (#972)
Close #966
7 years ago
John Nguyen 70cfa6af13 [fish] Accept starting dir for <M-c> key binding (#944)
This also modifies <C-t> behaviour.
The longest file path in the input is used as root directory for `find`
command. The remainder of the input is passed to fzf's --query as a
initial search parameters.
7 years ago
Tom Fitzhenry dbcaec59ae [fish] Support multiline commands (#954)
Fix found by @amosbird at https://github.com/junegunn/fzf/issues/953#issuecomment-310309055

closes #440
7 years ago
John Nguyen 1a68698d76 [fish] Fix <C-t> completion for current dir search (#946)
If "." is given as the argument to begin <C-t> completion, the leading
"." is not correctly removed. In general, if user selects a fzf
completion, the current token should be "consumed".
7 years ago
Junegunn Choi 842a73357c
[fish] Fix CTRL-T with paths that don't start with ./
Close #943
7 years ago
Junegunn Choi a5862d4b9c
[bash-completion] Use -o dirnames instead of -o plusdirs
Close #903
Related #135
7 years ago
Sam Van Den Berge 2ba10071c9 Add support for IPv6 addresses in ssh completion (#877)
Signed-off-by: Sam Van Den Berge <sam@drgt.net>
7 years ago
Junegunn Choi 337cdbb37c
[zsh] Use setopt noposixbuiltins instead of emulate -L zsh
Close #858
3a6af27586 (commitcomment-21135641)
7 years ago
Junegunn Choi 05fdf91fc5
Revert "[zsh] emulate -L zsh to avoid issues with incompatible options"
This reverts commit 3a6af27586.
7 years ago
Junegunn Choi c387689d1c
[shell] Enable sorting by default in CTRL-R
CTRL-R binding used to start with --no-sort to list the matched commands
in chronological order. However, it has been a constant source of
confusion. Let's enable it by default from now on. The sorted result
shouldn't be too confusing as we use --tiebreak=index.
7 years ago
Junegunn Choi 3a6af27586
[zsh] emulate -L zsh to avoid issues with incompatible options
Close #858
7 years ago
Junegunn Choi 11407bf656
Exclude sysfs in find commands 7 years ago
Pierre Neidhardt ce43ea9f42 [shell] Replace `sed` with `-mindepth 1` and `cut` (#844) 7 years ago
Daniel Gray afa25d8c57 [zsh] Do not cd when cancelling alt+c keybind (#840) 7 years ago
Junegunn Choi 95c77bfb98
Use --bind instead of --toggle-sort
Related #822
8 years ago
Junegunn Choi dbddee9de9
[fish] Add toggle-sort back to CTRL-R (#759) 8 years ago
Junegunn Choi d09ad13208
[zsh] Workaround trailing esacped space bug in go-shellwords
https://github.com/mattn/go-shellwords/issues/3

Close #812
8 years ago
Junegunn Choi 8ac37d5927
[shell] Do not override --reverse in CTRL-R
Close #807
8 years ago
Junegunn Choi 7ef0e50507
[bash/zsh] Remove unused --reverse in CTRL-R binding
Related #807
8 years ago
Junegunn Choi 44d3faa048
[completion] Restore --height option for kill completion 8 years ago
Junegunn Choi 208d4f2173
[shell] Make layout configurable via $FZF_DEFAULT_OPTS and $FZF_{KEY}_OPTS 8 years ago
Junegunn Choi dc3957ce79
[completion] Add preview window to kill completion 8 years ago
Junegunn Choi 4ecb7f3a16
Replace --normalize with --literal and enable normalization by default
Ref #790
8 years ago
Junegunn Choi 5b68027bee
Fix $FZF_COMPLETION_OPTS evaluation
Close #799
8 years ago
Junegunn Choi 1448d631a7
Add --height option 8 years ago