Kate + shfmt bash/shell script formatting

Hi there!

I just discovered shfmt which works really well. It is supported everywhere but not in Kate.

Could you tell me how I could maybe make it work anyways? for example with the “compiler” plugin?

Oh, I just saw that the online description is outdated.

these are the available formatters, bash and a ton more are included

{
    "formatOnSave": true,
    "formatterForJson": "jq",
    "formatterForPython": "ruff",
    "formatterForYaml": "yamlfmt",
    "clang-format": {
        "command": [
            "clang-format",
            "--fallback-style=Webkit"
        ],
        "formatModifiedLinesOnly": true,
        "formatOnSave": true
    },
    "dart": {
        "command": [
            "dart"
        ]
    },
    "jq": {
        "command": [
            "jq"
        ]
    },
    "prettier": {
        "command": [
            "node"
        ]
    },
    "rustfmt": {
        "command": [
            "rustfmt"
        ]
    },
    "xmllint": {
        "command": [
            "xmllint"
        ]
    },
    "gofmt": {
        "command": [
            "gofmt"
        ]
    },
    "zig": {
        "command": [
            "zig"
        ]
    },
    "cmake-format": {
        "command": [
            "cmake-format"
        ]
    },
    "autopep8": {
        "command": [
            "autopep8"
        ]
    },
    "ruff": {
        "command": [
            "ruff"
        ]
    },
    "dfmt": {
        "command": [
            "dfmt"
        ]
    },
    "fish_indent": {
        "command": [
            "fish_indent"
        ]
    },
    "shfmt": {
        "command": [
            "shfmt"
        ]
    },
    "nixfmt": {
        "command": [
            "nixfmt"
        ]
    },
    "qmlformat": {
        "command": [
            "qmlformat"
        ]
    },
    "yamlfmt": {
        "command": [
            "yamlfmt",
            "-quiet",
            "-"
        ]
    },
    "opsi-script-beautifier": {
        "command": [
            "opsi-script-beautifier",
            "-s"
        ]
    },
    "odinfmt": {
        "command": [
            "odinfmt"
        ]
    }
}
1 Like