<?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>froztbyte.getBlog() &#187; zsh</title>
	<atom:link href="http://blog.froztbyte.net/tag/zsh/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.froztbyte.net</link>
	<description>returns the contents of froztbyte.blog</description>
	<lastBuildDate>Fri, 03 Apr 2020 21:58:55 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
	<item>
		<title>Terminal-based Quicksearch</title>
		<link>http://blog.froztbyte.net/2011/10/terminal-quicksearch/</link>
		<comments>http://blog.froztbyte.net/2011/10/terminal-quicksearch/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 11:22:11 +0000</pubDate>
		<dc:creator><![CDATA[froztbyte]]></dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[convenience]]></category>
		<category><![CDATA[nifty]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://blog.froztbyte.net/?p=81</guid>
		<description><![CDATA[The title of this post might be a bit misleading, since it&#8217;s not about the history-search feature you often find in shells such as zsh, which is the shell I use. Incidentally, if you don&#8217;t know about this feature, try it &#8230;<p class="read-more"><a href="http://blog.froztbyte.net/2011/10/terminal-quicksearch/">Read more &#187;</a></p>]]></description>
				<content:encoded><![CDATA[<p>The title of this post might be a bit misleading, since it&#8217;s not about the history-search feature you often find in shells such as zsh, which is the shell I use. Incidentally, if you don&#8217;t know about this feature, try it out! See below:</p>
<p>Press ctrl+r and start typing out a partial command that you&#8217;ve used previously, you should see it pop up on your commandline, ready for use. In zsh, this is the history-incremental-search-backward feature on the line editor, which you can see more of over on <a href="http://www.cs.elte.hu/zsh-manual/zsh_14.html">this page</a>.</p>
<p>But as mentioned, this post is about something else. Some time ago I saw <a href="http://vhata.net/">Jonathan Hitchcock</a> mention use of the <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/open.1.html">open(1)</a> command on OSX and thought this was pretty nifty, leading to me looking around for the equivalent on Linux. I came across &#8216;xdg-open&#8217;, which works with the freedesktop standards and thus generally respects your desktop-environment-of-choice&#8217;s application preferences. After using it a bit, I decided it was unwieldy (since there were too many commands starting with &#8216;xdg-&#8216;), and aliased it to &#8216;xopen&#8217;, which has the benefit of being both short and easily tab-completable.</p>
<p>This has been working pretty well for me since then, and only recently did I come up with a slightly improved use of it. Every now and then I want to quickly check up something online, and I could certainly use lynx/elinks for this, but they&#8217;re also a bit painful to navigate with on many sites, so they&#8217;re not exactly ideal candidates. To the rescue comes my handy xopen alias!</p>
<pre>function googsearch() {
  xopen "http://www.google.com/search?q=$*"
}

function googsearchphrase() {
  xopen "http://www.google.com/search?q=\"$*\""
}</pre>
<p>Those are the functions I created, and they expand quite easily on my shell, suiting me on both laziness and versatility/speed. The end effect is they quickly fire off a query to google in my preferred browser, which can be one alt-tab away or focus by default (depending on your DE config). Later I *might* investigate using another search engine, but my typical use is on Google.</p>
<p>The only downside I can see to this is I can still only make it work on a local shell at this stage, so I&#8217;d have to see how I can make it work through ssh tunnels or somesuch. Maybe some sort of hack emulating a socket-forward as agent forwarding is done? If anyone has any ideas, please post them in the comments, I&#8217;d be glad to hear about it.</p>
<p>Update: just for clarity, what I meant with the last paragraph is that I&#8217;d want to call this command (or something to the same effect) on a remote server, and have the query executed on my local machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.froztbyte.net/2011/10/terminal-quicksearch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
