I'm still very much a TextMate (and mailing list) newbie, so haven't quite got my head around everything - apologies if this is already some built-in thing I am unaware of or if this has already been covered before. Here's something that might prove a minor challenge to my fellow list subscribers (well it does to me).
I have a file which is essentially just a list of things. I haven't been overly diligent in keeping things in alphabetical order and now I want to sort the file. I know that I can use the command line and use a UNIX sort on it. In Vim I used to invoke the ! and run it through sort, outputting the results back into the buffer without having to leave Vim. So, is there a way to do it within TextMate?
What if I only wanted to sort a selection and overwrite that selection with the sorted version of the selection? What about a reverse sort? Column selections?
I'd be interested to hear your thoughts.
Stuart
On 20. nov 2004, at 13:51, Stuart Wheeler wrote:
I have a file which is essentially just a list of things. I haven't been overly diligent in keeping things in alphabetical order and now I want to sort the file. I know that I can use the command line and use a UNIX sort on it. In Vim I used to invoke the ! and run it through sort, outputting the results back into the buffer without having to leave Vim. So, is there a way to do it within TextMate?
Yes, in the menu Text -> Filter Through Command, eveything like that can be done. There you can also set if you want only the selection or the entire document fed to the external command, and what to do with the result. As for column selections, everything works fine whith those as well :-).
Using the Command menu, you can also set up the commands you use most frequently, and assign to them hotkeys for fast and easy invocation.
Thanks, Sune. I'll give that a try.
Stuart
On 20 Nov 2004, at 14:04, Sune Foldager wrote:
On 20. nov 2004, at 13:51, Stuart Wheeler wrote:
I have a file which is essentially just a list of things. I haven't been overly diligent in keeping things in alphabetical order and now I want to sort the file. I know that I can use the command line and use a UNIX sort on it. In Vim I used to invoke the ! and run it through sort, outputting the results back into the buffer without having to leave Vim. So, is there a way to do it within TextMate?
Yes, in the menu Text -> Filter Through Command, eveything like that can be done. There you can also set if you want only the selection or the entire document fed to the external command, and what to do with the result. As for column selections, everything works fine whith those as well :-).
Using the Command menu, you can also set up the commands you use most frequently, and assign to them hotkeys for fast and easy invocation.
-- Sune. "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn" http://cyanite.org .: Amor Fati :.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/mailman/listinfo/textmate