<?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>Rusty Razor Blade &#187; vim</title>
	<atom:link href="http://www.rustyrazorblade.com/category/vim/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rustyrazorblade.com</link>
	<description>Tech Thoughts, Mostly on LAMP - by Jon Haddad</description>
	<lastBuildDate>Fri, 13 Aug 2010 23:33:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Executing MySQL queries within VIM</title>
		<link>http://www.rustyrazorblade.com/2008/08/executing-mysql-queries-within-vim/</link>
		<comments>http://www.rustyrazorblade.com/2008/08/executing-mysql-queries-within-vim/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 19:51:11 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=139</guid>
		<description><![CDATA[I haven&#8217;t been using vim for very long, but I&#8217;ve gotten over the initial learning curve of getting used to the different editing modes.  With some help from the guys in #vim on irc.freenode.net, I managed to get this gem:
 map &#60;C-d&#62; :call SwitchDB()&#60;CR&#62;
 :function SwitchDB()
 :   let g:current_db = input("Database &#62; [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t been using vim for very long, but I&#8217;ve gotten over the initial learning curve of getting used to the different editing modes.  With some help from the guys in #vim on irc.freenode.net, I managed to get this gem:</p>
<blockquote><p><code> map &lt;C-d&gt; :call SwitchDB()&lt;CR&gt;<br />
 :function SwitchDB()<br />
 :   let g:current_db = input("Database &gt; ")<br />
 :endfunction</p>
<p> map &lt;C-m&gt; :call Doquery()&lt;CR&gt;<br />
 :function Doquery()<br />
 :   if !exists("g:current_db")<br />
 :       call SwitchDB()<br />
 :   endif<br />
 :   let query_string = input(g:current_db . " &gt; " )<br />
 :   if query_string != ""<br />
 :       exe "!mysql " . g:current_db . "  -e \"" .  escape(query_string, '"') . "\""<br />
 :   endif<br />
 :endfunction<br />
 </code></p></blockquote>
<p>Control-m to execute a query.  Control-d to switch databases.  It&#8217;ll prompt you the first time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2008/08/executing-mysql-queries-within-vim/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
