<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Dynamic and Concise &#187; vim</title>
	<atom:link href="http://yiwenandsoftware.wordpress.com/tag/vim/feed/" rel="self" type="application/rss+xml" />
	<link>http://yiwenandsoftware.wordpress.com</link>
	<description>Everything about my experience with Software Development</description>
	<lastBuildDate>Sat, 14 Mar 2009 22:05:25 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='yiwenandsoftware.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/fa9ad49ca1c5d02890788e46a95fe979?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Dynamic and Concise &#187; vim</title>
		<link>http://yiwenandsoftware.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://yiwenandsoftware.wordpress.com/osd.xml" title="Dynamic and Concise" />
		<item>
		<title>A Snippet for declaring ruby class in vim</title>
		<link>http://yiwenandsoftware.wordpress.com/2009/03/13/snippet-for-defining-ruby-class-in-vim/</link>
		<comments>http://yiwenandsoftware.wordpress.com/2009/03/13/snippet-for-defining-ruby-class-in-vim/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 15:43:26 +0000</pubDate>
		<dc:creator>Yi Wen</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://yiwenandsoftware.wordpress.com/?p=94</guid>
		<description><![CDATA[I create a new file with vim, I want to define a class within it. In Ruby world, a lot of time I want to name my class as file_name.classify. So it will be nice to let vim generates this automatically for me.
I open up ruby.vim in ftplugin, a lot of snippets has already been [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yiwenandsoftware.wordpress.com&blog=2109631&post=94&subd=yiwenandsoftware&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I create a new file with vim, I want to define a class within it. In Ruby world, a lot of time I want to name my class as file_name.classify. So it will be nice to let vim generates this automatically for me.</p>
<p>I open up ruby.vim in ftplugin, a lot of snippets has already been defined there. Now I just need to add one more:</p>
<p><code><br />
Snippet cla class &#96;&#96;ClassName()&#96;&#96;&lt;CR&gt;&lt;{}&gt;&lt;CR&gt;end<br />
</code></p>
<p>What this does is when you enter &#8220;cla&#8221; and press &lt;Tab&gt; key (or whatever key you define for snippet expansion), it will call ClassName method and write down return value along with remaining string. Nothing fancy here.</p>
<p>Now let&#8217;s look at the most interesting part of this post: function ClassName()</p>
<pre>
function! ClassName()
  return substitute(expand("%:t:r"), '\(\%^\|_\)\(.\)', '\U\2', "g")
endfunction
</pre>
<p>Basically what this function does is to convert underscored_word into UnderscoredWord. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yiwenandsoftware.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yiwenandsoftware.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yiwenandsoftware.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yiwenandsoftware.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yiwenandsoftware.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yiwenandsoftware.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yiwenandsoftware.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yiwenandsoftware.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yiwenandsoftware.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yiwenandsoftware.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yiwenandsoftware.wordpress.com&blog=2109631&post=94&subd=yiwenandsoftware&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://yiwenandsoftware.wordpress.com/2009/03/13/snippet-for-defining-ruby-class-in-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f711c24e96cbc441b0c94141f22f2d23?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hayafirst</media:title>
		</media:content>
	</item>
		<item>
		<title>Run Rspec within vim and seeing result in your Firefox2</title>
		<link>http://yiwenandsoftware.wordpress.com/2009/03/11/run-rspec-within-vim-and-seeing-result-in-your-firefox2/</link>
		<comments>http://yiwenandsoftware.wordpress.com/2009/03/11/run-rspec-within-vim-and-seeing-result-in-your-firefox2/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 19:05:19 +0000</pubDate>
		<dc:creator>Yi Wen</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[RSpec]]></category>

		<guid isPermaLink="false">http://yiwenandsoftware.wordpress.com/?p=75</guid>
		<description><![CDATA[Thanks to cassiomarques, we can run rspec from within vim and see the results in FF.
You might be surprised though, when you run it and wait and wait, and nothing seems happening. Mostly likely it just that the running code raise an exception and no output to either FF or you vim. If you look [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yiwenandsoftware.wordpress.com&blog=2109631&post=75&subd=yiwenandsoftware&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Thanks to <a href="http://cassiomarques.wordpress.com/2009/01/09/running-rspec-files-from-vim-showing-the-results-in-firefox/">cassiomarques</a>, we can run rspec from within vim and see the results in FF.</p>
<p>You might be surprised though, when you run it and wait and wait, and nothing seems happening. Mostly likely it just that the running code raise an exception and no output to either FF or you vim. If you look at the terminal window where you started you vim, you will see the backtrace though. So why not display the backtrace in FF then, just like the image below?</p>
<div id="attachment_76" class="wp-caption alignnone" style="width: 507px"><img src="http://yiwenandsoftware.files.wordpress.com/2009/03/picture-1.png?w=497&#038;h=366" alt="A failure message window" title="A failure message window" width="497" height="366" class="size-full wp-image-76" /><p class="wp-caption-text">A failure message window</p></div>
<p>Here is the part of the script modified from his original one:</p>
<pre class="brush: ruby;">
begin
  ::Spec::Runner::CommandLine.run(::Spec::Runner::OptionParser.parse(argv, STDERR, STDOUT))
rescue Exception =&gt; e
  File.open(&quot;#{report_file}&quot;, &quot;w&quot;) do |file|
    file.write(&quot;#{e.message} &lt;br /&gt;&quot;)
    file.write e.backtrace.join(&quot;&lt;br /&gt;&quot;)
  end
end
</pre>
<p>Another thing worth to mention is that handling vim type of links doesn&#8217;t work with his approach in either FF3 and FF2. I had to install a plugin called <a href="http://mozex.mozdev.org/installation.html">Mozex</a>. My experience is that it only works for FF2. Once you install it and restart your FF2, go to Add-Ons and click on &#8220;Preference&#8221; of this plugin. goto &#8220;Universal&#8221; tab. type &#8220;vim&#8221; into the first textbox and /path/to/open_vim to the second one just like the image shown below:<br />
<div id="attachment_84" class="wp-caption alignnone" style="width: 507px"><img src="http://yiwenandsoftware.files.wordpress.com/2009/03/picture-2.png?w=497&#038;h=195" alt="Mozex plugin setup" title="Mozex plugin setup" width="497" height="195" class="size-full wp-image-84" /><p class="wp-caption-text">Mozex plugin setup</p></div></p>
<p>Speaking of open_vim, since Mozex pass the whole URL (vim://Users/blah/blah.rb?line_number) back, so the regex for parsing it should be changed to:</p>
<pre>
 /vim:\/\/(.+)\?(\d+)/
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yiwenandsoftware.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yiwenandsoftware.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yiwenandsoftware.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yiwenandsoftware.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yiwenandsoftware.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yiwenandsoftware.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yiwenandsoftware.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yiwenandsoftware.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yiwenandsoftware.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yiwenandsoftware.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yiwenandsoftware.wordpress.com&blog=2109631&post=75&subd=yiwenandsoftware&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://yiwenandsoftware.wordpress.com/2009/03/11/run-rspec-within-vim-and-seeing-result-in-your-firefox2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f711c24e96cbc441b0c94141f22f2d23?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hayafirst</media:title>
		</media:content>

		<media:content url="http://yiwenandsoftware.files.wordpress.com/2009/03/picture-1.png" medium="image">
			<media:title type="html">A failure message window</media:title>
		</media:content>

		<media:content url="http://yiwenandsoftware.files.wordpress.com/2009/03/picture-2.png" medium="image">
			<media:title type="html">Mozex plugin setup</media:title>
		</media:content>
	</item>
		<item>
		<title>GVIM for RoR</title>
		<link>http://yiwenandsoftware.wordpress.com/2007/02/04/gvim-for-ror/</link>
		<comments>http://yiwenandsoftware.wordpress.com/2007/02/04/gvim-for-ror/#comments</comments>
		<pubDate>Sun, 04 Feb 2007 00:41:00 +0000</pubDate>
		<dc:creator>Yi Wen</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://yiwenandsoftware.wordpress.com/2007/02/04/gvim-for-ror/</guid>
		<description><![CDATA[I used TextMate at work. It&#8217;s as good as you can get, but it&#8217;s only for Mac OS which I don&#8217;t have at home. Today I tried rails.vim for gvim on my newly installed Ubuntu. Again, it proves that vim is a forever favorite. Mastering all key bindings with the rails script may take time, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yiwenandsoftware.wordpress.com&blog=2109631&post=4&subd=yiwenandsoftware&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I used TextMate at work. It&#8217;s as good as you can get, but it&#8217;s only for Mac OS which I don&#8217;t have at home. Today I tried <a href="http://www.vim.org/scripts/script.php?script_id=1567">rails.vim</a> for gvim on my newly installed Ubuntu. Again, it proves that vim is a forever favorite. Mastering all key bindings with the rails script may take time, but I can smell it&#8217;s worth it.</p>
<p>Another IDE I tried was RadRails, for some reason, on my Ubuntu box, it was super slow and it sounds funny to have a RoR IDE written in Java anyway.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/yiwenandsoftware.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/yiwenandsoftware.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/yiwenandsoftware.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/yiwenandsoftware.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/yiwenandsoftware.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/yiwenandsoftware.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/yiwenandsoftware.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/yiwenandsoftware.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/yiwenandsoftware.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/yiwenandsoftware.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/yiwenandsoftware.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/yiwenandsoftware.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yiwenandsoftware.wordpress.com&blog=2109631&post=4&subd=yiwenandsoftware&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://yiwenandsoftware.wordpress.com/2007/02/04/gvim-for-ror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f711c24e96cbc441b0c94141f22f2d23?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hayafirst</media:title>
		</media:content>
	</item>
	</channel>
</rss>