logoalt Hacker News

grimgrintoday at 8:08 AM1 replyview on HN

i love the mkdir example, so i’m going to exercise that muscle and see where it goes

and yeah ^r works, though i often type a few chars and ^p till i get the match. history-search-backward in your inputrc, iirc

edit: on a computer now :) my `if emacs` block, allowing arrows or ^n/^p to run through history. so for e.g., type "tar" and now as you shift through history with :binding:, it only shows history that began with "tar"

    $if mode=emacs
    "\e[A": history-search-backward
    "\e[B": history-search-forward
    "\C-p": history-search-backward
    "\C-n": history-search-forward
    ...
    $endif

Replies

zzriltoday at 8:26 AM

That one was always worth its own function for me.

``` mkcd() { mkdir -p -- "$*" && cd -- "$*" } ```