michaelfox + textmate 139
hiddenbek/subl-handler
9 weeks ago by michaelfox
txmt://open/?url=file:///etc/passwd&line=10&column=2
textmate
sublime
editor
tools
protocols
urls
9 weeks ago by michaelfox
Keymando keyboard shortcuts — Gist
january 2012 by michaelfox
Dan Rogers (@danro)
12/2/11 3:42 PM
If you use multiple text-editors on the mac (ie. TextMate + Xcode), @keymando is a fantastic key remap tool. My config: gist.github.com/1424734
textmate
xcode
config
dotfiles
keymando
gist
github
12/2/11 3:42 PM
If you use multiple text-editors on the mac (ie. TextMate + Xcode), @keymando is a fantastic key remap tool. My config: gist.github.com/1424734
january 2012 by michaelfox
MultiMarkdown
june 2011 by michaelfox
Go to the downloads page on github to find the latest versions of:
MultiMarkdown installer for Mac OS X
MMD support files installer for Mac OS X
QuickLook generator for MMD text files and for OPML files
Mac OS X drag and drop applications for MMD
MultiMarkdown installer for Windows
latest source code to compile MMD yourself (e.g. for *nix)
If you are interested in the LaTeX features, you also download the LaTeX support files on github.
You can also download:
LaTeX support files — required for compiling the sample documents, and useful for your own documents
MultiMarkdown Test Suite for developers
A gallery of sample MultiMarkdown documents demonstrating various output formats and features
A MMD bundle for TextMate
A MMD export plug-in for OmniOutliner
The MMD support files for other systems
downloads
latex
markdown
textmate
markup
tools
osx
MultiMarkdown installer for Mac OS X
MMD support files installer for Mac OS X
QuickLook generator for MMD text files and for OPML files
Mac OS X drag and drop applications for MMD
MultiMarkdown installer for Windows
latest source code to compile MMD yourself (e.g. for *nix)
If you are interested in the LaTeX features, you also download the LaTeX support files on github.
You can also download:
LaTeX support files — required for compiling the sample documents, and useful for your own documents
MultiMarkdown Test Suite for developers
A gallery of sample MultiMarkdown documents demonstrating various output formats and features
A MMD bundle for TextMate
A MMD export plug-in for OmniOutliner
The MMD support files for other systems
june 2011 by michaelfox
drdrang/blog-preview - GitHub
june 2011 by michaelfox
Set of script and style files for a local preview of blog posts that matches the style of my blog
This is unlikely to be of use to anyone other than me, but…
I wanted a TextMate command that would generate a local preview of my blog posts that matched the look of the published posts. I write my posts in a variant of Markdown and use some JavaScript to further reformat some of the content (equations, numbered lines of code, and footnotes). The post-preview.php script converts the Markdown to an HTML fragment, wraps that fragment in boilerplate HTML that references the necessary JavaScript and style files, and saves the result to a file, post-preview.html, in the directory with the scripts. The TextMate command I use to preview my posts is this addition to the Blogging Bundle, called Good Preview:
The two lines of code are
php ~/blog-preview/post-preview.php > ~/blog-preview/post-preview.html
open ~/blog-preview/post-preview.html
The first line runs the post-preview.php script, creating or overwriting the post-preview.html file. The second line opens post-preview.html in my default browser. The Good Preview TextMate command is not included in the repository, which is why I've reproduced it here.
I deleted the original Preview command from the Blogging bundle and removed the ⌃⌥⌘P Key Equivalent from the Preview commands in the Markdown bundle. It might have been smarter to use a different key combination for Good Preview and preserve ⌃⌥⌘P for the standard behavior. Oh well…
php
textmate
blog
preview
inspiration
This is unlikely to be of use to anyone other than me, but…
I wanted a TextMate command that would generate a local preview of my blog posts that matched the look of the published posts. I write my posts in a variant of Markdown and use some JavaScript to further reformat some of the content (equations, numbered lines of code, and footnotes). The post-preview.php script converts the Markdown to an HTML fragment, wraps that fragment in boilerplate HTML that references the necessary JavaScript and style files, and saves the result to a file, post-preview.html, in the directory with the scripts. The TextMate command I use to preview my posts is this addition to the Blogging Bundle, called Good Preview:
The two lines of code are
php ~/blog-preview/post-preview.php > ~/blog-preview/post-preview.html
open ~/blog-preview/post-preview.html
The first line runs the post-preview.php script, creating or overwriting the post-preview.html file. The second line opens post-preview.html in my default browser. The Good Preview TextMate command is not included in the repository, which is why I've reproduced it here.
I deleted the original Preview command from the Blogging bundle and removed the ⌃⌥⌘P Key Equivalent from the Preview commands in the Markdown bundle. It might have been smarter to use a different key combination for Good Preview and preserve ⌃⌥⌘P for the standard behavior. Oh well…
june 2011 by michaelfox
The Best CSS3 TextMate Bundle Ever - Some code from ccschmitz - Forrst
may 2011 by michaelfox
-webkit-$1: $2;
-khtml-$1: $2;
-moz-$1: $2;
-ms-$1: $2;
-o-$1: $2;
$1: $2;
textmate
css
css3
-khtml-$1: $2;
-moz-$1: $2;
-ms-$1: $2;
-o-$1: $2;
$1: $2;
may 2011 by michaelfox
TextMate Command to compile all LESS files into CSS in CWD - Some code from jacob - Forrst
may 2011 by michaelfox
I'm using LESS quite a bit on a new project. I have many LESS/CSS files that all get compiled together into 1 large CSS file.
The master.css file looks something like this
textmate
less
css
The master.css file looks something like this
may 2011 by michaelfox
rsync Project now.tmCommand itspriddle's gist: 107286 — Gist
april 2011 by michaelfox
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>
if [ "$SSH_KEY" != "" ] && [ "$SSH_HOST" != "" ] && [ "$SSH_USER" != "" ] && [ "$SSH_REMOTE_PATH" != "" ]; then
if [ "$RSYNC_OPTIONS" != "" ]; then
OPTS="$RSYNC_OPTIONS"
fi
if [ "$RSYNC_EXCLUDE_FROM" != "" ]; then
if [ -f "$RSYNC_EXCLUDE_FROM" ]; then
OPTS="$OPTS --exclude-from=$RSYNC_EXCLUDE_FROM"
elif [ -f "$TM_PROJECT_DIRECTORY/$RSYNC_EXCLUDE_FROM" ]; then
OPTS="$OPTS --exclude-from=$TM_PROJECT_DIRECTORY/$RSYNC_EXCLUDE_FROM"
fi
fi
OUT=`rsync -e "ssh -i $SSH_KEY" -auv $OPTS "$TM_PROJECT_DIRECTORY"/ "$SSH_USER@$SSH_HOST:$SSH_REMOTE_PATH"`
echo -e "$OUT"
</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>^@r</string>
<key>name</key>
<string>rsync Project now</string>
<key>output</key>
<string>showAsTooltip</string>
<key>uuid</key>
<string>3CB55098-1709-444B-A3BE-E72680134CF0</string>
</dict>
</plist>
gist
textmate
rsync
command
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>
if [ "$SSH_KEY" != "" ] && [ "$SSH_HOST" != "" ] && [ "$SSH_USER" != "" ] && [ "$SSH_REMOTE_PATH" != "" ]; then
if [ "$RSYNC_OPTIONS" != "" ]; then
OPTS="$RSYNC_OPTIONS"
fi
if [ "$RSYNC_EXCLUDE_FROM" != "" ]; then
if [ -f "$RSYNC_EXCLUDE_FROM" ]; then
OPTS="$OPTS --exclude-from=$RSYNC_EXCLUDE_FROM"
elif [ -f "$TM_PROJECT_DIRECTORY/$RSYNC_EXCLUDE_FROM" ]; then
OPTS="$OPTS --exclude-from=$TM_PROJECT_DIRECTORY/$RSYNC_EXCLUDE_FROM"
fi
fi
OUT=`rsync -e "ssh -i $SSH_KEY" -auv $OPTS "$TM_PROJECT_DIRECTORY"/ "$SSH_USER@$SSH_HOST:$SSH_REMOTE_PATH"`
echo -e "$OUT"
</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>^@r</string>
<key>name</key>
<string>rsync Project now</string>
<key>output</key>
<string>showAsTooltip</string>
<key>uuid</key>
<string>3CB55098-1709-444B-A3BE-E72680134CF0</string>
</dict>
</plist>
april 2011 by michaelfox
JSHint TextMate Bundle - fgnass
march 2011 by michaelfox
This happens when TextMate is started via the Finder rather than from the command-line. In this case you need to setup the PATH variable for TextMate, either via Preferences → Advanced → Shell Variables or by editing ~/.MacOSX/environment.plist
See: http://manual.macromates.com/en/shell_commands
bundle
jslint
textmate
javascript
See: http://manual.macromates.com/en/shell_commands
march 2011 by michaelfox
ReMate
march 2011 by michaelfox
ReMate is a TextMate plugin which can be used to disable the automatic project tree refresh when the application regains focus.
The plugin adds the following:
a toggleable item to the window menu labeled “Disable Refresh on Regaining Focus” - when this is checked, projects will not be updated when TextMate regains focus.
an option on the project menu (reached by right-clicking on an item in the project tree or the gear at the bottom of the project drawer) to “Refresh All Projects”
Download, extract, double-click.
mac
network
plugin
plugins
textmate
The plugin adds the following:
a toggleable item to the window menu labeled “Disable Refresh on Regaining Focus” - when this is checked, projects will not be updated when TextMate regains focus.
an option on the project menu (reached by right-clicking on an item in the project tree or the gear at the bottom of the project drawer) to “Refresh All Projects”
Download, extract, double-click.
march 2011 by michaelfox
webPragmatist/css-group-tmbundle - GitHub
march 2011 by michaelfox
The CSS Group bundle allows you to quickly add snippets to add @group tags which CSSEdit supports. — Read more
http://www.webpragmatist.com/2010/03/grouping-css-with-css-group-textmate.html
CSS Group Bundle
The CSS Group bundle allows you to quickly add snippets to add @group tags which CSSEdit supports.
Installation
1. Install the bundle
To install the bundle just run the following command.
git clone git://github.com/webPragmatist/css-group-tmbundle.git ~/Library/Application\ Support/TextMate/Bundles/css-group.tmbundle
2. Modify the CSS bundle to support folding
Line 4 of the CSS Language bundle (L) CSS contains the foldingStartMarker foldingStopMarker variables that you need to replaces with the following:
foldingStartMarker = ‘/\\(?.?\/.\S))|\/\\s*@group\s*.\s\*\/’;
foldingStopMarker = ‘(?<!\)\\/|^\s\}|\/\s@end\s*\*\/’;
3. Reload?
I dunno reload your bundles r sumthin.
Usage
To create a new group:
cssg⇥
To group the current selection:
⌃⌥⌘c
Thanks!
To the css-tricks for providing the code folding trick!
Foldable TextMate CSS Groups
textmate
css
bundles
tools
github
repo
http://www.webpragmatist.com/2010/03/grouping-css-with-css-group-textmate.html
CSS Group Bundle
The CSS Group bundle allows you to quickly add snippets to add @group tags which CSSEdit supports.
Installation
1. Install the bundle
To install the bundle just run the following command.
git clone git://github.com/webPragmatist/css-group-tmbundle.git ~/Library/Application\ Support/TextMate/Bundles/css-group.tmbundle
2. Modify the CSS bundle to support folding
Line 4 of the CSS Language bundle (L) CSS contains the foldingStartMarker foldingStopMarker variables that you need to replaces with the following:
foldingStartMarker = ‘/\\(?.?\/.\S))|\/\\s*@group\s*.\s\*\/’;
foldingStopMarker = ‘(?<!\)\\/|^\s\}|\/\s@end\s*\*\/’;
3. Reload?
I dunno reload your bundles r sumthin.
Usage
To create a new group:
cssg⇥
To group the current selection:
⌃⌥⌘c
Thanks!
To the css-tricks for providing the code folding trick!
Foldable TextMate CSS Groups
march 2011 by michaelfox
fgnass/jshint.tmbundle - GitHub
march 2011 by michaelfox
TextMate bundle for JSHint, the (Gentler) JavaScript Code Quality Tool.
Features:
Pretty UI
Runs automatically upon save (⌘S)
Can be bypassed by pressing ⇧⌘S
Output is only shown when errors are found
Window is automatically closed when it looses focus
Based on Node.js
Installation
Download the zip file and rename the extracted folder to jshint.tmbundle. Double-click.
Prerequisites
You need Node.js and TextMate, that's all.
jshint
jslint
javascript
textmate
tools
plugins
bundles
codequality
Features:
Pretty UI
Runs automatically upon save (⌘S)
Can be bypassed by pressing ⇧⌘S
Output is only shown when errors are found
Window is automatically closed when it looses focus
Based on Node.js
Installation
Download the zip file and rename the extracted folder to jshint.tmbundle. Double-click.
Prerequisites
You need Node.js and TextMate, that's all.
march 2011 by michaelfox
[no title]
february 2011 by michaelfox
Key bindings
============
If a key is appropriate, language grammars should have ctrl-shift-option as modifier, and the first letter of the language name as key.
Other bundle items should generally have ctrl-shift as modifier.
These keys are often specialized for a language:
command-B -- build
command-R -- run
ctrl-H -- lookup current word/selection in the documentation
ctrl-shift-V -- validate (show syntactical errors)
ctrl-shift-W -- wrap selection (e.g. in begin/end tags for HTML)
shift-return -- create a function/method body with previous word as name
ctrl-return -- insert a “descriptive” return (e.g. \n in strings, <br> in HTML)
cmd-return -- move to end of line and insert a newline (this is not specialized)
cmd-option-return -- move to end of line and insert potential end-of-line symbol (; in many sources, . in prose)
cmd-shift-return -- as cmd-option-return, but also insert a newline
enter -- insert a newline and start a new “item” (e.g. line comment, bullet point, etc.)
Naming Bundle Items
===================
Bundle items should use Title Case.
Avoid repeating the name of the bundle in the command name. For example under Ruby we have Run Script and not Run Ruby Script and under Xcode we have Build, not Build Xcode Project, etc.
Be concise in the name, i.e. make it evident what the command does without writing a page full of information. Refrain from using abbreviations.
Snippets
========
Use tabs instead of spaces in snippets (if the user uses spaces as tabs, TM will convert the snippet when inserted).
Generally fill in default text in placeholders. This is a cue both to where the placeholders (tab stops) are, and what value they're likely to take.
Name the snippet after what it inserts, using “..” for placeholders and put the (potential) tab-trigger in parentheses. If it inserts a lot, either name it after the start of what's inserted, or find a descriptive name for what it inserts.
Choose a tab-trigger which you can remember in half a year. I.e. normally use the first word of what's being inserted instead of an abbreviation. This will make it easier to remember, and it also allows expansion even if the user started to type the actual construct, before remembering the snippet.
Language grammars
=================
When you put comments in these, please add your name if it's stating a problem, asking a question etc.
textmate
============
If a key is appropriate, language grammars should have ctrl-shift-option as modifier, and the first letter of the language name as key.
Other bundle items should generally have ctrl-shift as modifier.
These keys are often specialized for a language:
command-B -- build
command-R -- run
ctrl-H -- lookup current word/selection in the documentation
ctrl-shift-V -- validate (show syntactical errors)
ctrl-shift-W -- wrap selection (e.g. in begin/end tags for HTML)
shift-return -- create a function/method body with previous word as name
ctrl-return -- insert a “descriptive” return (e.g. \n in strings, <br> in HTML)
cmd-return -- move to end of line and insert a newline (this is not specialized)
cmd-option-return -- move to end of line and insert potential end-of-line symbol (; in many sources, . in prose)
cmd-shift-return -- as cmd-option-return, but also insert a newline
enter -- insert a newline and start a new “item” (e.g. line comment, bullet point, etc.)
Naming Bundle Items
===================
Bundle items should use Title Case.
Avoid repeating the name of the bundle in the command name. For example under Ruby we have Run Script and not Run Ruby Script and under Xcode we have Build, not Build Xcode Project, etc.
Be concise in the name, i.e. make it evident what the command does without writing a page full of information. Refrain from using abbreviations.
Snippets
========
Use tabs instead of spaces in snippets (if the user uses spaces as tabs, TM will convert the snippet when inserted).
Generally fill in default text in placeholders. This is a cue both to where the placeholders (tab stops) are, and what value they're likely to take.
Name the snippet after what it inserts, using “..” for placeholders and put the (potential) tab-trigger in parentheses. If it inserts a lot, either name it after the start of what's inserted, or find a descriptive name for what it inserts.
Choose a tab-trigger which you can remember in half a year. I.e. normally use the first word of what's being inserted instead of an abbreviation. This will make it easier to remember, and it also allows expansion even if the user started to type the actual construct, before remembering the snippet.
Language grammars
=================
When you put comments in these, please add your name if it's stating a problem, asking a question etc.
february 2011 by michaelfox
After thought » TextMate’s little surprises
february 2011 by michaelfox
//-${1/(.)|(?m:\n.*)/(?1:-)/g}
// ${1:${TM_SELECTED_TEXT:Comment}}
//-${1/(.)|(?m:\n.*)/(?1:-)/g}
//--------
// Comment
//--------
textmate
// ${1:${TM_SELECTED_TEXT:Comment}}
//-${1/(.)|(?m:\n.*)/(?1:-)/g}
//--------
// Comment
//--------
february 2011 by michaelfox
jezdez/textmate-missingdrawer - GitHub
december 2010 by michaelfox
A better sidebar for Textmate.
extension
plugin
plugins
textmate
tools
ide
editor
project
december 2010 by michaelfox
iPhone SDK: Testing with TextMate & GTM | Pathfinder Development | Software Developers | Blogs
december 2010 by michaelfox
Developing in Xcode, I keep my project default "SDKROOT" and Target set to the default for the iPhone device and 'Release', respectively.
That said, I have been trying out TextMate as an alternative to Xcode, thanks to all of the great things TextMate provides (I won't go into all that here, since there are already many great resources on the web). For those iPhone developers who are new to the Mac platform, or to TextMate for that matter, here's a quick tip (and be sure to check install Xcode bundle first).
First, as always, an obligatory shout-out to Google Toolbox for Mac. I am testing my code with GTM, and set the following environment variables so that Xcode plugin for TextMate could run a build / tests accordingly.
ios
textmate
sdk
testing
gtm
That said, I have been trying out TextMate as an alternative to Xcode, thanks to all of the great things TextMate provides (I won't go into all that here, since there are already many great resources on the web). For those iPhone developers who are new to the Mac platform, or to TextMate for that matter, here's a quick tip (and be sure to check install Xcode bundle first).
First, as always, an obligatory shout-out to Google Toolbox for Mac. I am testing my code with GTM, and set the following environment variables so that Xcode plugin for TextMate could run a build / tests accordingly.
december 2010 by michaelfox
bleything.blog(:stuff) Keeping TextMate Bundles Up To Date with Ruby
december 2010 by michaelfox
Those TextMate powerusers out there are likely familiar with the sheer awesomeness of the Bundle facility. No doubt you’re also aware that you can live on the edge by checking bundles out from subversion.
The problem is, there are a TON of bundles, and I simply don’t care about the majority of them. Having a ton of bundles slows down the application launch and makes the Bundles menu unwieldy. The obvious solution is to only check out those bundles you are interested in… but when that list is close to 50 items long, it gets tedious.
So what’s a hacker to do? Write a script? You bet your boots. In an effort to keep the size of this entry down, I’ve put the script on a separate page, located here.
To use it, edit the bundles array to include the list of bundles you want to keep up-to-date. Put the script in your path, chmod +x it, and run it. If your Bundles directory doesn’t exist, it’ll create it for you. If it sees a bundle it doesn’t know about, it’ll ask you whether you want to delete it. This brings us to a neat thing I discovered. Try this in irb:
puts "whoa!" if gets =~ /^(n|$)/i
I was trying to allow the user to just enter to accept the default (no) answer when it asks if you want to delete. I wasn’t expecting the regex above to actually work, but it does… essentially, if the first character of the line is either ‘n’ or the end of the line, it’s true. Cool, yeah?
Please, go check it out, and use it if it makes your life easier. I’ll gladly take suggestions and improvements as well!
textmate
bundle
mac
ruby
The problem is, there are a TON of bundles, and I simply don’t care about the majority of them. Having a ton of bundles slows down the application launch and makes the Bundles menu unwieldy. The obvious solution is to only check out those bundles you are interested in… but when that list is close to 50 items long, it gets tedious.
So what’s a hacker to do? Write a script? You bet your boots. In an effort to keep the size of this entry down, I’ve put the script on a separate page, located here.
To use it, edit the bundles array to include the list of bundles you want to keep up-to-date. Put the script in your path, chmod +x it, and run it. If your Bundles directory doesn’t exist, it’ll create it for you. If it sees a bundle it doesn’t know about, it’ll ask you whether you want to delete it. This brings us to a neat thing I discovered. Try this in irb:
puts "whoa!" if gets =~ /^(n|$)/i
I was trying to allow the user to just enter to accept the default (no) answer when it asks if you want to delete. I wasn’t expecting the regex above to actually work, but it does… essentially, if the first character of the line is either ‘n’ or the end of the line, it’s true. Cool, yeah?
Please, go check it out, and use it if it makes your life easier. I’ll gladly take suggestions and improvements as well!
december 2010 by michaelfox
Cocoa Text System
october 2010 by michaelfox
Apple’s Cocoa text system is a complicated beast, but also extremely flexible, and with a bit of work, it can be molded to match many working styles. This how-to covers the 2 major ways of customizing the text input system: Default key bindings, and for still more control, input managers.
I’m writing this guide because nothing like it currently exists. There is incredible room for flexibility in customizing the Cocoa text environment, but most users—even power-users—have no idea of the available options. This is mostly because Apple’s documentation is 1) aimed at developers, and 2) often incomplete or ambiguous. Most users have no idea that they can look at a file which describes all of the shortcuts on the system, and that they can easily add their own shortcuts, or replace existing ones with differing functionality.
For instance, one of the most common complaints from new Windows and Linux/Unix switchers is that many of the shortcuts they are used to, such as using the Home and End keys to move to the beginning, respectively end, of a line or document, don’t work as they expect in OS X.
For new users, almost every text box you use is a Cocoa text box (or close enough to act the same as far as we’re concerned) — Safari web form boxes, the text field in iChat for sending new messages, the documents in Pages or TextEdit, the email composer in Mail, etc. Note: Some text boxes are not Cocoa however, so the tricks in this article still aren’t completely universal. Notably, Microsoft Word, Adobe applications, AppleWorks, and the text fields in Camino and Firefox won’t work with this hint.
I expect that all users of OS X can get something out of this guide. I’m starting with the basics, so that new users, unfamiliar with the terminal and the intricacies of OS X can be brought up to speed. But even the most experienced users should hopefully learn something from this article; I know I learned several new nifty things while writing it.
Disclaimer: it is possible, when mucking around with the text system, to send applications messages they aren’t expecting. This can cause them to crash. As long as you stick to standard text selectors, you should be fine, but I’m not responsible if your program crashes because of a binding you add.
bindings
cocoa
keybindings
keyboard
text
osx
mac
programming
development
textmate
input
editing
system
hack
productivity
editor
howto
tutorial
reference
★
I’m writing this guide because nothing like it currently exists. There is incredible room for flexibility in customizing the Cocoa text environment, but most users—even power-users—have no idea of the available options. This is mostly because Apple’s documentation is 1) aimed at developers, and 2) often incomplete or ambiguous. Most users have no idea that they can look at a file which describes all of the shortcuts on the system, and that they can easily add their own shortcuts, or replace existing ones with differing functionality.
For instance, one of the most common complaints from new Windows and Linux/Unix switchers is that many of the shortcuts they are used to, such as using the Home and End keys to move to the beginning, respectively end, of a line or document, don’t work as they expect in OS X.
For new users, almost every text box you use is a Cocoa text box (or close enough to act the same as far as we’re concerned) — Safari web form boxes, the text field in iChat for sending new messages, the documents in Pages or TextEdit, the email composer in Mail, etc. Note: Some text boxes are not Cocoa however, so the tricks in this article still aren’t completely universal. Notably, Microsoft Word, Adobe applications, AppleWorks, and the text fields in Camino and Firefox won’t work with this hint.
I expect that all users of OS X can get something out of this guide. I’m starting with the basics, so that new users, unfamiliar with the terminal and the intricacies of OS X can be brought up to speed. But even the most experienced users should hopefully learn something from this article; I know I learned several new nifty things while writing it.
Disclaimer: it is possible, when mucking around with the text system, to send applications messages they aren’t expecting. This can cause them to crash. As long as you stick to standard text selectors, you should be fine, but I’m not responsible if your program crashes because of a binding you add.
october 2010 by michaelfox
TextMate Blog » Key bindings for switchers
october 2010 by michaelfox
This entry isn't just for switchers, but I've gotten several requests for making the home/end function keys go to the beginning/end of current line, which is how Windows does it, hence the title.
While this is possible to setup within TextMate, I'm certain that the people requesting this would be happier with a solution that applies to all good OS X citizens (i.e. who make use of the standard key bindings system like Mail, Safari and other Cocoa applications). So here's a detailed description of how to achieve this and more.
The standard key bindings are located in this file: /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict. This file is in XML, and function keys are stored using their actual character code, making it a bit hard to decipher, for our customization we'll use the old-style ASCII format, and we'll ignore this base file (since the system merges the files, giving our local file precedence when there's a conflict).
Our local file should be located in ~/Library/KeyBindings, this folder may not exist, so to create it (from Terminal) execute:
keybindings
mac
macosx
textmate
While this is possible to setup within TextMate, I'm certain that the people requesting this would be happier with a solution that applies to all good OS X citizens (i.e. who make use of the standard key bindings system like Mail, Safari and other Cocoa applications). So here's a detailed description of how to achieve this and more.
The standard key bindings are located in this file: /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict. This file is in XML, and function keys are stored using their actual character code, making it a bit hard to decipher, for our customization we'll use the old-style ASCII format, and we'll ignore this base file (since the system merges the files, giving our local file precedence when there's a conflict).
Our local file should be located in ~/Library/KeyBindings, this folder may not exist, so to create it (from Terminal) execute:
october 2010 by michaelfox
TextMate command snippet - show document path in window title - Bash - Snipplr Social Snippet Repository
october 2010 by michaelfox
TextMate command snippet - show document path in window title
Published in: Bash
Instructions
1. Create a new Command: Bundles > Bundle Editor > Edit Commands
2. Click the "+" button to add a new command
3. Give your command a descriptive name ("TM Path in title", for example)
4. Set the following properties on the command: {save:Nothing, Input:None, Output:Show as Tool Tip, Activation:⌥⌘T, Scope Selector: NULL}
5. Close the command window
6. Test out a document inside a project. The title should be replaced with an absolute path based on the root directory of your project.
Feedback and improvements are absolutely welcome. I'm looking to find a way to automatically fire this when a document is opened. Anybody know if this is possible?
Expand | Embed | Plain Text
Copy this code and paste it in your HTML
1.
#!/bin/bash
2.
A=${TM_PROJECT_DIRECTORY:-""}
3.
B=${A##*/}
4.
C=${TM_FILEPATH:-""}
5.
D=${C/$A/\/$B}
6.
[[ ! -z $C ]] && { osascript -e "tell application \"TextMate\" to set name of window 1 to \"$D\""; }
7.
:
textmate
Published in: Bash
Instructions
1. Create a new Command: Bundles > Bundle Editor > Edit Commands
2. Click the "+" button to add a new command
3. Give your command a descriptive name ("TM Path in title", for example)
4. Set the following properties on the command: {save:Nothing, Input:None, Output:Show as Tool Tip, Activation:⌥⌘T, Scope Selector: NULL}
5. Close the command window
6. Test out a document inside a project. The title should be replaced with an absolute path based on the root directory of your project.
Feedback and improvements are absolutely welcome. I'm looking to find a way to automatically fire this when a document is opened. Anybody know if this is possible?
Expand | Embed | Plain Text
Copy this code and paste it in your HTML
1.
#!/bin/bash
2.
A=${TM_PROJECT_DIRECTORY:-""}
3.
B=${A##*/}
4.
C=${TM_FILEPATH:-""}
5.
D=${C/$A/\/$B}
6.
[[ ! -z $C ]] && { osascript -e "tell application \"TextMate\" to set name of window 1 to \"$D\""; }
7.
:
october 2010 by michaelfox
Ciarán Walsh’s Blog » TextMate Tip – Project Navigation
october 2010 by michaelfox
Today I’ll talk about getting around in your projects. First up: moving between tabs in the project window.
To switch to the tab to either side of the current one you can use ⌥⌘← and ⌥⌘→, and to move directly to a tab simply press ⌘ and a number from 1-9. You can use the mouse to reposition tabs to move related files next to each other, to make switching easier.
The star of the show today is:
Go to file
Display this window by using Navigation → Go to File…, or by pressing ⌘T.
Much like the bundle item search window, here you enter a query which matches against the files in the project, and you can press ↩ to open that file. It also remembers query/file combinations, so that you can easily get to files you use often – and as an added bonus, it shows the files in the order they were last used, which means you can easily switch to the last file/tab you were in by pressing ⌘T and then ↩.
Note: Pressing the disclosure arrow at the bottom left of the window will allow you to set up additional filtering by extension for the files displayed in the list.
Another very useful function is the Navigation → Go to Header/Source, bound to ⌥⌘↑ – this moves to the next file in the project with the same base name (without the extension) as the current file. For example, when working on a controller file example.php and a template file example.tpl, (or an implementation file example.c and a header file example.h) then ⌥⌘↑ will switch between them.
One last little tip: you can press ⌃⌘R to select (Reveal) the current file in the project drawer. One nice use for this is when we want to do an SVN commit on the current file only, so we can just do ⌃⌘R ⌃⇧A. Also, you can use ⌃⇥ to switch the focus to the project drawer, this is useful when doing a commit of the whole project, i.e. ⌃⇥ ⌥↑ ⌃⇧A
As always it’s worth checking through the bundle you’re using for useful commands – for example, ⇧⌘D is commonly used to open included files (e.g. in PHP, Ruby and Xcode), ⌥⌘↓ is used to open the current project in Xcode, and the Ruby on Rails bundle has many useful shortcuts for getting around your application’s files.
textmate
keyboard
tips
To switch to the tab to either side of the current one you can use ⌥⌘← and ⌥⌘→, and to move directly to a tab simply press ⌘ and a number from 1-9. You can use the mouse to reposition tabs to move related files next to each other, to make switching easier.
The star of the show today is:
Go to file
Display this window by using Navigation → Go to File…, or by pressing ⌘T.
Much like the bundle item search window, here you enter a query which matches against the files in the project, and you can press ↩ to open that file. It also remembers query/file combinations, so that you can easily get to files you use often – and as an added bonus, it shows the files in the order they were last used, which means you can easily switch to the last file/tab you were in by pressing ⌘T and then ↩.
Note: Pressing the disclosure arrow at the bottom left of the window will allow you to set up additional filtering by extension for the files displayed in the list.
Another very useful function is the Navigation → Go to Header/Source, bound to ⌥⌘↑ – this moves to the next file in the project with the same base name (without the extension) as the current file. For example, when working on a controller file example.php and a template file example.tpl, (or an implementation file example.c and a header file example.h) then ⌥⌘↑ will switch between them.
One last little tip: you can press ⌃⌘R to select (Reveal) the current file in the project drawer. One nice use for this is when we want to do an SVN commit on the current file only, so we can just do ⌃⌘R ⌃⇧A. Also, you can use ⌃⇥ to switch the focus to the project drawer, this is useful when doing a commit of the whole project, i.e. ⌃⇥ ⌥↑ ⌃⇧A
As always it’s worth checking through the bundle you’re using for useful commands – for example, ⇧⌘D is commonly used to open included files (e.g. in PHP, Ruby and Xcode), ⌥⌘↓ is used to open the current project in Xcode, and the Ruby on Rails bundle has many useful shortcuts for getting around your application’s files.
october 2010 by michaelfox
Jannis Leidel - Resurrecting MissingDrawer plugin for TextMate
october 2010 by michaelfox
Some time ago Hetima published a plugin for TextMate called MissingDrawer which “provides Xcode-like project window interface without drawer.”
I thought this would be a great idea but found it a little incomplete. Thankfully they released the source code under the MIT license which made modifications very easy.
UPDATE: I’ve set up a Google Code project at code.google.com/p/textmate-missingdrawer/ to handle bug reports and feature requests a little better. You are very welcome to join the project and make this plugin even more useful.
UPDATE 2: Updated screenshot for 2008-03-19 version.
UPDATE 3: I fixed some of the bugs in version 2008-06-10, download it at Google Code.
So without further ado, here a current screenshot:
textmate
I thought this would be a great idea but found it a little incomplete. Thankfully they released the source code under the MIT license which made modifications very easy.
UPDATE: I’ve set up a Google Code project at code.google.com/p/textmate-missingdrawer/ to handle bug reports and feature requests a little better. You are very welcome to join the project and make this plugin even more useful.
UPDATE 2: Updated screenshot for 2008-03-19 version.
UPDATE 3: I fixed some of the bugs in version 2008-06-10, download it at Google Code.
So without further ado, here a current screenshot:
october 2010 by michaelfox
Ciarán Walsh’s Blog » TextMate Tip – Using PHP for Commands
october 2010 by michaelfox
Not many people realise that all the commands given to you by TextMate are written as simple scripts, editable by anyone, and in any language. PHP is a widespread language, but not many people are accustomed to using PHP for writing shell scripts, so they don’t know how to start writing a command – here I’ll explain how.
Let’s pretend we’re going to be writing some FAQ lists, so we’ll have a list of questions, like this:
This is the first question
This is the second question
This is the *third* question
And we want to convert it to a list of links to the questions, like this:
<a href="faqlist.html#this-is-the-first-question">This is the first question</a>
<a href="faqlist.html#this-is-the-second-question">This is the second question</a>
<a href="faqlist.html#this-is-the-third-question">This is the third question</a>
First, you’ll need to make a new command – open the bundle editor (Bundles → Bundle Editor → Show Bundle Editor… or ⌃⌥⌘B) and use the bottom left button (with a plus sign and an arrow) to create a “New Command”, and name it “Create FAQ Index”. The large text field on the right is where you’ll be entering the code for the command.
php
textmate
Let’s pretend we’re going to be writing some FAQ lists, so we’ll have a list of questions, like this:
This is the first question
This is the second question
This is the *third* question
And we want to convert it to a list of links to the questions, like this:
<a href="faqlist.html#this-is-the-first-question">This is the first question</a>
<a href="faqlist.html#this-is-the-second-question">This is the second question</a>
<a href="faqlist.html#this-is-the-third-question">This is the third question</a>
First, you’ll need to make a new command – open the bundle editor (Bundles → Bundle Editor → Show Bundle Editor… or ⌃⌥⌘B) and use the bottom left button (with a plus sign and an arrow) to create a “New Command”, and name it “Create FAQ Index”. The large text field on the right is where you’ll be entering the code for the command.
october 2010 by michaelfox
Updated TextMate tip: Go to first non-space character
october 2010 by michaelfox
I’ve done some small refinements in my Go to first non-space character TextMate tip. Instead of using a non-capturing regex, I’m now actually selecting first character, and then taking a step back from the selection. This makes the command work for lines which aren’t indented too. A small adjustment to this regex was also submitted by Abhi Beckert, which makes the command work as expected on empty lines too. You can find the updated command here.
*
*
*
*
*
*
*
*
textmate
*
*
*
*
*
*
*
*
october 2010 by michaelfox
TextMate tip: Go to first non-space character on current line
october 2010 by michaelfox
One small thing that has always bugged me with TextMate is that ⌘← goes to the beginning of the line, instead of what I prefer: the first non-space character on the line. Well, thanks to “Jacobolous” in ##textmate@irc.freenode.net, that’s not a problem anymore.
This command has been updated, you can read what was changed here.
You can now download the command here: Go To First Non-Whitespace Character
It’s actually very easy to sort out, and even though I’ve thought about fixing this before, I never managed to wrap my head around it. The whole solution is to record a macro, and it takes you about 40 seconds. The whole procedure is as follows in TextMate:
* Press ⌥⌘M to start recording a macro
* Press ⌘← to go to the beginning of the line
* Press ⌘F and search for [^\s]|\n with regular expressions enabled (Thanks to Abhi Beckert)
* Press ← to go to beginning of selection(unselecting)
* Press ⌥⌘M to stop recording the macro.
* Press ⌃⌘M to save your macro
* Give the macro a name and a key equivalent (I used ⌘← to overwrite the normal go to beginning of line behaviour)
Done!
textmate
This command has been updated, you can read what was changed here.
You can now download the command here: Go To First Non-Whitespace Character
It’s actually very easy to sort out, and even though I’ve thought about fixing this before, I never managed to wrap my head around it. The whole solution is to record a macro, and it takes you about 40 seconds. The whole procedure is as follows in TextMate:
* Press ⌥⌘M to start recording a macro
* Press ⌘← to go to the beginning of the line
* Press ⌘F and search for [^\s]|\n with regular expressions enabled (Thanks to Abhi Beckert)
* Press ← to go to beginning of selection(unselecting)
* Press ⌥⌘M to stop recording the macro.
* Press ⌃⌘M to save your macro
* Give the macro a name and a key equivalent (I used ⌘← to overwrite the normal go to beginning of line behaviour)
Done!
october 2010 by michaelfox
TextMate(2) – What we can expect to come.
october 2010 by michaelfox
I know I wasn’t the only one who immediately thought of TextMate2 when I read that some new Duke Nukem Forever footage was released,. The first thing I did was to log onto the TextMate irc channel and give Allan a wink.
ph^: allan: Now that Duke Nukem forever has released a new gameplay-video … :p
Anyway. Being a regular on the irc channel and mailing list for some time now, I’ve gained quite much information on what’s in development and even bits and pieces of what TM2 will offer.
Update: TextMate 2 should be in private alpha in a month’s time, and public beta in maybe six months. Read more here.
Update: More TM2 speculation here
DISCLAIMER: None of this is officially released, supported or confirmed by Allan/macromates.com. Some or all of this may never be part of the TextMate distribution at all. It will however be cool if it is!
Dialog2:
Dialog2 is the successor of Dialog, which intent was to allow bundles to use dialogs to request strings, show choices etc. With Dialog2, Ciaran Walsh is bringing the Dialog to the next level by amongst other code changes is introducing a set of new window helpers. It’s also written in a way that makes it a lot easier to extend and add more features later. There already is a ruby wrapper in place(Support/lib/ui.rb) which makes it very easy to take advantage of the new Dialog.
Prettier tool-tips
By using HTMLTips helper from Dialog2 you get easy access to creating custom tool tips in HTML and CSS. The result, here showed with “Documentation for Word” from the PHP Bundle: Ciaran\'s: HTML Tool Tips
Code completion
The new Dialog can also be used for code completion. Some footage shows how Dialog2 suggests functions as you type, and inserts the function as a snippet where you can tab to the next parameter. With the new aforementioned ruby wrapper for the new Dialog it should be a walk in the park for the bundle developers to add this. (I managed!)
Intelligent code completion / Intellisense
One of the biggest griefs in the community with TextMate has been the lack of intelligent code completion, often referred to as intellisense. Currently you can use ⎋ (esc) to toggle thru your previously written words and a predefined set of words defined by the bundle author, but it offers no way to see what parameters the functions and methods expects. There have been attempts by some bundle authors, but now there’s work in progress for making that easier too. Currently it requires the bundle author to write a lexer. Some example footage can be seen here(PHP), 2, 3 and here(Ruby).
Better handling of command line input (or lack thereof)
Another big problem in TM has been with shell commands that might need input. The first example that comes to mind is the subversion bundle. There is no way for the bundle to know whether you’re setup with ssh keys, ssh agent, or have to type your password every time you commit. Hence if subversion is asking for a password on STDIN while the command is executing, it will fail or even stall TextMate. Luke “alkemist” Daley set out to sort this, and with some help from allan he came up with tm_interactive_input. This basically injects into the read function in OS X and with some black magic kung fu figures out if the read process belongs to TM. If so, it will open up a dialog requesting the input.
Pretty bundles
Thomas “subtleGradient” Aylott is working on what he refers to as:
a rough framework for making gui applications built inside textmate command windows
and it looks like this: Persistent asynchronous script runner
It allows a bundle developer to create a GUI using HTML/CSS & Javascript. And the buttons in the GUI can run shell scripts and pass data to them interactively. With the possibly coming terminal stuff in TM2 it should also gain the ability to run any TextMate bundle commands, macros & snippets. .
TextMate 2
There isn’t a whole lot to say about TM2 yet, other than it’s coming. Allan has said several times that he does most of the TM2 development in TM2, so it’s there and it’s mostly working, it’s just not for the rest of us to see and use yet.
One feature that might make it into TM2 is the ability for bundles to get a copy of the current text buffer, which will allow a bundle to do some heavy scanning in the buffer, without affecting the responsiveness of TM. This is great news for auto-completion and other commands which needs to scan the whole document.
Another often requested feature is for bundles to have better access to TextMate’s scoping system. This could replace the need for a lexer for things like intellisense, and thus lower the bar for implementing such. If this makes it into TM2 only Allan knows, but I really do hope so.
I don’t really know what people expect from TM2, but your expectations should most likely be pointed towards bundles, not TextMate itself. TM2 is afaik a complete rewrite of TM, with a lot of new “invisble” features for the bundles to take advantage of, not the users directly. TextMate’s strength has never been the editor on its own, but the extensibility it supports, and thus bundles.
Other interesting things
* Yehuda Katz, with help from others on github.com has released a ruby gem that allows you to install, uninstall and list TextMate bundles like normal ruby gems. This makes it very easy for those out there who aren’t friends with subversion. You can read more about it here.
* There has been a lot discussion on how to best maintain bundles in a central repository. There has been many requests for a issue tracking system for the bundles, and I recall that both Jira and Lighthouse have been in the spotlight, but I think eventually Redmine pulled the longest straw due to its free and open nature, and that Allan can host it on macromates.com. But either way, nothing is written in stone, and there has been no final decision.
* There has also been talk about moving from subversion to git, but I’m not quite sure this is going to happen. Due to the nature of bundles, where each bundle has one or more main maintainers, but also super maintainers who maintain all over, Allan has mentioned that subversion is doing this pretty good already, while git might be difficult here. Nothing is written in stone here either, but it is on the agenda.
textmate
ph^: allan: Now that Duke Nukem forever has released a new gameplay-video … :p
Anyway. Being a regular on the irc channel and mailing list for some time now, I’ve gained quite much information on what’s in development and even bits and pieces of what TM2 will offer.
Update: TextMate 2 should be in private alpha in a month’s time, and public beta in maybe six months. Read more here.
Update: More TM2 speculation here
DISCLAIMER: None of this is officially released, supported or confirmed by Allan/macromates.com. Some or all of this may never be part of the TextMate distribution at all. It will however be cool if it is!
Dialog2:
Dialog2 is the successor of Dialog, which intent was to allow bundles to use dialogs to request strings, show choices etc. With Dialog2, Ciaran Walsh is bringing the Dialog to the next level by amongst other code changes is introducing a set of new window helpers. It’s also written in a way that makes it a lot easier to extend and add more features later. There already is a ruby wrapper in place(Support/lib/ui.rb) which makes it very easy to take advantage of the new Dialog.
Prettier tool-tips
By using HTMLTips helper from Dialog2 you get easy access to creating custom tool tips in HTML and CSS. The result, here showed with “Documentation for Word” from the PHP Bundle: Ciaran\'s: HTML Tool Tips
Code completion
The new Dialog can also be used for code completion. Some footage shows how Dialog2 suggests functions as you type, and inserts the function as a snippet where you can tab to the next parameter. With the new aforementioned ruby wrapper for the new Dialog it should be a walk in the park for the bundle developers to add this. (I managed!)
Intelligent code completion / Intellisense
One of the biggest griefs in the community with TextMate has been the lack of intelligent code completion, often referred to as intellisense. Currently you can use ⎋ (esc) to toggle thru your previously written words and a predefined set of words defined by the bundle author, but it offers no way to see what parameters the functions and methods expects. There have been attempts by some bundle authors, but now there’s work in progress for making that easier too. Currently it requires the bundle author to write a lexer. Some example footage can be seen here(PHP), 2, 3 and here(Ruby).
Better handling of command line input (or lack thereof)
Another big problem in TM has been with shell commands that might need input. The first example that comes to mind is the subversion bundle. There is no way for the bundle to know whether you’re setup with ssh keys, ssh agent, or have to type your password every time you commit. Hence if subversion is asking for a password on STDIN while the command is executing, it will fail or even stall TextMate. Luke “alkemist” Daley set out to sort this, and with some help from allan he came up with tm_interactive_input. This basically injects into the read function in OS X and with some black magic kung fu figures out if the read process belongs to TM. If so, it will open up a dialog requesting the input.
Pretty bundles
Thomas “subtleGradient” Aylott is working on what he refers to as:
a rough framework for making gui applications built inside textmate command windows
and it looks like this: Persistent asynchronous script runner
It allows a bundle developer to create a GUI using HTML/CSS & Javascript. And the buttons in the GUI can run shell scripts and pass data to them interactively. With the possibly coming terminal stuff in TM2 it should also gain the ability to run any TextMate bundle commands, macros & snippets. .
TextMate 2
There isn’t a whole lot to say about TM2 yet, other than it’s coming. Allan has said several times that he does most of the TM2 development in TM2, so it’s there and it’s mostly working, it’s just not for the rest of us to see and use yet.
One feature that might make it into TM2 is the ability for bundles to get a copy of the current text buffer, which will allow a bundle to do some heavy scanning in the buffer, without affecting the responsiveness of TM. This is great news for auto-completion and other commands which needs to scan the whole document.
Another often requested feature is for bundles to have better access to TextMate’s scoping system. This could replace the need for a lexer for things like intellisense, and thus lower the bar for implementing such. If this makes it into TM2 only Allan knows, but I really do hope so.
I don’t really know what people expect from TM2, but your expectations should most likely be pointed towards bundles, not TextMate itself. TM2 is afaik a complete rewrite of TM, with a lot of new “invisble” features for the bundles to take advantage of, not the users directly. TextMate’s strength has never been the editor on its own, but the extensibility it supports, and thus bundles.
Other interesting things
* Yehuda Katz, with help from others on github.com has released a ruby gem that allows you to install, uninstall and list TextMate bundles like normal ruby gems. This makes it very easy for those out there who aren’t friends with subversion. You can read more about it here.
* There has been a lot discussion on how to best maintain bundles in a central repository. There has been many requests for a issue tracking system for the bundles, and I recall that both Jira and Lighthouse have been in the spotlight, but I think eventually Redmine pulled the longest straw due to its free and open nature, and that Allan can host it on macromates.com. But either way, nothing is written in stone, and there has been no final decision.
* There has also been talk about moving from subversion to git, but I’m not quite sure this is going to happen. Due to the nature of bundles, where each bundle has one or more main maintainers, but also super maintainers who maintain all over, Allan has mentioned that subversion is doing this pretty good already, while git might be difficult here. Nothing is written in stone here either, but it is on the agenda.
october 2010 by michaelfox
plasticular inscriptor » TextMate – Continue Block Comment
october 2010 by michaelfox
The current release of TextMate seems to be missing the capability to allow for the auto continuation of block comments when editing actionscript files. To fix this, you can add a new snippet to the actionscript bundle in the bundle editor.
1. In TM, go to the menu Bundles/Bundle Editor and choose Edit Snippets…
2. Open the ActionScript section on the left, and click the “+” button at the bottom left and choose to add a new snippet.
3. Name the new snippet, such as “Continue Block Comment”.
4. In the text area where is says Syntax Summary, delete the contents, and paste in the following:
${TM_CURRENT_LINE/(.*\*\/$)|.*?(\/\*(?!.*\*\/)).*|.*/(?1:
:
(?2: )* )/}
5. Now click the Activation menu below (says “Tab Trigger”) and change it to Key Equivalent. Click the field next to it, and hit the key (or the key if you prefer). The return key symbol should show up.
6. In the scope selector field, type
source.actionscript comment.block
– this will set the snippet to just work inside actionscript block comments bounded by “/** */”
You can now close the bundle editor, and while typing in block comments in actionscript files, the return key should drop you to the next line, preserve the indent, and type in an asterisk followed by a space.
textmate
1. In TM, go to the menu Bundles/Bundle Editor and choose Edit Snippets…
2. Open the ActionScript section on the left, and click the “+” button at the bottom left and choose to add a new snippet.
3. Name the new snippet, such as “Continue Block Comment”.
4. In the text area where is says Syntax Summary, delete the contents, and paste in the following:
${TM_CURRENT_LINE/(.*\*\/$)|.*?(\/\*(?!.*\*\/)).*|.*/(?1:
:
(?2: )* )/}
5. Now click the Activation menu below (says “Tab Trigger”) and change it to Key Equivalent. Click the field next to it, and hit the key (or the key if you prefer). The return key symbol should show up.
6. In the scope selector field, type
source.actionscript comment.block
– this will set the snippet to just work inside actionscript block comments bounded by “/** */”
You can now close the bundle editor, and while typing in block comments in actionscript files, the return key should drop you to the next line, preserve the indent, and type in an asterisk followed by a space.
october 2010 by michaelfox
related tags
*todo ⊕ abbr ⊕ ack ⊕ addons ⊕ app ⊕ apple ⊕ applescript ⊕ asciidoc ⊕ audio ⊕ automation ⊕ bash ⊕ bbedit ⊕ beginner ⊕ beutifier ⊕ bindings ⊕ blog ⊕ blogging ⊕ browse ⊕ browser ⊕ bundle ⊕ bundles ⊕ buttons ⊕ byword ⊕ cheat ⊕ cheatsheet ⊕ chiptunes ⊕ cli ⊕ click ⊕ cocoa ⊕ coda ⊕ code ⊕ codecompletion ⊕ codeigniter ⊕ codequality ⊕ colors ⊕ command ⊕ commandline ⊕ config ⊕ console ⊕ css ⊕ css3 ⊕ ctags ⊕ customization ⊕ default ⊕ definition ⊕ development ⊕ dictionary ⊕ documentation ⊕ dotfiles ⊕ downloads ⊕ editing ⊕ editor ⊕ environment ⊕ events ⊕ example ⊕ extendedattributes ⊕ extension ⊕ finder ⊕ folding ⊕ fonts ⊕ function ⊕ gamedev ⊕ gist ⊕ gist-460360 ⊕ git ⊕ github ⊕ github-repo ⊕ grammar ⊕ greasemonkey ⊕ gtm ⊕ hack ⊕ hacks ⊕ help ⊕ highlighting ⊕ hinting ⊕ hotkeys ⊕ howto ⊕ html ⊕ icons ⊕ ide ⊕ information ⊕ input ⊕ inspiration ⊕ ios ⊕ iphone ⊕ javascript ⊕ jshint ⊕ jslint ⊕ json ⊕ key ⊕ keybindings ⊕ keyboard ⊕ keymando ⊕ language ⊕ latex ⊕ less ⊕ list ⊕ mac ⊕ macosx ⊕ macros ⊕ mamp ⊕ man ⊕ manual ⊕ markdown ⊕ marked ⊕ markup ⊕ merlinmann ⊕ metadata ⊕ midi ⊕ mml ⊕ mouse ⊕ multiline ⊕ music ⊕ nes ⊕ netbeans ⊕ network ⊕ organization ⊕ osx ⊕ path ⊕ php ⊕ plugin ⊕ plugins ⊕ podcasts ⊕ preferences ⊕ preview ⊕ productivity ⊕ programming ⊕ project ⊕ projectplus ⊕ protocols ⊕ prototype ⊕ pygments ⊕ python ⊕ quicklook ⊕ reference ⊕ regex ⊕ repo ⊕ resources ⊕ ronn ⊕ rsync ⊕ ruby ⊕ scriptaculous ⊕ scripting ⊕ scripts ⊕ sdk ⊕ search ⊕ services ⊕ setup ⊕ shell ⊕ shortcut ⊕ shortcuts ⊕ snippet ⊕ snippets ⊕ snow ⊕ software ⊕ source ⊕ src ⊕ stackoverflow ⊕ sublime ⊕ submodules ⊕ subversion ⊕ support ⊕ svn ⊕ symbols ⊕ syntax ⊕ syntaxhighlighting ⊕ system ⊕ tags ⊕ template ⊕ terminal ⊕ testing ⊕ text ⊕ textmate ⊖ textmate.bundles ⊕ theme ⊕ themes ⊕ tips ⊕ tmbundle ⊕ toolbar ⊕ tools ⊕ transmit ⊕ tutorial ⊕ twilight ⊕ unix ⊕ urls ⊕ user ⊕ userscripts ⊕ vim ⊕ wallpaper ⊕ webdev ⊕ workflow ⊕ writing ⊕ xcode ⊕ ★ ⊕Copy this bookmark: