I used oh-my-zsh for a while and found one of its nice features, where I could complete my command using up and down arrow keys.
I want to recreate the feature, and even browsed it source code and this is what I have so far: https://termbin.com/vlaj in my ~/.zshrc. Say my history is like this:
Now if i had
$ nvim he
and i press up arrow key, it becomes
nvim cmatrix.py , and not
nvim hello-word.sh as it would in oh-my-zsh.
I found this to be helpful, but it doesn't fix it: https://github.com/ohmyzsh/ohmyzsh/issues/1720