Similar to emacs' M-x sort-lines
To use after installing: select a bunch of lines → right click → Sort → Case-Sensitive A-z. Done!
Go to Home > Sort. Set Sort by to Paragraphs and Text. Choose Ascending (A to Z) or Descending (Z to A). Select OK.
Yes, it does! There is a very simple plugin called SortIt that does exactly what you want. It adds a section in the Edit menu, through which you can do the following:
The plugin is source-code agnostic, and it treats whatever you sort as plain text. I find it especially useful when sorting .properties
files and setters/getters. For example, using the Case Sensitive sorting I sorted the following code:
msgHeader.setTotalGrossMass(content.getTotalGrossMass());
msgHeader.setReferenceNumber(content.getReferenceNumber());
msgHeader.setTransportModeAtBorder(content.getTransportModeAtBorder());
msgHeader.setCountryOfDestinationCode(content.getCountryOfDestinationCode());
msgHeader.setCountryOfDispatchExportCode(content.getCountryOfDispatch());
msgHeader.setDateOfAmendment(content.getDeclarationDate()); // TODO: correct?
msgHeader.setIdentityOfMeansOfTransportCrossingBorder(content.getIdentityMeansOfTransportCrossingBorder());
msgHeader.setManualEntryNumber(content.getManualEntryNumber());
msgHeader.setTotalNumberOfPackages(content.getTotalNumberOfPackages());
msgHeader.setAgreedLocationOfGoodsCode(content.getAgreedLocationCode());
msgHeader.setAgreedLocationOfGoodsLNG(content.getAgreedLoclOfGoodsLNG());
msgHeader.setManualEntryYear(content.getManualEntryYear());
msgHeader.setAgreedLocationOfGoods(content.getAgreedLocationCode());
msgHeader.setMethodOfPayment(content.getMethodOfPayment());
msgHeader.setNationalityOfMeansOfTransportCrossingBorder(content.getNationalityMeansOfTransportCrossingBorder());
msgHeader.setAmendmentPlace(content.getDeclarationPlace()); // TODO: correct?
msgHeader.setAmendmentPlaceLNG(content.getDeclarationPlaceLNG()); // TODO: correct?
msgHeader.setTotalNumberOfItems(content.getTotalNumberOfItems());
msgHeader.setAcceptanceDate(content.getAcceptanceDate());
... to this:
msgHeader.setAcceptanceDate(content.getAcceptanceDate());
msgHeader.setAgreedLocationOfGoods(content.getAgreedLocationCode());
msgHeader.setAgreedLocationOfGoodsCode(content.getAgreedLocationCode());
msgHeader.setAgreedLocationOfGoodsLNG(content.getAgreedLoclOfGoodsLNG());
msgHeader.setAmendmentPlace(content.getDeclarationPlace()); // TODO: correct?
msgHeader.setAmendmentPlaceLNG(content.getDeclarationPlaceLNG()); // TODO: correct?
msgHeader.setCountryOfDestinationCode(content.getCountryOfDestinationCode());
msgHeader.setCountryOfDispatchExportCode(content.getCountryOfDispatch());
msgHeader.setDateOfAmendment(content.getDeclarationDate()); // TODO: correct?
msgHeader.setIdentityOfMeansOfTransportCrossingBorder(content.getIdentityMeansOfTransportCrossingBorder());
msgHeader.setManualEntryNumber(content.getManualEntryNumber());
msgHeader.setManualEntryYear(content.getManualEntryYear());
msgHeader.setMethodOfPayment(content.getMethodOfPayment());
msgHeader.setNationalityOfMeansOfTransportCrossingBorder(content.getNationalityMeansOfTransportCrossingBorder());
msgHeader.setReferenceNumber(content.getReferenceNumber());
msgHeader.setTotalGrossMass(content.getTotalGrossMass());
msgHeader.setTotalNumberOfItems(content.getTotalNumberOfItems());
msgHeader.setTotalNumberOfPackages(content.getTotalNumberOfPackages());
msgHeader.setTransportModeAtBorder(content.getTransportModeAtBorder());
Horribly ugly website, but AnyEdit does sorting:
With luna you can do this by "Source" -> "Organize Imports"
This works for every type of line, not just imports.
Try this plugin for Eclipse:
http://marketplace.eclipse.org/content/emacs
If the above one doesn't do the job, try one of these ones:
http://marketplace.eclipse.org/search/apachesolr_search/emacs
In Eclipse Kepler SR2 I can see an option under Source > Sort Members..
It works.
I also have AnyEdit installed.
Try CTRL+ALT+S. Works for me with Kepler.
If it doesn't work, goto Help->Key Assist... and look for "Sort Lines"
EDIT: seems to work only in the C/C++ Editor and therefore probably comes with the CDT
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With