Score:1

How to auto complete like CSH when using ZSH (prefix ↑)

cn flag

When using zsh how could I auto-complete like csh, for example, having this history:

 9994  vim bar
 9995  git add .
 9996  git commit -am "test..."
 9997  ssh 10.1.2.3
 9998  ls
 9999  vim foo

In csh if I type:

git

It will auto-complete with:

git commit -am "test..."

If I presss arrow up again it auto-completes with

git add .

for example, if I want to edit the previous file I was using, I can just type:

vim

That will auto-complete with vim foo, If I press 2 times the :

vim

It will autocomplete to:

vim bar 

Personally, I found it extremely easy compared to the bash reverse search <ctrl-R> since I just have to prefix the command, press arrow key up, and done, because of this I would like to know-how in ZSH I could achieve the same, currently, as an extra, I am using fzf but there are cases where I just need use the previous command instead of searching, maybe fzf could be configured to work the same any ideas?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.