Late evening release of a blog post I've worked on today on a day off (it's enjoyable, OK?) on what I did to make the combo of the Bash language server and shfmt work with Editorconfig settings for Bash script files that don't have extensions. In Neovim 🚀

Share & enjoy! https://qmacro.org/blog/posts/2025/09/01/auto-formatting-extensionless-bash-scripts-in-neovim/

#Neovim #LSP #Bash #Editorconfig #Shfmt

Auto formatting extensionless Bash scripts in Neovim

Here's what I did to make the combination of the Bash language server and shfmt work with Editorconfig settings for Bash script files that don't have extensions.

DJ Adams
 #NixOS has made me like  #bash. I use it so frequently with pkgs.writeShellApplication and have accepted to use its non-POSIX "advanced" features like (associative) arrays, the [[ ]] conditional syntax, the variable string mangling magic, etc. I absolutely love how writeShellApplication automatically runs everything through #shellCheck and makes it easy to set runtimeInputs and runtimeEnv. I'd love for it to pass the result through #shfmt though 😉

Me experimenting with build scripts for bash, using
- #shfmt - formatting
- #shellcheck - linting
- bats - unit testing
- #shelldoc - for google style docstrings
- source - library importing
- #bashlog - basic logging
- TODO: #bpkg - library packaging

https://github.com/matthewdeanmartin/isopod_shell

GitHub - matthewdeanmartin/isopod_shell: Trivial text adventure game to see what app dev in bash would look like with modern techniques

Trivial text adventure game to see what app dev in bash would look like with modern techniques - matthewdeanmartin/isopod_shell

GitHub
How To Format Shell Programs Using Shfmt In Linux - OSTechNix

This guide explains what is Shfmt, how to install Shfmt in Linux, and finally how to format shell programs using Shfmt in Linux.

For those who use #shfmt - that snap package has also been pushed to stable. This package was lagging behind as I "thought" 🙄 I was watching the releases on GitHub. Oops. Corrected! #Ubuntu #Linux #snapcraft #snapcraftio