Fish-like autocompletion
See original GitHub issueI tried to figure this out but couldn’t find out. Is there a way to get autocompletion like in the fish shell?
Basically what I am looking for is automatically searching the history on every keystroke, then showing a grey suggestion behind the cursor that can be accepted with <kbd>→</kbd> (if the cursor is at the end of the line).
We can get close with Set-PSReadLineKeyHandler -Key ArrowRight -Function HistorySearchBackward
but it doesn’t show the suggestion and it prevents moving the cursor to the right.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:130
- Comments:76 (28 by maintainers)
Top Results From Across the Web
Fish-like autosuggestions for zsh
Key Bindings · autosuggest-accept : Accepts the current suggestion. · autosuggest-execute : Accepts and executes the current suggestion. · autosuggest-clear : ...
Read more >How to make zsh completion show the first guess on ...
In Fish when you start typing, autocompletion automatically shows the first autocompleted guess on the line itself. In zsh you have to hit ......
Read more >Fish like autosuggestion commands description in zsh!
How to get description of commands in zsh (autosuggestion) like fish shell (like in the picture: source fish ... [ QUETSION] - Autocompletion....
Read more >I love fish shell, I love the autocomplete, but I've been ...
I love fish shell, I love the autocomplete, but I've been forced to switch back to bash lately, because fish syntax is just...
Read more >Writing your own completions
A completion file must have a filename consisting of the name of the command to complete and the suffix .fish . By default,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m working on a prototype of this, and here is the zip package if any of you want to try it (any feedback would be very helpful!).
PSReadLine.zip
Currently:
When using this PSReadLine, please add the following key binding to your profile:
RightArrow
at the end of current typing will accept the suggestion textCtrl+f
at the end of current typing will accept a word from the suggestion textCtrl+z
will get you back to where you were before accepting all or part of the suggestionImportant note: don’t forget to unblock the zip file after you download it, otherwise you will face weird exceptions thrown from PowerShell.
@Southclaws - do you already set these bindings (which I think should be changed to be the default)?