Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, you can go quite far with a few simple tweaks to Ctrl+R.

    # disable flow control (Ctrl+S now searches forward in history)
    if [ -t 0 ]; then
      stty -ixon
    fi
And then add the partial search to arrows:

    > cat .inputrc 
    $include /etc/inputrc
    
    "\e[A": history-search-backward
    "\e[B": history-search-forward
All that in bash.


Having the partial search bound to the up/down arrows is the most fundamental part of the shell for me. I very rarely have to resort to Ctrl-R. Every few weeks I might need a more complex history search, but for that I can just grep in my .zsh_history.


The problem with grep for me is that it's not really interactive. fzf allows me to fuzzy search and adjust the search term and seeing a list with results I then can select from.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: