<?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>Doug McInnes &#187; Vim</title>
	<atom:link href="http://dougmcinnes.com/category/vim/feed/" rel="self" type="application/rss+xml" />
	<link>http://dougmcinnes.com</link>
	<description>Chuckle and Chortle</description>
	<lastBuildDate>Wed, 24 Aug 2011 05:51:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Ruby Vim Fu</title>
		<link>http://dougmcinnes.com/2010/04/11/ruby-vim-fu/</link>
		<comments>http://dougmcinnes.com/2010/04/11/ruby-vim-fu/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 06:18:19 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[LA Ruby]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://dougmcinnes.com/?p=81</guid>
		<description><![CDATA[This last Thursday Alf and I gave a talk at LA Ruby on Vim, in particular how we use Vim to edit Ruby code.  Giles asked us to present on Vim months ago and we finally got around to doing &#8230; <a href="http://dougmcinnes.com/2010/04/11/ruby-vim-fu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This last Thursday <a href="http://alfmikula.blogspot.com/">Alf</a> and I gave a talk at <a href="http://www.laruby.com/">LA Ruby</a> on <a href="http://www.vim.org/">Vim</a>, in particular how we use Vim to edit Ruby code.  <a href="http://gilesbowkett.blogspot.com/">Giles</a> asked us to present on Vim months ago and we finally got around to doing it.</p>
<p>I think it went well considering we probably spent more time figuring out the background color scheme on our slides than preparing what we were going to say.  I wasn&#8217;t worried, I&#8217;ve been using Vim for 15 years now so it was my favorite kind of speech: one where I felt completely at ease with the subject matter.</p>
<p>In any case here are the slides in a <a href="http://amikula.github.com/vim_fu/">viewable form</a> on Github, as well as the <a href="http://github.com/amikula/vim_fu">source</a>.  We used the <a href="http://slideshow.rubyforge.org/">Slideshow gem</a> to set them up.</p>
<p>The slides probably will not be of any particular use to you since they&#8217;re rather sparse.  We however added a bunch of links on the end to blogs/screencasts/cool sites we like as well as all of the plugins we mentioned during the talk.</p>
<p>So you don&#8217;t have to hunt through the slides here are those links in all their glory:</p>
<h1>Links</h1>
<p><a href="http://www.vim.org/">http://www.vim.org/</a></p>
<p><strong>MacVim</strong> – <a href="http://code.google.com/p/macvim/">http://code.google.com/p/macvim/</a></p>
<p><a href="http://vim.wikia.com/wiki/Best_Vim_Tips">http://vim.wikia.com/wiki/Best_Vim_Tips</a></p>
<p><strong>Cheat Sheet!</strong> –  <a href="http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html">http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html</a></p>
<p><a href="http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html"></a><a href="http://items.sjbach.com/319/configuring-vim-right">http://items.sjbach.com/319/configuring-vim-right</a></p>
<p><strong>Screencasts on Vim</strong> – <a href="http://vimcasts.org/">http://vimcasts.org/</a></p>
<p><strong>Vim Tip a Day on Twitter</strong> – <a href="http://twitter.com/vimtips">http://twitter.com/vimtips</a></p>
<p><a href="http://durdn.com/blog/2008/11/26/vim-mind-share-soaring-roundup-of-10-vim-articles-recent-and-older-gems/">http://durdn.com/blog/2008/11/26/vim-mind-share-soaring-roundup-of-10-vim-articles-recent-and-older-gems/</a></p>
<p><a href="http://durdn.com/blog/2008/11/26/vim-mind-share-soaring-roundup-of-10-vim-articles-recent-and-older-gems/"></a><strong>Vim Recipies</strong> – <a href="http://vim.runpaint.org/toc/">http://vim.runpaint.org/toc/</a></p>
<p><a href="http://biodegradablegeek.com/2007/12/using-vim-as-a-complete-ruby-on-rails-ide/">http://biodegradablegeek.com/2007/12/using-vim-as-a-complete-ruby-on-rails-ide/</a></p>
<h1>Plugins</h1>
<p><strong>The Rails Plugin</strong> – <a href="http://rails.vim.tpope.net/">http://rails.vim.tpope.net/</a></p>
<p><strong>NERD Tree</strong> – <a href="http://www.vim.org/scripts/script.php?script_id=1658">http://www.vim.org/scripts/script.php?script_id=1658</a></p>
<p><strong>Command-T</strong> – <a href="http://www.vim.org/scripts/script.php?script_id=3025">http://www.vim.org/scripts/script.php?script_id=3025</a></p>
<p><strong>BufExplorer</strong> – <a href="http://www.vim.org/scripts/script.php?script_id=42">http://www.vim.org/scripts/script.php?script_id=42</a></p>
<p><strong>AutoTag</strong> – <a href="http://www.vim.org/scripts/script.php?script_id=1343">http://www.vim.org/scripts/script.php?script_id=1343</a></p>
<p><a href="http://www.vim.org/scripts/script.php?script_id=1343"></a><strong>Vimball</strong> – <a href="http://www.vim.org/scripts/script.php?script_id=1502">http://www.vim.org/scripts/script.php?script_id=1502</a></p>
<p><strong>NERDCommenter</strong> – <a href="http://www.vim.org/scripts/script.php?script_id=1218">http://www.vim.org/scripts/script.php?script_id=1218</a></p>
<p><strong>NERDSnippets</strong> – <a href="http://github.com/scrooloose/nerdsnippets">http://github.com/scrooloose/nerdsnippets</a></p>
<p><strong>Align</strong> – <a href="http://www.vim.org/scripts/script.php?script_id=294">http://www.vim.org/scripts/script.php?script_id=294</a></p>
<p><strong>RubySingleTest</strong> – <a href="http://www.vim.org/scripts/script.php?script_id=2869">http://www.vim.org/scripts/script.php?script_id=2869</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dougmcinnes.com/2010/04/11/ruby-vim-fu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Single Test</title>
		<link>http://dougmcinnes.com/2009/02/16/ruby-single-test/</link>
		<comments>http://dougmcinnes.com/2009/02/16/ruby-single-test/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 15:59:11 +0000</pubDate>
		<dc:creator>Doug</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Vim]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://dougmcinnes.com/?p=73</guid>
		<description><![CDATA[I, like many developers, do my best to follow the practice of Test Driven Development (TDD). In practical terms this means you write a test to test your code before you write the code itself. This approach forces your mindset &#8230; <a href="http://dougmcinnes.com/2009/02/16/ruby-single-test/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I, like many developers, do my best to follow the practice of <a href="http://en.wikipedia.org/wiki/Test-driven_development">Test Driven Development</a> (TDD).  In practical terms this means you write a test to test your code before you write the code itself.  This approach forces your mindset into having a clearer sense of how the code will be used since you&#8217;re writing code to use the code first.  Got it?   Increased test coverage also means more robust and maintainable code.</p>
<p>My first formal introduction to TDD was a <a href="http://pragmaticstudio.com/testing-rails/">three-day TDD workshop</a> put on by <a href="http://onestepback.org/">Jim Weirich</a> and <a href="http://objo.com/">Joe O&#8217;Brien</a> while I was at the Los Angeles Times.  Jim, an expert EMACS user, had his system setup to run tests quickly from within the editor, even showing a red or green notice indicating the pass/fail status of the test.</p>
<p>This may not seem like a big deal to people using any number of IDEs but personally, I&#8217;m a <a href="http://www.vim.org/">Vim</a> user (specifically <a href="http://code.google.com/p/macvim/">MacVim</a>, it&#8217;s an extremely well done port of Vim using Cocoa).  I love it.  I&#8217;m way faster editing inside of Vim; my brain has mapped around all of the commands because I&#8217;ve been editing with it for so long.  I&#8217;ve been using vi variants in one form or another since my Freshman year of college when my Computer Science 101 professor forced us all to code with it for our programming projects on the school&#8217;s Sun server.  While doing Java work two or so years ago, I developed mostly on Eclipse and eventually broke down and purchased a license for the Eclipse vi keybinding plugin.  Now that I&#8217;m employed for Ruby work I&#8217;ve switched back to Vim full-time (after a 1/2 hour dabbling with Textmate).</p>
<p>Jim&#8217;s EMACS setup made me jealous.  During the class I figured out how to set the make program to use ruby (or spec for rspec tests) and <a href="http://www.vim.org/htmldoc/quickfix.html">Quickfix</a> will run the tests for the file.  Here&#8217;s the command:</p>
<blockquote><p>:set makeprg=ruby\ %</p></blockquote>
<p>The <strong>\</strong> escapes the space and the <strong>%</strong> gets expanded to the current buffer&#8217;s filename when Quickfix is activated.  Quickfix was originally used for a &#8220;quick&#8221; way of compiling your program to see if there&#8217;s any errors.  Vim will even move your cursor to the file and line number of the first error if there are any.  This works for ruby tests too!  Another Vim setting, <strong>errorformat</strong>, is how Vim parses errors from running <strong>makeprg</strong>.</p>
<p>OK, so this is all great, but what if my test file is huge?  What if it takes 10+ seconds to run?  What if I&#8217;m only interested in a single test because I&#8217;m being a good developer and practicing TDD?</p>
<p>This is where the <a href="http://github.com/dmcinnes/ruby_single_test/tree/master">Ruby Single Test plugin</a> comes in.  The plugin is an extraction of some functions I&#8217;ve been playing with in my .vimrc file for the past couple of weeks.  All it does is provide a command for running the test block your cursor is hovering over in your test file (<strong>&lt;leader&gt;.</strong> by default.  <strong>&lt;leader&gt;</strong> is usually comma or backslash).  Most of the time you&#8217;re only interested in a single test while you&#8217;re editing code so turn-around time is vastly improved.  No more jumping back to the console to run a test.</p>
<p>To install just drop the <a href="http://github.com/dmcinnes/ruby_single_test/tree/master">ruby_single_test.vim</a> file in your <strong>.vim/plugin</strong> directory.</p>
<p>Currently it works for Test::Unit as well as Rspec tests.  I&#8217;ve been using this quite a bit recently and I think I&#8217;ve worked out most of the bugs.  My setup isn&#8217;t necessarily the same any everyone&#8217;s so please let me know if you have any problems with it!  The code is up on <a href="http://github.com">Github</a>, so feel free to play with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://dougmcinnes.com/2009/02/16/ruby-single-test/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

