From bibiko@eva.mpg.de Thu Nov 30 22:53:48 2006 From: Hans-Joerg Bibiko To: textmate@lists.macromates.com Subject: [TxMt] HTML Bundle: Insert Table Row x Column Date: Thu, 30 Nov 2006 23:53:30 +0100 Message-ID: <20061130235330.wu8u56ud0lzc44os@email.eva.mpg.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5286684951801185684==" --===============5286684951801185684== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi, I got some mails regarding to Hypersearch > GetAllMatches which can transform a table written as a TAB b TAB NEWLINE ... to an HTML formatted . The question was whether it is possible to write a snippet like 'table TAB' to insert an HTML table based on the user's dimension input. I wrote such a semi snippet as a command and I want to post it here. Maybe it is also interesting for others. The basic idea is to ask the user for the dimension and style with the help of a Cocoa inputbox. Syntax: row column {style} delimited by whatever (of course no digit;) Examples: 3 x 4 will include three rows and four colums where each is written in a separate line 2 3 1 will include two rows and three colums where each is written in one line per row, i.e 4 will include four rows and four colums where each is written in a separate line Its scope is text.html and the used shortcut is crtl+shift+t and you can use TAB to jump to the next cell. The only question I have is whether it is possible to invoke this command like a normal snippet via e.g. 'tablexy TAB'. -Hans ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. --===============5286684951801185684== Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="InsertTableRowxColumn.tmCommand" MIME-Version: 1.0 PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBsaXN0IFBV QkxJQyAiLS8vQXBwbGUgQ29tcHV0ZXIvL0RURCBQTElTVCAxLjAvL0VOIiAiaHR0cDovL3d3dy5h cHBsZS5jb20vRFREcy9Qcm9wZXJ0eUxpc3QtMS4wLmR0ZCI+CjxwbGlzdCB2ZXJzaW9uPSIxLjAi Pgo8ZGljdD4KCTxrZXk+YmVmb3JlUnVubmluZ0NvbW1hbmQ8L2tleT4KCTxzdHJpbmc+bm9wPC9z dHJp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p dmFsZW50PC9rZXk+Cgk8c3RyaW5nPl5UPC9zdHJpbmc+Cgk8a2V5Pm5hbWU8L2tleT4KCTxzdHJp bmc+SW5zZXJ0IFRhYmxlIFJvdyB4IENvbHVtbjwvc3RyaW5nPgoJPGtleT5vdXRwdXQ8L2tleT4K CTxzdHJpbmc+aW5zZXJ0QXNTbmlwcGV0PC9zdHJpbmc+Cgk8a2V5PnNjb3BlPC9rZXk+Cgk8c3Ry aW5nPnRleHQuaHRtbDwvc3RyaW5nPgoJPGtleT51dWlkPC9rZXk+Cgk8c3RyaW5nPjcyNURDRkQz LTYyQjQtNEJERS04MzRGLUFENjU2QjAxRjJDNDwvc3RyaW5nPgo8L2RpY3Q+CjwvcGxpc3Q+Cg== --===============5286684951801185684==-- From throw-away-1@macromates.com Sun Feb 11 11:40:25 2007 From: Allan Odgaard To: textmate@lists.macromates.com Subject: Re: [TxMt] HTML Bundle: Insert Table Row x Column Date: Sun, 11 Feb 2007 12:40:19 +0100 Message-ID: In-Reply-To: <20061130235330.wu8u56ud0lzc44os@email.eva.mpg.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0695837736096384429==" --===============0695837736096384429== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 30. Nov 2006, at 23:53, Hans-Joerg Bibiko wrote: > [...] > The only question I have is whether it is possible to invoke this > command like a normal snippet via e.g. 'tablexy TAB'. Yes, commands can use a tab trigger as the activation method. --===============0695837736096384429==--