It can’t hurt to share some of you current helpers. Either someone else might get inspired by or in some cases you get suggestions how to make it better. Bash, Zsh, Fish or whatever shell script, command or alias (or abbreviation) you have, share here. Always fun to do so! I share mine in the comments, just like everybody else.

  • Skunk [any]@lemmy.zip
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    12 hours ago

    This is probably know to most but I found out in the most hilarious way that Ctrl-R in bash lets you search through past commands.

    Someone was complaining about Ctrl-S not working in term-mode on emacs and Ctrl-R behaving weird in term-mode in emacs. So I looked at it myself and indeed it does! Well term-mode can be set in char-mode (every key-stroke except C-c is sent to the terminal immediately) vs line-mode (input is sent to the terminal only after hitting Enter, allowing for emacsy input editing before submission). Now in line-mode C-s and C-r work as they do in emacs, but then it hit me that the “weird” C-r search in char-mode must therefore be part of bash and sure enough it does the exact same thing in gnome-terminal as well lol.

    • thingsiplay@lemmy.mlOP
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      10 hours ago

      I always forget about Ctrl-r and redescover it accidentally every time I press the key combo. I seem to like this combo a lot for some reason (Edit: maybe that’s because of my habits from using too much Vim, where Ctrl-r is used to redo something I undo). After typing a word you search for, pressing Ctrl-r will search for next occurrence BTW (at least in my setup).