• Damage@feddit.it
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    13 hours ago

    Even quicker with zsh or atuin: write the first few letters then arrow up to cycle through all matches

    • Ephera@lemmy.ml
      link
      fedilink
      English
      arrow-up
      5
      ·
      12 hours ago

      Even quicker with fish: Write the first few letters then it auto-suggests the last-run command matching that prefix (and then you can still arrow up to cycle through all matches).

      (There is also a zsh plugin for that, called zsh-autosuggestions.)

      • Cethin@lemmy.zip
        link
        fedilink
        English
        arrow-up
        1
        ·
        9 hours ago

        A lot of stuff assumes Bash, so occasionally when the syntax differs its slightly annoying; sometimes you have to modify a few lines of a file or something (or run it as in Bash manually). Fish is so nice though. It really should replace Bash for almost everyone. If you really need Bash you can still use it.

        • Ephera@lemmy.ml
          link
          fedilink
          English
          arrow-up
          4
          ·
          7 hours ago

          With script files, you can (and should regardless of Fish usage) put a shebang at the top, like #!/bin/sh or #!/bin/bash. Then it will run with Bash as you’d expect.

          I also recommend not setting Fish as your system-wide default shell (since then a missing shebang will cause it to run in Fish), but rather just have your terminal emulator start fish by default.

          And yeah, outside of scripting, if I notice a command requires Bash syntax (which you can often tell from Fish’s syntax highlighting turning red), then I just run bash, execute the Bash command in there and then exit back out of there.

          Having said all that, I’m not trying to take away from your point. If I wasn’t just joking around, I would caveat a Fish recommendation just as much.

          • Cethin@lemmy.zip
            link
            fedilink
            English
            arrow-up
            2
            ·
            5 hours ago

            Yeah, it’s just some scripts that come with programs sometimes not including that is the issue. Like I said, it isn’t a big issue, just occasionally requires small edits if you try to run the script in Fish, or, like you said, running them with Bash.