{"id":13896172,"url":"https://github.com/vincens2005/lite-formatters","last_synced_at":"2025-07-17T12:30:59.613Z","repository":{"id":38391138,"uuid":"362603738","full_name":"vincens2005/lite-formatters","owner":"vincens2005","description":"Code formatters for https://github.com/rxi/lite and https://github.com/franko/lite-xl","archived":false,"fork":false,"pushed_at":"2025-07-06T16:02:00.000Z","size":75,"stargazers_count":27,"open_issues_count":10,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T16:41:10.753Z","etag":null,"topics":["formatter-plugin","formatters","lite","lite-xl","lua","plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vincens2005.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-28T20:54:08.000Z","updated_at":"2025-07-06T16:02:03.000Z","dependencies_parsed_at":"2024-03-24T23:24:56.234Z","dependency_job_id":"9949bb0e-62ae-4670-bb5a-b6c763341441","html_url":"https://github.com/vincens2005/lite-formatters","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vincens2005/lite-formatters","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincens2005%2Flite-formatters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincens2005%2Flite-formatters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincens2005%2Flite-formatters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincens2005%2Flite-formatters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vincens2005","download_url":"https://codeload.github.com/vincens2005/lite-formatters/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincens2005%2Flite-formatters/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265606607,"owners_count":23796969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formatter-plugin","formatters","lite","lite-xl","lua","plugin"],"created_at":"2024-08-06T18:02:42.485Z","updated_at":"2025-07-17T12:30:59.604Z","avatar_url":"https://github.com/vincens2005.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# Formatter Plugin\n\nA simple formatter plugin for [lite](https://github.com/rxi/lite.git) and [Lite XL](https://github.com/lite-xl/lite-xl).\n\n## List of formatter modules\n\n- [autoflake python formatter](https://pypi.org/project/autoflake/): `formatter_autoflake.lua`\n- [black python formatter](https://pypi.org/project/black/): `formatter_black.lua`\n- [clang-format](https://clang.llvm.org/docs/ClangFormat.html): `formatter_clangformat.lua`\n- [cljfmt](https://github.com/weavejester/cljfmt): `formatter_cljfmt.lua`\n- [cmake-format](https://github.com/cheshirekow/cmake_format): `formatter_cmakeformat.lua`\n- [csharpier](https://github.com/belav/csharpier): `formatter_csharpier.lua`\n- [crystal](https://man.archlinux.org/man/crystal.1.en): `formatter_crystal.lua`\n- [css-beautify](https://www.npmjs.com/package/js-beautify): `formatter_cssbeautify.lua`\n- [dartformat](https://dart.dev/tools/dart-format): `formatter_dartformat.lua`\n- [dfmt](https://github.com/dlang-community/dfmt): `formatter_dfmt.lua`\n- [elixir](https://hexdocs.pm/mix/main/Mix.Tasks.Format.html): `formatter_elixir.lua`\n- [elm-format](https://github.com/avh4/elm-format): `formatter_elmformat.lua`\n- [esformatter](https://github.com/millermedeiros/esformatter/): `formatter_esformatter.lua`\n- [gdformat](https://github.com/Scony/godot-gdscript-toolkit): `formatter_gdformat.lua`\n- [google-java-format](https://github.com/google/google-java-format): `formatter_googlejavaformat.lua`\n- [goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports): `formatter_golang.lua`\n- [html-beautify](https://www.npmjs.com/package/js-beautify): `formatter_htmlbeautify.lua`\n- [isort python formatter](https://pypi.org/project/isort/): `formatter_isort.lua`\n- [js-beautify](https://www.npmjs.com/package/js-beautify): `formatter_jsbeautify.lua`\n- [luaformatter](https://github.com/Koihik/LuaFormatter): `formatter_luaformatter.lua`\n- [ormolu](https://github.com/tweag/ormolu): `formatter_ormolu.lua`\n- [perltidy](https://github.com/perltidy/perltidy): `formatter_perltidy.lua`\n- [prettier](https://github.com/prettier/prettier): `formatter_prettier.lua`\n- [ocp-indent](https://github.com/OCamlPro/ocp-indent): `formatter_ocpindent.lua`\n- [qmlformat](https://github.com/qt/qtdeclarative): `formatter_qml.lua`\n- [rubocop](https://github.com/rubocop/rubocop): `formatter_rubocop.lua`\n- [ruff](https://github.com/astral-sh/ruff): `formatter_ruff.lua`\n- [rustfmt](https://github.com/rust-lang/rustfmt): `formatter_rustfmt.lua`\n- [shfmt](https://github.com/mvdan/sh): `formatter_shfmt.lua`\n- [vfmt](https://github.com/vlang/v): `formatter_vfmt.lua`\n- [sql-formatter](https://github.com/sql-formatter-org/sql-formatter): `formatter_sqlformatter.lua`\n- [zigfmt](https://ziglang.org): `formatter_zigfmt.lua`\n\n## Installation\n\n1. Copy the `formatter.lua` file into the lite/lite-xl `data/plugins` folder\n\n2. To install any specific formatter, copy the corresponding file into the `data/plugins` folder. List of formatters is at the top of this file.\n\n3. Make sure you have the command that formatter uses installed, or it won't work.\n\n4. Extra configuration:\n    If you want to customize the cli arguments for a specific formatter, you can do this from your `init.lua` script.\n    Example:\n```lua\nconfig.jsbeautify_args = {\"-r\", \"-s 4\", \"-p\", \"-b end-expand\"} -- set jsBeautify arguments to indent with spaces.\n```\n\n## Using `formatter`\n\nThe default keymap to format the current doc is `alt+shift+f`.\n\nThe command is `formatter:format-doc`.\n\nTo make Lite XL automatically format the current document on each save, add the following config to `USERIDR/init.lua`:\n\n```lua\nconfig.format_on_save = true\n```\n\n## Adding a formatter module\n\nHere is an example of a formatter module:\n\n`formatter_jsbeautify.lua`\n\n```lua\n-- mod-version:3 lite-xl 2.1\n\n-- for the JS Beautify fortmatter\nlocal config = require \"core.config\"\nlocal formatter = require \"plugins.formatter\"\n\nconfig.jsbeautify_args = {\"-r\", \"-q\", \"-s 1\", \"-t\", \"-p\", \"-b end-expand\"} -- make sure to keep -r arg if you change this\n\nformatter.add_formatter {\n    name = \"JS Beautifier\",\n    file_patterns = {\"%.js$\"},\n    command = \"js-beautify $ARGS $FILENAME\",\n    args = config.jsbeautify_args\n}\n```\n\nA few things to keep in mind:\n\n- Add the correct Lite XL version tag at the top\n- Keep the arguments inside `config.formattername_args`\n- Set a name\n- Add it to the list in README.md and keep it alphabetically sorted\n\nThen make a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincens2005%2Flite-formatters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvincens2005%2Flite-formatters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincens2005%2Flite-formatters/lists"}