<?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>ptone &#187; tip</title>
	<atom:link href="http://ptone.com/dablog/tag/tip/feed/" rel="self" type="application/rss+xml" />
	<link>http://ptone.com/dablog</link>
	<description>Hodgepodge of thoughts, technical notes, and random observations</description>
	<lastBuildDate>Mon, 10 May 2010 18:27:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Editing long commands</title>
		<link>http://ptone.com/dablog/2009/08/editing-long-commands/</link>
		<comments>http://ptone.com/dablog/2009/08/editing-long-commands/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 21:39:52 +0000</pubDate>
		<dc:creator>ptone</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://ptone.com/dablog/2009/08/editing-long-commands/</guid>
		<description><![CDATA[Sometimes you get in a situation where you are editing a long command on the command line and you&#8217;d kill to be able to use your mouse to select a word or option in the middle.  This tip makes it a pleasure



First for me their was the discovery of cntl-a which jumps one back [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you get in a situation where you are editing a long command on the command line and you&#8217;d kill to be able to use your mouse to select a word or option in the middle.  This tip makes it a pleasure</p>

<p><span id="more-81"></span></p>

<p>First for me their was the discovery of cntl-a which jumps one back to the beginning of a line, but just as often I wanted to delete a long path as an opt to a long command.</p>

<p>The first thing is to set your default Editor in your environment variables.  I use TextMate &#8211; but you could use textwrangler, VI, Emacs.</p>

<p>add a line like this to your ~/.bash_profile</p>

<p>export EDITOR=&#8221;mate -w&#8221;</p>

<p>then close your terminal session or &#8220;source ~/.bash_profile&#8221;</p>

<p>Now when you are in the middle of typing a long command, or after hitting the up arrow, press cntl-x and hold it, then hit &#8220;e&#8221;</p>

<p>boom &#8211; your current command opens up in your editor, you can use all the features of that editor, and when you save and close that file &#8211; the command will be executed back in your shell.</p>

<p>Since I&#8217;ve integrated this tip into my workflow &#8211; I find I use it all the time.</p>

<p>Only downside is GUI editors won&#8217;t work for SSH since you are in the remote hosts env &#8211; there is probably a tricky way to reverse-ssh the editor command back to you, but I haven&#8217;t explored that.</p>
]]></content:encoded>
			<wfw:commentRss>http://ptone.com/dablog/2009/08/editing-long-commands/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
