summaryrefslogtreecommitdiff
path: root/shell
AgeCommit message (Collapse)Author
2020-11-25[zsh] Declare variable as local before assignment (#2266)ratijas
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-12[fish] Fix parser handling of option-like args (#2208)Andrew Zhou
Fixes error when option-like args are parsed (e.g. "-1").
2020-10-06[completion] Make host completion handle source files without EOLElvan Owen
2020-10-03[zsh] Keep current $BUFFER on ALT-CJunegunn Choi
Ideally, we could only use `print -sr` to update the command history. However, the "cd" command by ALT-C is added to the history only after we finalize the current command by pressing an additional enter key. i.e. The cd command from ALT-C is not visible when you hit Up arrow. But it appears once you hit enter key. So when the current buffer is empty, we use `zle accept-line` so that the command history is immediately updated. Close #2200
2020-10-02[zsh] Record cd execution in history (#2193)octaltree
2020-09-02[zsh] Fix the regular expression (#2140)Yuji Nakao
Fix the regular expression to capture the command containing asterisk.
2020-05-23Revert file mode of key-bindings.zshJunegunn Choi
2020-04-24[zsh] Make CTRL-R work with older Perls (#2003)Slaven Rezić
s///r is only available since perl 5.14. The Perl oneliner was changed to work with older Perls, possibly even with 5.000. Fix #2001
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-13[zsh-completion] Fix error with backslash-prefixed commandsJunegunn Choi
Fix #1973 Fix #1974 Fix #1975
2020-04-03[fzf-tmux] Split zsh variable expansion for old zshJunegunn Choi
The following code works in zsh 5.8 but not in 5.4 ${(Q)${(Z+n+)FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}}}
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-30[zsh] Ensure that fzf code always parses the same way (#1944)Roman Perepelitsa
At the top of each zsh file options are set to their standard values (those marked with <Z> in `man zshoptions`) and `aliases` option is disabled. At the bottom of the file the original options are restored. Fix #1938
2020-03-29[shell] Update CTRL-R to remove duplicate commandsJunegunn Choi
Close #1940 Related: #1363 #749 #270 #49 #88 #492 #600
2020-03-24[zsh-completion] Fix a bug where _fzf_complete did not iterate through args ↵Chitoku
(#1936)
2020-03-13[bash] Restore --nth option in CTRL-RJunegunn Choi
2020-03-11Fuzzy completions: removed leftover debug echo (#1921)Jakub Łuczyński
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-29[bash] Fix --query argument of CTRL-RJunegunn Choi
Fix #1898
2020-02-28[bash] Start C-r search with current command line (#1886)Jack Bates
Restore the original line when search is aborted. Add --query "$READLINE_LINE" and fall back to the current behavior pre Bash 4. Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2020-02-28[fish] Ignore empty environment variablesJunegunn Choi
2020-02-24[bash] Multiline C-r without histexpand (#1837)Jack Bates
Close #1370 Parses the history list, converts it to a NUL-delimited list of possibly multiline entries. Adds the fzf --read0 option. Works with and without histexpand enabled. Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2020-02-23[bash] Restore insertion point pre Bash 4 (#1881)Jack Bates
Make C-t more consistent pre and post Bash 4. It already kills the command line separately before and after the insertion point. Add set-mark and exchange-point-and-mark to restore the insertion point after yanking back and apply the same behavior to M-c. * CTRL-T should put extra space after pasted items Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2020-02-21[bash] Put C-t items at point in vi mode (#1876)Jack Bates
Be consistent with emacs mode and put the items at the point vs. the end of the command line.
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
2020-01-19[zsh-completion] Fix quoting/splitting issues (#1820)Chitoku
2020-01-08[bash] Populate emacs and vi keymaps (#1815)Jack Bates
Enables the right bindings when switching between editing modes.
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-12-01[zsh] Prevent the current directory from appearing as `~dir` in prompts (#1774)midchildan
The zsh version of the cd widget sets the variable `dir` to the path of the target directory before invoking `cd`. This causes zsh to treat the target directory as a named directory, which has the effect of zsh substituting '%~' with '~dir' instead of the proper path when it performs prompt expansion. This commit will cause the widget to unset `dir` before redrawing the prompt to fix this issue. Details of zsh prompt expansion can be found in: http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html
2019-11-03[zsh-completion] Fix prefix extraction when triggers start with ';'zhaoyunfeng
2019-10-17[zsh] Suppress global alias expansion in widget functionsJunegunn Choi
Close #1708
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-07-13[fish] Remove perl from fish key bindings (#1635)ssjhv
Perl was used to remove the trailing newline character, but fzf already has --print0 to use null character as terminators, and fish read -z is expecting null character as terminators. There is no reason to depend on perl if --print0 is passed to fzf invocation.
2019-06-03[bash] Make sure to execute builtin historyJunegunn Choi
Fix #1592