<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Martin Ström &#187; productivity</title>
	<atom:link href="http://my-domain.se/tag/productivity/feed/" rel="self" type="application/rss+xml" />
	<link>http://my-domain.se</link>
	<description></description>
	<lastBuildDate>Wed, 11 Jan 2012 11:04:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>AutoPair functionality using Cocoa KeyBindings</title>
		<link>http://my-domain.se/autopair-functionality-using-cocoa-keybindings/</link>
		<comments>http://my-domain.se/autopair-functionality-using-cocoa-keybindings/#comments</comments>
		<pubDate>Tue, 11 Jul 2006 08:31:06 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://burnfield.com/martin/2006/07/11/autopair-functionality-using-cocoa-keybindings/</guid>
		<description><![CDATA[I&#8217;ve been using the application &#8220;AutoPairs&#8221; since it was mentioned on 43folders some time ago. Yesterday (via the Macromates TextMate blog) I found an article on the Cocoa Text System and realised I could recreate AutoPairs&#8217; functionality by just using native Cococa Keybindings found in OSX. Add these lines to your ~/Library/KeyBindings/DefaultKeyBinding.dict (create the file [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using the application <a href="http://www.jwwalker.com/pages/autopairs.html">&#8220;AutoPairs&#8221;</a> since it was <a href="http://www.43folders.com/2006/06/15/universal-binaries">mentioned</a> on <a href="http://43folders.com">43folders</a> some time ago. Yesterday (via <a href="http://macromates.com/blog/archives/2006/07/10/multi-stroke-key-bindings">the Macromates TextMate blog</a>) I found an <a href="http://hcs.harvard.edu/~jrus/Site/cocoa-text.html">article on the Cocoa Text System</a> and realised I could recreate AutoPairs&#8217; functionality by just using native Cococa Keybindings found in OSX.</p>

<p>Add these lines to your <code>~/Library/KeyBindings/DefaultKeyBinding.dict</code> (create the file if it isn&#8217;t already there) and the commands will be available in every application started afterwords.</p>

<pre><code>/* Recreate Auto pairs functionality */
"\\\"" = ( "insertText:", "\"\"", "moveBackward:" );
"("    = ( "insertText:", "()", "moveBackward:" );
"~("   = ( "insertText:", "{}", "moveBackward:" );
"~8"   = ( "insertText:", "[]", "moveBackward:" );
"&lt;"    = ( "insertText:", "&lt;&gt;", "moveBackward:" );
</code></pre>

<p>When you type e.g  ⇧2 for a double quote (as in swedish keyboard layout), it&#8217;ll automatically   insert the ending quote as well and place the cursor between them. This will also work for &#8220;([{&lt;&#8221;. Remember the shortcuts are for a swedish keymap so you might want to change that.</p>

<p>A real time saver when writing outside an editor without this functionality built-in (like TextMate).</p>

<div class="updated">
Update 2006-08-07
Simplfied the commands based on Jacob Rus&#8217; comment.
</div>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

