nu: Add partial auto suggestion completion
The suggested history completion on the reedline (i.e. fish-like autosuggestion) can be fully completed with the `l` key in vi cmd mode. This change adds the ability to complete the suggestion partially by completing the current word using `e`. If no history suggestion exists it moves to the end of the current word as usual. This mimics the partial completion I have set up in zsh with the help of the `zsh-autosuggestions` plugin.
This commit is contained in:
parent
26e8cc3ccc
commit
b305be8ad0
1 changed files with 15 additions and 1 deletions
|
|
@ -55,6 +55,7 @@ $env.config.keybindings = [
|
||||||
{send: Enter}
|
{send: Enter}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
# reedline edits
|
||||||
{
|
{
|
||||||
name: insert_last_token
|
name: insert_last_token
|
||||||
modifier: alt
|
modifier: alt
|
||||||
|
|
@ -80,10 +81,23 @@ $env.config.keybindings = [
|
||||||
keycode: char_s
|
keycode: char_s
|
||||||
mode: [emacs vi_insert vi_normal]
|
mode: [emacs vi_insert vi_normal]
|
||||||
event: {
|
event: {
|
||||||
send: executehostcommand
|
send: ExecuteHostCommand
|
||||||
cmd: "let cmd = (commandline); commandline edit (if $cmd starts-with sudo { $cmd | str replace -r '^sudo ' '' } else { 'sudo ' ++ $cmd });"
|
cmd: "let cmd = (commandline); commandline edit (if $cmd starts-with sudo { $cmd | str replace -r '^sudo ' '' } else { 'sudo ' ++ $cmd });"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name: partial_history_complete
|
||||||
|
modifier: None
|
||||||
|
keycode: char_e
|
||||||
|
mode: [vi_normal]
|
||||||
|
event: {
|
||||||
|
until: [
|
||||||
|
{ send: HistoryHintWordComplete }
|
||||||
|
{ edit: MoveWordRight }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# file menus
|
||||||
{
|
{
|
||||||
name: run_zoxide
|
name: run_zoxide
|
||||||
modifier: alt
|
modifier: alt
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue