I am curious to ask others here, are there other low-config alternative tools like Fish that, looking back, now seem like a no brainer? Ghostty is a recent example, Helix seems like another. I’d love to know about other tools people are using that have improved or simplified their lives.
Chezmoi was a complete workflow changer for me. https://www.chezmoi.io/ Let's me manage/synchronize my configs between systems. It has built in variables and scripting support so you can ignore sections of files or specific sections of files on certain systems, write specific configs for specific systems based on hostname or OS. It's a bit of work to get an understanding of, but incredibly powerful once you do. Whene…
Fish 4.0: The Fish of Theseus
181–190 of 204 posts
Re: Fish 4.0: The Fish of Theseus
#182I am curious to ask others here, are there other low-config alternative tools like Fish that, looking back, now seem like a no brainer? Ghostty is a recent example, Helix seems like another. I’d love to know about other tools people are using that have improved or simplified their lives.
Agree with you on helix. I love it. Atuin for improved history search. Starship for an improved shell prompt. zoxide - better cd ripgrep - better grep just - a command runner. I put project specific commands/scripts in there so I don’t have to remember. All of these are indispensable for me.
Re: Fish 4.0: The Fish of Theseus
#183Earlier quoted context omitted.
Default to 80 chars is a travesty IMO, 100 or 128 would be a much better place.
rustfmt uses 100-char lines by default (and can be configured to fill more), but that's not the problem with it. The problem is that as soon as a whole statement doesn't fully fit on a single line, rustfmt switches from "horizontal" to "vertical" strategy. It then stops caring how much vertical space it takes, inserts line breaks as often as the style allows, and won't try to use the available line width. You end up…
- There are only two strategies and the algorithm to choose between them is trivial for a human to compute. This makes for way better readability, you can reliably predict where the next call/argument is going to be positioned.
- Refactoring becomes easier - moving an argument is now a simple `Line up` editor action.
- Source control diffs become more stable across changes.
...but it's hard to see the benefits on trivially simple examples like the one you presented. Here's a reformatting I did [1] to illustrate this:
Original:
ReturnType, T>>, U, HmmLetsAdd>
Reformatted: ReturnType,
T,
>,
>,
U,
HmmLetsAdd,
>
Vertically verbose, yes, but that hardly matters. The reformatting gave the code visual structure that's made it easy to understand.Re: Fish 4.0: The Fish of Theseus
#184Earlier quoted context omitted.
bash is /bin/bash on macOS, unless the user really likes bash, in which case it's probably /opt/homebrew/bin/bash or /opt/local/bin/bash
In any of those cases, using `/usr/bin/env bash` gets what the user probably wants
Re: Fish 4.0: The Fish of Theseus
#185I remember switching from bash to zsh a few years back and thinking I was the bees knees. After the switch trying other shells seemed like bike-shedding because, I mean, what more could a shell? Then I got a new computer and decided to start from scratch with my tooling and downloaded fish. I was shocked how it instantly made zsh feel cumbersome and ancient . Heartily recommend others give it a try as a daily driver…
My only issue with Fish is when pasting things from the web that assume Bash, a lot of the time it just works, then now and then I get screwed. I don't know nearly enough Fish or Bash to switch. Still though, I prefer Fish ultimately.
I use zsh with plugins which pretty much makes it act like fish's convenience but one can use fish as their shell scripting while keeping the "bash" compatibility by keep using zsh or bash under terminal.
Re: Fish 4.0: The Fish of Theseus
#186As a decade-long user and as a professional C++ developer, I'm so happy they've managed to successfully port the shell to Rust. While I have a lot of fun writing C++ (and Rust), I must admit that Rust is vastly nicer to use. People can complain as much as they want about the borrow checker, but you basically have to be as strict as Rust is in C++ if you want to really avoid use-after-free issues, ... I've been writin…
Re: Fish 4.0: The Fish of Theseus
#187I am curious to ask others here, are there other low-config alternative tools like Fish that, looking back, now seem like a no brainer? Ghostty is a recent example, Helix seems like another. I’d love to know about other tools people are using that have improved or simplified their lives.
Re: Fish 4.0: The Fish of Theseus
#188Earlier quoted context omitted.
I had no idea! Where can I find docs to set this up?
Take some agency for yourself. https://github.com/search?q=repo%3Afish-shell%2Ffish-shell%2... That agency includes interpreting the search results alongside the reply to your original comment.
Re: Fish 4.0: The Fish of Theseus
#189For end users who don't care much about the internals, what are the new features of Fish 4.0? Anything worth the upgrade from Fish 3.0?
Re: Fish 4.0: The Fish of Theseus
#190Earlier quoted context omitted.
rustfmt uses 100-char lines by default (and can be configured to fill more), but that's not the problem with it. The problem is that as soon as a whole statement doesn't fully fit on a single line, rustfmt switches from "horizontal" to "vertical" strategy. It then stops caring how much vertical space it takes, inserts line breaks as often as the style allows, and won't try to use the available line width. You end up…
Good, that is the correct way to format code. - There are only two strategies and the algorithm to choose between them is trivial for a human to compute. This makes for way better readability, you can reliably predict where the next call/argument is going to be positioned. - Refactoring becomes easier - moving an argument is now a simple `Line up` editor action. - Source control diffs become more stable across change…
You rename a method, now it's a few chars shorter/longer, and some 1-liner call sites can become completely rewritten to the vertical style or vice versa.
You delete a single line, now the expression can fit under a threshold, and the whole block is spaghettified (especially terrible when deleting a struct field).
You wrap code in an if{}, which could have been a clean whitespace-only change for the entire body, but the indentation affects rustfmt's char counts, and it will now force different formatting decisions all over the place.
If you're changing an infallible method to a fallible one, you could have added error handling/fallback on separate lines, keeping changes to the happy path minimal – but not with rustfmt.
For minimal diffs you'd want something with a slack like gofmt, but rustfmt completely overlooked what makes gofmt so great and widely acceptable, and is a misanthropic ruthless canonicalizer instead, which ruins lots of use-cases, including minimal diffs.
Rustfmt's heuristics aren't simple. They're based on char counting of AST nodes, with multiple different limits for different node types, and crossing any threshold can trigger an avalanche of reformatting. There are more complex rules for closures and comments.
These heuristics are a source of formatting inconsistencies, e.g. each match arm is evaluated independently. Even when all match arms contain the same code, they can be formatted wildly differently due to patterns/name lengths pushing different thresholds. Indentation and AST context can make the same expression look differently each time. Such problems largely don't exist in gofmt, so it's not a problem of code formatters, it's a problem of rustfmt specifically.