Constantinos,<br><br>Thanks for the script, at first test it doesnt work but I'll dig into it to figure out a way to make it work.<br><br>Thanks again....<br><br><div><span class="gmail_quote">On 6/2/07, <b class="gmail_sendername">
Constantinos Neophytou ♎</b> <<a href="mailto:jaguarcy@gmail.com">jaguarcy@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I think this could probably be accomplished with a simple python (or<br>ruby) script that took the line as input, then did<br>print "%-100s" % thetext<br>or something like that and replaced the line? (or place it in a macro
<br>that first selects the line, and the command replaces the selection...)<br><br><br>As for the original question, woulnd't it be failry straight forward<br>to have something like:<br><br>sometext⇥more text<br>somemoretext⇥and a bit more
<br>whateverelse⇥some more<br><br>then opt-shift-up, and parse the selection through a small python<br>script that splits each line on the tab character, finds the longest<br>first half of a line, and aligns everything using spaces...
<br><br>in fact, this seems to work as a command (takes the first tab it<br>finds in every line, and adds enough spaces before it so that all the<br>first tabs in each line align):<br><br>Command<br>Input: Selected Text or Nothing
<br>Output: Replace Selected Text<br>Activation: Key Equivalent (i set it to cmd-opt-shift-r)<br>Command:<br><br>#!/usr/bin/env python<br>import os<br><br>selectedText = ''<br>splitMarker = "\t"<br>joinMarker = "\t"
<br><br>if 'TM_SELECTED_TEXT' in os.environ:<br>        selectedText = os.environ['TM_SELECTED_TEXT']<br>        lines = selectedText.splitlines()<br>        length = 0<br>        for i in range(len(lines)):
<br>                sec = lines[i].split(splitMarker)<br>                length = max(length, len(sec[0]))<br>        l = "%%-%ds" % length<br>        for j in range(len(lines)):<br>                sec = lines[j].split(splitMarker)
<br>                sec[0] = l % sec[0]<br>                print joinMarker.join(sec)<br><br><br>This is very rough, i wrote it while writing this email, but it seems<br>to work. Using it in the above proposed method also seems to work
<br>(i.e. write all the data in a column block, have the first tab where<br>you want everything to align, opt-shift-up, opt-cmd-shift-R)<br><br>Note instead of the first tab, the align 'marker' can be anything...<br>
<br>On Jun 2, 2007, at 12:38 PM, Piero D''Ancona wrote:<br><br>> Allan Odgaard <throw-away-1@...> writes:<br>><br>>><br>>> On 2. Jun 2007, at 06:54, Helmut Granda wrote:<br>>><br>>>> for example is it possible to write a snippet to do something
<br>>>> like...<br>>>><br>>>> text (move to column 100)moreText<br>>>><br>>>> does that makes sense? sort of tabbing but using column numbers<br>>>> instead (margins?)
<br>>><br>>> Other than actually inserting the required number of spaces, no,<br>>> there is no such shortcut.<br>>><br>>><br>><br>> If the text to be inserted is always the same, you can record
<br>> a macro which inserts some text, moves to the right (press<br>> right arrow 100 times) then inserts some more text...<br>><br>><br>><br>><br>><br>> ______________________________________________________________________
<br>> For new threads USE THIS: <a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>> (threading gets destroyed and the universe will collapse if you don't)<br>> <a href="http://lists.macromates.com/mailman/listinfo/textmate">
http://lists.macromates.com/mailman/listinfo/textmate</a><br><br>--<br>What's your Dream?<br>Make it happen with <a href="http://www.dostpost.com">www.dostpost.com</a><br><br><br><br><br><br>______________________________________________________________________
<br>For new threads USE THIS: <a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>(threading gets destroyed and the universe will collapse if you don't)<br><a href="http://lists.macromates.com/mailman/listinfo/textmate">
http://lists.macromates.com/mailman/listinfo/textmate</a><br><br></blockquote></div><br>