summaryrefslogtreecommitdiff
path: root/shell/completion.bash
AgeCommit message (Collapse)Author
2023-02-12[bash] Enable environment variable completion for printenvJunegunn Choi
Close #3145
2023-01-23Add Helix editor to bash autocompletion (#3137)Nachum Barcohen
2022-10-16[shell] Make bash/zsh completion and bindings work with 'set -u' (#2999)John Fred Fadrigalan
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2022-09-10[bash] Fix completion of var or alias containing newlines (#2952)knutze
* Fix bash completion var or aliase containing newlines * Support for various bash declare options Co-authored-by: knutze <shakte@gmail.com>
2022-08-22[completion] Remove extra trailing slash on directory completionJunegunn Choi
Fix #2931
2022-08-03[completion] ssh: Remove values with '%' (#2548)lbesnard
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2022-07-29[bash] Fix 'possible retry loop' problem of bash-completion (#2891)Bob Matcuk
Close #2474 Close #2583
2022-07-21[shell] 'kill' completion will now require trigger sequence (**)Junegunn Choi
'kill **<tab>' instead of 'kill <tab>' just like any other completions. Close #2716 Close #385
2022-07-15[bash] Fix `fzf-tmux` to have `fzf`'s completion (#2871)Jonathan Zacsh
2021-11-03[bash] Suppress error message from 'bind'Junegunn Choi
Fix #2618
2021-08-15always use [[ ... ]] and not [ ... ] in bash completionsa1346054
2021-01-01[shell] Disable CTRL-ZJunegunn Choi
Fix #2289
2020-11-14[bash-completion] Fix endless loop when completion.bash sourced twiceTomas Janousek
I forgot to add the "not _fzf" check into __fzf_orig_completion, so invoking it twice would rewrite the _fzf_orig_completion_xxx variables and then cause an endless loop when completion is requested. Fixes: ef2c29d5d497 ("[bash-completion] Optimize __fzf_orig_completion_filter")
2020-11-13[bash-completion] Unexport _fzf_orig_completion_* variablesTomas Janousek
2020-11-13[bash-completion] Optimize __fzf_orig_completion_filterTomas Janousek
Commit d4ad4a25 slowed loading of completion.bash significantly (on my laptop from 10 ms to 30 ms), then 54891d11 improved that (to 20 ms) but it still stands out as the heavy part of my .bashrc. Rewriting __fzf_orig_completion_filter to pure bash without forking to sed/awk brings this back under 10 ms. before: $ HISTFILE=/tmp/bashhist hyperfine 'bash --rcfile shell/completion.bash -i' Benchmark #1: bash --rcfile shell/completion.bash -i Time (mean ± σ): 21.2 ms ± 0.3 ms [User: 24.9 ms, System: 6.4 ms] Range (min … max): 20.7 ms … 23.3 ms 132 runs after: $ HISTFILE=/tmp/bashhist hyperfine 'bash --rcfile shell/completion.bash -i' Benchmark #1: bash --rcfile shell/completion.bash -i Time (mean ± σ): 9.6 ms ± 0.3 ms [User: 8.0 ms, System: 2.2 ms] Range (min … max): 9.3 ms … 11.4 ms 298 runs Fixes: d4ad4a25db5f ("[bash-completion] Fix default alias/variable completion") Fixes: 54891d11e09d ("[bash-completion] Minor optimization")
2020-11-13[bash-completion] Move -F/_fzf filter to __fzf_orig_completion_filterTomas Janousek
This prevents mistakes like the one fixed by the previous commit, and also speeds bash startup a tiny bit: before: $ HISTFILE=/tmp/bashhist hyperfine 'bash --rcfile shell/completion.bash -i' Benchmark #1: bash --rcfile shell/completion.bash -i Time (mean ± σ): 22.4 ms ± 0.6 ms [User: 28.7 ms, System: 7.8 ms] Range (min … max): 21.7 ms … 25.2 ms 123 runs after: $ HISTFILE=/tmp/bashhist hyperfine 'bash --rcfile shell/completion.bash -i' Benchmark #1: bash --rcfile shell/completion.bash -i Time (mean ± σ): 21.2 ms ± 0.3 ms [User: 24.9 ms, System: 6.4 ms] Range (min … max): 20.7 ms … 23.3 ms 132 runs
2020-11-13[bash-completion] Avoid empty _a, _v completionsTomas Janousek
This doesn't look right: $ complete | grep ' _.$' complete _a complete _v The __fzf_orig_completion_filter invocation in _fzf_setup_completion needs the /-F/ filter, just like all the other invocations. Fixes: d4ad4a25db5f ("[bash-completion] Fix default alias/variable completion")
2020-10-06[completion] Make host completion handle source files without EOLElvan Owen
2020-04-18Remove dead codeJunegunn Choi
2020-04-18[completion] Make kill completion more consistent with the othersJunegunn Choi
Support both ordinary completion trigger and empty trigger kill <tab> kill foo**<tab> Close #1988 Close #385
2020-04-03[fzf-tmux] Fall back to plain fzf when split failedJunegunn Choi
2020-04-03[fzf-tmux] Add option to start fzf in tmux popup windowJunegunn Choi
Requires latest tmux built from source (e.g. brew install tmux --HEAD) Examples: # 50%/50% width and height on the center of the screen fzf-tmux -p # 80%/80% fzf-tmux -p80% # 80%/40% fzf-tmux -p80%,40% # Separate -w and -h fzf-tmux -w80% -h40% # 80%/40% at position (0, 0) fzf-tmux -w80% -h40% -x0 -y0 You can configure key bindings and fuzzy completion to open in tmux popup window like so: FZF_TMUX_OPTS='-p 80%'
2020-03-11Change custom fuzzy completion APIJunegunn Choi
To make it easier to write more complex fzf options. Although this does not break backward compatibility, users are encouraged to update their code accordingly. # Before _fzf_complete "FZF_ARG1 FZF_ARG2..." "$@" < <( # Print candidates ) # After _fzf_complete FZF_ARG1 FZF_ARG2... -- "$@" < <( # Print candidates )
2020-03-07[completion] Use file redirection instead of pipeJunegunn Choi
This change allows the completion system of bash and zsh to return before the input process completes. Related #1887
2020-02-20[bash] Strip trailing whitespace on kill completionJunegunn Choi
2020-02-20[completion] Allow users to customize fzf options via _fzf_comprunJunegunn Choi
Related #1809 #1850
2020-02-19[bash-completion] Minor optimizationJunegunn Choi
2020-02-17Make pointer and multi-select marker customizable (#1844)Hiroki Konishi
Add --pointer and --marker option which can provide additional context to the user
2019-12-20[bash-completion] Fix default alias/variable completionJunegunn Choi
Fix #1795
2019-12-06[ssh completion] Skip only aliases matching * (#1788)Henré Botha
This commit fixes a bug where lines that declare multiple hostnames get omitted from completion entirely if one of the hostnames matches *. For example: Host foo.com bar.dev baz.*
2019-12-06[completion] Add support for HostName lines in ~/.ssh/config (#1785)David Gray
Close #1783
2019-12-05[completion] Ignore hg repos (#1777)John Purnell
* Update completion.bash * Update completion.zsh
2019-09-29[bash-completion] Properly handle exit eventJunegunn Choi
Related #1704
2019-08-09[bash-completion] _fzf_setup_completion to retain previous optionsJunegunn Choi
2019-08-08[bash-completion] Add _fzf_setup_completion to enable fuzzy completionJunegunn Choi
While we can attach `_fzf_path_completion` or `_fzf_dir_completion` to any command using the standard bash complete command, the functionality of the existing completion function is lost. Use _fzf_setup_completion if you want to extend the existing function with fuzzy completion instead of completely replacing it. e.g. _fzf_setup_completion path kubectl
2019-05-01[bash-completion] Fix custom completion with dynamic loader enabled for ↵Jesus Briales
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`
2019-02-28[completion] Look up on ~/.ssh/config.d/* files when doing ssh host complete ↵Rui Coelho
(#1420)
2019-02-28[shell] Skip loading completion code on non-interactive shellJunegunn Choi
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
2018-07-06[completion] Filter out non-hostnames in SSH config file (#1329)Jay
* 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 **`
2018-06-02[bash/zsh] Fix missing fuzzy completions (#1303)ptzz
* [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**
2018-05-04[bash] Do not print error when falling back to default completion (#1279)ptzz
Fixes #1278
2018-04-30[bash] Fix infinite loop on tab completionJunegunn Choi
awk may not set OFS to match FS depending on the implementation. Close #1227
2018-04-12ZSH and Bash completion: remove shebang (#1248)Avindra Goolcharan
Shebangs are only for files that are directly executable. In cases where files are only sourced (such as completion scripts), these are unneeded.
2018-02-15[bash] Fix extra space issue of dynamic completion with 'nospace'Junegunn Choi
Close #1203
2017-12-03[bash-completion] Fix custom completion with dynamic loader enabledJunegunn Choi
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
2017-10-21[completion] Ensure ps called as command (#1098)Igor Urazov
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.
2017-10-19[completion] Fix known_hosts completion for custom port number (#1092)Andrey Chernih
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.
2017-09-27[completion] Include host aliases in ssh completion (#1062)Josh Pencheon
2017-07-31Revert "[bash] Do not append space when path completion is cancelled"Junegunn Choi
This reverts commit 376a76d1d3c39a1686b6ac7a6118c1f80af3178e as it affects normal completion
2017-07-30[bash] Do not append space when path completion is cancelledJunegunn Choi
Close #990