Auto-align “=” in assignments

后端 未结 4 1122
天命终不由人
天命终不由人 2020-12-06 02:41

How do one convert a block of variable assignments, e.g.:

private final String s1 = \"10011\";
private final String          


        
相关标签:
4条回答
  • 2020-12-06 03:14

    EclipseFormatter solved this problem perfectly which supports align fields, assignments and variable declarations in columns.

    0 讨论(0)
  • 2020-12-06 03:15

    You can use the Eclipse plugin columns4eclipse:

    • gratis
    • open source
    • I've tested it with Eclipse 4.3 x64 and 4.5 x64 on Windows 7 SP1 x64 Ultimate

    0 讨论(0)
  • 2020-12-06 03:23

    If you want to be able to align assignments and not only field declarations, this plugin does an excellent job: OCDFormat.

    It works in all text files, not only java.

    0 讨论(0)
  • 2020-12-06 03:24

    PreferencesJavaCode StyleFormatter → goto Edit and check the Align fields in columns:

    Align fields in columns

    0 讨论(0)
提交回复
热议问题