feat(ublue-bling): clean up fish script#291
Conversation
1c3c8c1 to
8de0a74
Compare
There was a problem hiding this comment.
Code Review
This pull request refactors the Fish shell configuration by introducing a bling_abbr helper function to manage aliases and abbreviations and updating the initialization logic for several CLI tools like direnv, starship, and mise. The review identifies two significant issues: the bling_abbr function pollutes the global namespace and should be cleaned up or renamed, and the alias definitions should be moved inside the interactive status check to ensure consistent behavior and avoid side effects in non-interactive scripts.
Add a variety of fixes to the bling.fish script to bring it up to par with bling.sh. - only blingify in an interactive terminal - add no-source-twice fix - Simplify command existence checks - Add command existence check for bat - Add direnv and mise - Use `command init fish | source` pattern (every tool has that pattern as the correct way to set up the tool in their respective documentations). - Use `abbr -a` instead of `alias` by default. Abbr is generally preferred over alias in fish. This does result in a functional change though: `abbr` expands in the terminal. This is one of the reasons they are preferred (you can see the exact command instead of the real command being effecively hidden), but some people may prefer the simpler aliases, so I added a flag similar to what `mise` has to disable `abbr` and go back to `alias` if a user prefers that.
8de0a74 to
f594eda
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the bling.fish script to improve performance and idiomatic usage. Key changes include wrapping the script in an interactive status check, adding a double-sourcing guard, and introducing a helper function to support both abbreviations and aliases. Additionally, it replaces command evaluation with direct sourcing for several tools and adds support for direnv and mise. I have no feedback to provide.
|
I don't use fish but this seems sane to me, thank you! |
Add a variety of fixes to the bling.fish script to bring it up to par with bling.sh.
command init fish | sourcepattern (every tool has that pattern as the correct way to set up the tool in their respective documentations).abbr -ainstead ofaliasby default. Abbr is generally preferred over alias in fish. This does result in a functional change though:abbrexpands in the terminal. This is one of the reasons they are preferred (you can see the exact command instead of the real command being effecively hidden), but some people may prefer the simpler aliases, so I added a flag similar to whatmisehas to disableabbrand go back toaliasif a user prefers that.