Zsh autocomplete is amazing, but I cannot configure one thing properly: I want zsh to offer me a list of commands from history.
I know that I can search the history with Ctrl+R, but I want something a bit different. When I type:
shelajev@elephant ~ » kill 1TAB
1642 shelajev gnome-keyring-d
1718 shelajev gnome-session
1807 shelajev ssh-agent
1810 shelajev dbus-launch
1811 shelajev dbus-daemon
1822 shelajev gnome-settings-
1884 shelajev gvfsd
1891 shelajev gvfs-fuse-daemo
Zsh offers me a list of processes to kill. I want to have something like this:
shelajev@elephant ~ » kill Ctrl+X Ctrl+X
kill -9 12093
kill -15 4123
where those items in the list are taken from my history.
There exists a ZLE hist-complete thing, but I don't know how to properly configure it.
I have the following in my .zshrc
:
zle -C hist-complete complete-word _generic
zstyle ':completion:hist-complete:*' completer _history
bindkey "^X^X" hist-complete
But this only completes individual words, which doesn't give me much. Is there a way to combine history search for lines in the history and showing a listing of that?