StyLua now supports collapsing simple statements

This page summarizes the projects mentioned and recommended in the original post on /r/neovim

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • StyLua

    An opinionated Lua code formatter

  • Starting from version 0.14.0, StyLua (the Lua code formatter in Neovim world) implements option collapse_simple_statement. From release notes:

  • mini.nvim

    Library of 35+ independent Lua modules improving overall Neovim (version 0.7 and higher) experience with minimal effort

  • In practice, the vast majority of "simple" statements are short (you can see in this diff). That is why I think that this option is more appropriate to use with shorter column width: 100 or even 80. Your example has width 96 without indentation.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • EmmyLuaCodeStyle

    fast, powerful, and feature-rich Lua formatting and checking tool.

  • The sumnkeo_ lua formatter uses EmmyLuaCodeStyle behind the scenes which you can really fine tune to your own liking with .editorconfig.

  • LuaFormatter

    Code formatter for Lua

  • Back in the day when I was making a decision about which formatter to use (I believe, it was between StyLua and LuaFormatter) these observations sealed the deal: - It was already used by many plugins and Neovim itself. - It made handy binary releases which I could download and use right away. - It had easy-to-use github action for Continuous Integration checks.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts