Skip to content

Latest commit

 

History

History
79 lines (57 loc) · 3.16 KB

File metadata and controls

79 lines (57 loc) · 3.16 KB

Smart Sort Lines sorts lines of code with a little bit of intelligence.

If all but the last line of text end with a comma, then after sorting, all but the last line of text will still end with a comma.

If the first line of text is a left bracket and the last line of text is a right bracket, they will not be sorted.

It's particularly useful when sorting a list. For example, this text:

  [
    cat,
    ant,
    BAT
  ]

gets sorted to:

  [
    ant,
    BAT,
    cat
  ]

Usage

To run Smart Sort Lines:

  • Select the Editor → Smart Sort Lines menu item; or
  • Open the command palette and type Smart Sort Lines

Contributing

Contributions are welcome. See the outer project's README.

Other Nova extensions you might like :)

  • Copy Path copies the absolute or relative path of the current file, optionally including the line number and column number. GitHub / website

  • Document Sections lets you jump around to various sections in a text document using a customizable marker (typically a code comment in a certain format). GitHub / website

  • Elixir Manual Formatter lets you manually format an Elixir file or entire project, in case the LSP formatter starts failing. GitHub / website

  • Go To Tab shows a list of open editors and lets you choose one to go to. GitHub / website

  • Open File At Path opens a palette into which you can type a file path and optionally line number and column number. The palette will default to the first line of text from the clipboard. GitHub / website

  • Open Recent shows a list of recently-used editors and lets you choose one to open. GitHub / website

  • Open Related File opens a file related to the current file. GitHub / website

  • Smart Sort Lines sorts the selected lines of code with special support for comma-separated lists. GitHub / website

License, Copyright, Attributions

Copyright 2023 Erik Hanson. See LICENSE.