I know that I can use forward-char with ZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS to be able to autocomplete one character at a time. Also, I know that forward-word can be used to autocomplete one word (anything without spaces) at a time.
I need to autocomplete one directory at a time (forward-dir), that is, until and including next / in "word" in autosuggestion:
*I typed 4 chars and autosuggestion shows up*
vi dir1/dir2/dir3/file
^
*hitting forward-word*
vi dir1/dir2/dir3/file
^
*hitting forward-char (partial)*
vi dir1/dir2/dir3/file
^
*what I need*
vi dir1/dir2/dir3/file
^
*after that I can do something like this (with ZSH_AUTOSUGGEST_STRATEGY=(history completion) set)*
vi dir1/otherdir/file
^
vi dir1/otherdir/file
^
vi dir1/otherdir/a.txt
^
vi dir1/otherdir/a.txt
^
(init)
(forward-word)
(forward-char)
("forward dir/")
(start typing different dir)
("forward dir/")
I noticed that the desirable behavior is shown by hitting Tab key, but only for the first directory in autosuggestion: if I keep on pressing Tab, it will just start changing autocompleted directory (and show the list of all dirs) in next level and not appending directories from the first autosuggestion. Or I can type 1st char of dir of each level and then press Tab — then it will be like I want but with extra keystrokes. (I don't want to type 1st char of each dir in autosuggested path, only the very 1st char to show the autosuggested path).
I know that I can use
forward-char
withZSH_AUTOSUGGEST_PARTIAL_ACCEPT_WIDGETS
to be able to autocomplete one character at a time. Also, I know thatforward-word
can be used to autocomplete one word (anything without spaces) at a time.I need to autocomplete one directory at a time (
forward-dir
), that is, until and including next/
in "word" in autosuggestion:(init)
(forward-word)
(forward-char)
("forward dir/")
(start typing different dir)
("forward dir/")
I noticed that the desirable behavior is shown by hitting Tab key, but only for the first directory in autosuggestion: if I keep on pressing Tab, it will just start changing autocompleted directory (and show the list of all dirs) in next level and not appending directories from the first autosuggestion. Or I can type 1st char of dir of each level and then press Tab — then it will be like I want but with extra keystrokes. (I don't want to type 1st char of each dir in autosuggested path, only the very 1st char to show the autosuggested path).