Is there a way in the Community Edition (thanks, JetBrains!) to sort selected lines of text? Either buit-in, a plugin, or "escape" to the underlying OS would be fine.
Please provide more information about your use-case, i.e. it's not that clear what is your target file type (java, xml, properties etc) and what sort criteria do you want to use.
I am trying to sort the import statements in Java and Scala source files. Being able to do a general lines sort in text files would be useful also (simply sort all selected lines case-sensitive or insensitive).
Already did, but there does not seems to be a way to do this in the Scala plugin. A more general solution (albeit tedious) is to allow the user the sort arbitrary lines in the file.
Out of curiousity why would you want to sort your imports? I generally don't even give a 2nd thought about imports. IntelliJ takes care of them and on occasion I have to decide between some ambigious imports. That is about it.
If you really want to sort them you can cut/paste them into a text file on your Mac and then from the command-line (terminal) run:
cat myfile.txt | sort
then cut/paste them back in.
Seems tedious though.
Also, use cmd-alt-o to organize your imports (doesn't sort them, but tidies them up)
Hello,
Please provide more information about your use-case, i.e. it's not that clear what is your target file type (java, xml, properties etc) and what sort criteria do you want to use.
Regards, Denis
I am trying to sort the import statements in Java and Scala source files. Being able to do a general lines sort in text files would be useful also (simply sort all selected lines case-sensitive or insensitive).
Take a look at Settings -> Code Style -> Imports
Already did, but there does not seems to be a way to do this in the Scala plugin. A more general solution
(albeit tedious) is to allow the user the sort arbitrary lines in the file.
Out of curiousity why would you want to sort your imports? I generally don't even give a 2nd thought about imports. IntelliJ takes care of them and on occasion I have to decide between some ambigious imports. That is about it.
If you really want to sort them you can cut/paste them into a text file on your Mac and then from the command-line (terminal) run:
cat myfile.txt | sort
then cut/paste them back in.
Seems tedious though.
Also, use cmd-alt-o to organize your imports (doesn't sort them, but tidies them up)
It should be a pretty quick job to modify this plugin to do what you want:
http://code.google.com/p/ideapropertysorterplugin/
Additionally, perhaps it's worth making a feature request to the people developing
the scala plugin.