<?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>netCUBED Blog &#187; javascript</title>
	<atom:link href="http://blog.netcubed.de/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.netcubed.de</link>
	<description>Just another web developer's weblog</description>
	<lastBuildDate>Mon, 29 Jun 2009 20:58:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Format JavaScript in TextMate with JavaScript::Beautifier</title>
		<link>http://blog.netcubed.de/2009/06/format-javascript-in-textmate-with-javascriptbeautifier/</link>
		<comments>http://blog.netcubed.de/2009/06/format-javascript-in-textmate-with-javascriptbeautifier/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 17:08:53 +0000</pubDate>
		<dc:creator>Moritz Onken</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://blog.netcubed.de/?p=104</guid>
		<description><![CDATA[TextMate has a number of great bundles which help you develop in many many languages. The feature I miss most is formatting for JavaScript just like Perl Tidy does it for Perl.
I recently saw JavaScript::Beautifier in the &#8220;Recent&#8221; list on the CPAN and was wondering if I can bind it to TextMate. This is how [...]]]></description>
			<content:encoded><![CDATA[<p>TextMate has a number of great bundles which help you develop in many many languages. The feature I miss most is formatting for JavaScript just like Perl Tidy does it for Perl.</p>
<p>I recently saw <a href="http://search.cpan.org/perldoc?JavaScript::Beautifier">JavaScript::Beautifier</a> in the &#8220;Recent&#8221; list on the CPAN and was wondering if I can bind it to TextMate. This is how I did it:</p>
<p>First of all, install it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> cpan <span style="color: #660033;">-i</span> JavaScript::Beautifier</pre></div></div>

<p>Next, add the command to TextMate. Open the Bundle Editor (Bundles/Bundle Editor/Show Bundle Editor).</p>
<p style="text-align: center;"><img class="size-full wp-image-106   aligncenter" title="bild-1" src="http://blog.netcubed.de/wp-content/uploads/2009/06/bild-1.png" alt="bild-1" width="267" height="161" /></p>
<p style="text-align: left; clear:both">Then select JavaScript and click on &#8220;New Command&#8221; (bottom left).<img class="size-medium wp-image-107   aligncenter" title="bild-2" src="http://blog.netcubed.de/wp-content/uploads/2009/06/bild-2-300x220.png" alt="bild-2" width="300" height="220" /></p>
<p style="text-align: left; clear:both">Name it &#8220;Beautifier&#8221; (or whatever you want) and paste the following in the command text field:</p>
<pre>require_cmd js_beautify.pl 'sudo cpan -i JavaScript::Beautifier'

js_beautify.pl $TM_FILEPATH</pre>
<p>Set the rest of the options like this:</p>
<pre style="text-align: center;"><img class="size-full wp-image-108" title="bild-3" src="http://blog.netcubed.de/wp-content/uploads/2009/06/bild-3.png" alt="bild-3" width="457" height="466" /></pre>
<p>Now you are ready to go! Open up a JavaScript document and hit Shift+Crtl+H and the current document should be formatted.</p>
<p style="text-align: center;"><img class="size-full wp-image-105   aligncenter" title="bild-9" src="http://blog.netcubed.de/wp-content/uploads/2009/06/bild-9.png" alt="bild-9" width="234" height="134" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.netcubed.de/2009/06/format-javascript-in-textmate-with-javascriptbeautifier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
