<?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>Yan Pritzker</title>
	<atom:link href="http://yanpritzker.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://yanpritzker.com</link>
	<description>photographer, entrepreneur, software engineer, musician, skier</description>
	<lastBuildDate>Thu, 26 Apr 2012 18:11:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<atom:link rel="next" href="http://yanpritzker.com/feed/?page=2" />

		<item>
		<title>Talk Notes: Rails Sustainable Productivity by Xavier Shay</title>
		<link>http://yanpritzker.com/2012/04/26/talk-notes-rails-sustainable-productivity-by-xavier-shay/</link>
		<comments>http://yanpritzker.com/2012/04/26/talk-notes-rails-sustainable-productivity-by-xavier-shay/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 16:00:40 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[video-notes]]></category>

		<guid isPermaLink="false">http://yanpritzker.com/?p=529</guid>
		<description><![CDATA[http://confreaks.com/videos/815-larubyconf2012-rails-sustainable-productivity Here are my notes on Xavier Shay&#8217;s awesome video on sustainable productivity in Rails. I agree wholeheartedly with all of his points, and although they&#8217;re not particularly new, it&#8217;s nice to hear from someone with real world perspective on maintaining a large Rails project. Rails does not make data integrity a priority, so be [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://confreaks.com/videos/815-larubyconf2012-rails-sustainable-productivity" title="Watch the original video">http://confreaks.com/videos/815-larubyconf2012-rails-sustainable-productivity</a></p>
<p>Here are my notes on Xavier Shay&#8217;s awesome video on sustainable productivity in Rails. I agree wholeheartedly with all of his points, and although they&#8217;re not particularly new, it&#8217;s nice to hear from someone with real world perspective on maintaining a large Rails project.</p>
<ol>
<li>Rails does not make data integrity a priority, so be conscious of it and take the effort. Ideally the framework will evolve in this direction eventually.
<ul>
<li>validates_uniqueness_of doesn&#8217;t validate uniqueness with concurrent access &#8211; you need db constraints (unique indexes, foreign keys, etc). At the same time, Rails doesn&#8217;t provide a good built in way to error handle constraint violations.</li>
<li>Rails encourages poor practice with database because things like t.references in migrations doesn&#8217;t add foreign keys.</li>
<li>(personal note) I have seen many Rails projects completely ignore database keys. I like the old adage that your database will outlive your application. Put constraints where they belong.
</li>
</ul>
</li>
<li>Consistency is incredibly important, and is more so when you have a large team. If you create two ways of doing one thing, the next developer has to scratch his head. Don&#8217;t duplicate code or concepts, design for reuse.</li>
<li>Don&#8217;t pepper third party dependencies in your code. Design layers of abstraction so that all third party access is in one spot, easy to change. Use reification &#8211; start naming concepts rather than implying them with conditional logic (e.g. the Null Object pattern).</li>
<li>&#8220;Fail your build for basic style, complexity, and readability violations.&#8221; Don&#8217;t let people check in stuff with bad whitespace, complex methods, etc. Make it part of the continuous integration cycle. Bad code spawns more bad code. Easier to prevent in the first place than untangle later. (see: <a href="https://github.com/square/cane">cane</a>, also <a href="https://github.com/jscruggs/metric_fu">metric_fu</a>)</li>
<li>Self-documenting code is awesome, but documentation should be used on a class level to describe how the class figures into the bigger picture. I&#8217;m a huge fan of this idea, and don&#8217;t do it enough myself.</li>
<li>Rails unit/functional/integration test definitions are different from everywhere else in the world. They tell you how to organize code but are not useful, leading us to have &#8220;fast spec&#8221; vs &#8220;slow spec&#8221;. This is bad. A unit test should not touch the database, filesystem, etc. Unit tests should be fast and without dependencies, integration tests specify boundaries, acceptance tests make sure the system works.
<ul>
<li> (Personal note) At <a href="http://crowdcast.com">Crowdcast</a> we have been working purely with fast-spec lately, even stubbing out dependencies in our controller tests so we can blazing fast TDD our code through the entire stack, relying on a single high level acceptance test that makes sure everything connects correctly, and stubbing everything at lower levels.</li>
</ul>
</li>
</ol>
<p>Videos are awesome but not everyone has the time. I made these notes for myself but if people find them useful, I&#8217;ll try to continue blogging short summaries of talks that I watch. I hope others do the same, so we can save each other time :)</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2012/04/26/talk-notes-rails-sustainable-productivity-by-xavier-shay/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2012/04/26/talk-notes-rails-sustainable-productivity-by-xavier-shay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 minutes a day for exponential productivity</title>
		<link>http://yanpritzker.com/2012/04/25/5-minutes-a-day-for-exponential-productivity/</link>
		<comments>http://yanpritzker.com/2012/04/25/5-minutes-a-day-for-exponential-productivity/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 16:45:02 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[dotfiles]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://yanpritzker.com/?p=523</guid>
		<description><![CDATA[As a software developer, my day is taken by two primary activities: thought work and typing. Although I am a very fast typer, they pay me the big bucks ostensibly for what is inside my head, not my fingers. Every moment I spend typing something repetitive is therefore not only a waste of the time [...]]]></description>
			<content:encoded><![CDATA[<p>As a software developer, my day is taken by two primary activities: thought work and typing. Although I am a very fast typer, they pay me the big bucks ostensibly for what is inside my head, not my fingers. Every moment I spend typing something repetitive is therefore not only a waste of the time it takes to type it, but a waste of time away from thinking, developing, designing.  And every inch traveled by my hands brings me one inch closer to a potential repetitive strain injury.</p>
<p>So I decided to do something about this. Every single day, I spend at least 5 minutes learning something new that saves me time. I notice a repetitive motion, and I write a vim mapping, a shell alias, or a utility script, or just spend time looking at what <a href="https://github.com/search?q=dotfiles">other people are doing.</a> It&#8217;s sometimes hard to step back and be self aware about the things that I repeat, so I try to watch how others work too. Then I go and write a shortcut. This small investment every single day, pays huge dividends because I get exponentially faster at the mechanical parts of my job every day, leaving more time for thought and productivity.</p>
<p>I like doing this, and I like sharing my learnings with the world. If you want a peek at how I do things, check out <a href="http://skwp.github.com/dotfiles">my dotfiles project, YADR</a>. Fork it, copy it, steal the bits that you like, or contribute some of your own. Huge wins stand on the shoulders of lots of tiny ones.</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2012/04/25/5-minutes-a-day-for-exponential-productivity/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2012/04/25/5-minutes-a-day-for-exponential-productivity/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to change vim syntax colors that are annoying you</title>
		<link>http://yanpritzker.com/2012/04/17/how-to-change-vim-syntax-colors-that-are-annoying-you/</link>
		<comments>http://yanpritzker.com/2012/04/17/how-to-change-vim-syntax-colors-that-are-annoying-you/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 16:00:06 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://yanpritzker.com/?p=509</guid>
		<description><![CDATA[If you look at code all day, having readable colors is going to be the biggest thing that saves your eyes. Here&#8217;s how I tweak my colors any time they bother me. To start, you&#8217;ll need this little piece of script, which gives you a ,hi alias, which will display the current highlight group. 1. [...]]]></description>
			<content:encoded><![CDATA[<p>If you look at code all day, having readable colors is going to be the biggest thing that saves your eyes. Here&#8217;s how I tweak my colors any time they bother me. To start, you&#8217;ll need this little piece of script, which gives you a <strong>,hi</strong> alias, which will display the current highlight group. </p>
<p><script src="https://gist.github.com/2403574.js"> </script></p>
<p>1. With your cursor over the thing that&#8217;s highlighted in a bad color, hit the <strong>,hi</strong>. Say I don&#8217;t like the way this describe keyword is done in pink:</p>
<p><img src="http://i.imgur.com/2PsPa.png"/></p>
<p>2. Note the info displayed in the status line, it will look something like:<br />
<code>hi&lt;<strong>rspecGroupMethods</strong>&gt; trans&lt;<strong>rspecGroupMethods</strong>&gt; lo&lt;<strong>Todo</strong>&gt; FG:#d33682</code></p>
<p>These are the color highlight groups, in brackets. The leftmost one is the one with highest precedence, and the one we want to override.</p>
<p>3. Look at the list of available colors using <strong>:hi</strong>. Note the names of the groups on the left, and their displayed colors. Find one you like. The list will look something like this:</p>
<p><img src="http://i.imgur.com/53jEH.png"/></p>
<p>4. Create a link between the group you want to modify and the one you like. Let&#8217;s say the one I like is Identifier, and the group I&#8217;m modifying is MatchParen. I would link them like this:</p>
<p><code>hi! link rspecGroupMethods Type</code></p>
<p>Reload your vimrc, or the file in which you placed the statement. The easiest way to evaluate the current file is <strong>:so %</strong>. And voila:</p>
<p><img src="http://i.imgur.com/iSeuK.png"/></p>
<p>You can place this in your ~/.vimrc, or in a subfile under ~/.vimrc/plugins. If you liked this example, be sure to check out my <a href="http://skwp.github.com/dotfiles">highly customized dotfile project called YADR,</a> which offers the <strong>,hi</strong> functionality, well organized vim snippets and plugins, and other handy shortcuts to save you tons of time.</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2012/04/17/how-to-change-vim-syntax-colors-that-are-annoying-you/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2012/04/17/how-to-change-vim-syntax-colors-that-are-annoying-you/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to win friends with Maintenance Driven Design</title>
		<link>http://yanpritzker.com/2012/04/04/how-to-win-friends-with-maintenance-driven-design/</link>
		<comments>http://yanpritzker.com/2012/04/04/how-to-win-friends-with-maintenance-driven-design/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 23:35:57 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://yanpritzker.com/?p=487</guid>
		<description><![CDATA[When I come to a design decision in writing an application, script, or interface. I ask myself only one question: What will the next guy think? I call this Maintenance Driven Design. By designing your software to be maintainable, you will earn many friends and praises. As software developers, ops guys, designers, it is a [...]]]></description>
			<content:encoded><![CDATA[<p>When I come to a design decision in writing an application, script, or interface. I ask myself only one question: </strong>What will the next guy think?</strong> I call this <strong>Maintenance Driven Design.</strong> By designing your software to be maintainable, you will earn many friends and praises.</p>
<p>As software developers, ops guys, designers, it is a known evil that we sometimes choose shortcuts, accruing tech debt with the knowledge that we&#8217;ll pay for it later with considerable interest. However, there are a few categories of design choices that we make every day that will make software easier or harder to maintain for the next guy who comes after us, which are specifically evil and malicious forms of tech debt. </p>
<p>Here are a few basic categories that most non-Maintenance Driven decisions fall into. Please don&#8217;t be that guy :)</p>
<ul>
<li><strong>duplication</strong> &#8211; This is the cardinal sin against Maintainable Design. If you duplicate code, it will instantly grow into piles of subtly divergent crap. It would have taken you an additional hour to figure out how to do it in a non-duplicated way. It will take your maintainers half a lifetime to understand why and how the code has diverged. My own anecdotal experience says that duplication has about a 1000% tech debt interest rate. That is, 1 hour saved by committing duplicated code will cost you 10 hours down the line. And this interest is compounded over time as the code diverges further.</li>
<li><strong>clever code</strong> &#8211; Clever is the enemy of Maintainable. Every time you cut and paste a really cool hack that you found on a blog in 2006, a unicorn dies. Follow conventions, and use existing and accepted practices instead of reinventing the wheel.</li>
<li><strong>personal aesthetics</strong> &#8211; Having a strong sense of personal style is awesome. You like snakeskin jackets and neon green pants? Sweet. But leave it out of the code. If you have a personal style that goes against accepted conventions, and you choose to prioritize your style over that of the community, you are not Maintenance Driven. When in doubt, look at the source code for a large community supported project (i.e. Rails) for style ideas.</li>
<li><strong>poor naming</strong> &#8211; Single letter variable names are impossible to grep for effectively. Names based on your favorite ninja turtles, though they will win you points with me, are bad for business. Same goes for commit messages &#8211; don&#8217;t write something clever and witty at the expense of clearly explaining your changes.</li>
</ul>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2012/04/04/how-to-win-friends-with-maintenance-driven-design/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2012/04/04/how-to-win-friends-with-maintenance-driven-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vim &#8211; Navigating files in vertical splits</title>
		<link>http://yanpritzker.com/2012/03/12/vim-navigating-files-in-vertical-splits/</link>
		<comments>http://yanpritzker.com/2012/03/12/vim-navigating-files-in-vertical-splits/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 16:44:22 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://yanpritzker.com/?p=468</guid>
		<description><![CDATA[The two most useful native vim mappings for navigation are arguably gf (go to file, use it over any reference to a file, such as a Rails partial), and Ctrl-] (go to tag, use it over any class or function name). But one problem in vim is that by doing these commands, you lose your [...]]]></description>
			<content:encoded><![CDATA[<p>The two most useful native vim mappings for navigation are arguably <code>gf</code> (go to file, use it over any reference to a file, such as a Rails partial), and <code>Ctrl-]</code> (go to tag, use it over any class or function name). But one problem in vim is that by doing these commands, you lose your previous place. Sure it&#8217;s easy to go back to with Ctrl-O or similar, but I find it much more useful to open the new location in a split, as you are usually exploring them while retaining the current context. Here are two mappings that do that for you:</p>
<p><script src="https://gist.github.com/2031016.js"> </script></p>
<p>If you like these, you might want to check out my <a href="https://github.com/skwp/dotfiles">Yet Another Dotfile Repo</a> project, which includes these and more!</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2012/03/12/vim-navigating-files-in-vertical-splits/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2012/03/12/vim-navigating-files-in-vertical-splits/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>The cleanest vimrc you&#8217;ll ever see</title>
		<link>http://yanpritzker.com/2012/01/20/the-cleanest-vimrc-youve-ever-seen/</link>
		<comments>http://yanpritzker.com/2012/01/20/the-cleanest-vimrc-youve-ever-seen/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 17:02:51 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://yanpritzker.com/?p=446</guid>
		<description><![CDATA[Ruby developer oriented dotfiles and vim configs to make your heart sing]]></description>
			<content:encoded><![CDATA[<p>So many of us use vimrc files that are a frankenstein&#8217;s monster, cobbled together from spare parts, gists, and snippets from wikis. One day I decided I was no longer going to treat my vimrc as a garbage dump. As programmers, we strive toward well factored code, so why do we accept such ugly vimrc&#8217;s that are impossible to understand, and even worse impossible to share because of their complexity. Let&#8217;s stop the insanity! It turns out it&#8217;s very easy&#8230;</p>
<p>Since vim automatically loads everything in ~/.vim/plugin/, you can just add a directory like ~/.vim/plugin/settings and put each semantic piece in its own snippet. Put your keymaps in ~/.vim/plugin/settings/keymap.vim. Put your visual setup like font and colors into ~/.vim/plugin/settings/gui.vim, etc. </p>
<p>After I did this, I ended up with a vimrc that&#8217;s only about 90 lines long including very detailed comments about every section. </p>
<p>I think this is the <a href="https://github.com/skwp/dotfiles/blob/master/vimrc">cleanest vimrc you&#8217;ll see on the web.</a> All my <a href="https://github.com/skwp/dotfiles/tree/master/vim/plugin/settings">vim plugin settings are broken down into individual files</a>, following a convention of one file per vim plugin that I use, plus some extra ones that are too small to be plugins. </p>
<p><strong>Think your vimrc is better? Show me! I want to learn :)</strong> </p>
<p>My vimrc and the rest of my vim setup is available as part of my <a href="http://github.com/skwp/dotfiles">YADR (Yet Another Dotfiles Repo) project</a>. Come check it out, I need alpha testers!</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2012/01/20/the-cleanest-vimrc-youve-ever-seen/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2012/01/20/the-cleanest-vimrc-youve-ever-seen/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Convert rspec pending to xit with vim</title>
		<link>http://yanpritzker.com/2012/01/03/convert-rspec-pending-to-xit-with-vim/</link>
		<comments>http://yanpritzker.com/2012/01/03/convert-rspec-pending-to-xit-with-vim/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 17:52:31 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[rspec]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://yanpritzker.com/?p=434</guid>
		<description><![CDATA[RSpec has two ways of disabling tests: pending and xit. Except one of them is truly evil. Pending actually still runs the before block even when it&#8217;s disabled. This is bad when you have a test with a very expensive before block. Changing the pending to xit is a great strategy, but tedious. Vimscript to [...]]]></description>
			<content:encoded><![CDATA[<p>RSpec has two ways of disabling tests: pending and xit. Except one of them is truly evil. Pending actually still runs the before block even when it&#8217;s disabled. This is bad when you have a test with a very expensive before block. Changing the pending to xit is a great strategy, but tedious. Vimscript to the rescue! The functionality is available as part of my dotfiles repo, but you can just <a href="https://raw.github.com/skwp/dotfiles/master/vim/plugin/settings/rspec_pending_to_xit.vim">grab the script by itself</a> and type <em>,rxit</em> to use it on a file. </p>
<p>For more awesomeness, check out my dotfiles repo called <a href="http://github.com/skwp/dotfiles">YADR (Yet Another Dotfiles Repo)</a>, featuring 100% clean vimrc with all custom keymapping done in well factored scripts inside vim/plugin/settings, and a list of plugins perfectly tailored for Rails development, currently in alpha preview.</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2012/01/03/convert-rspec-pending-to-xit-with-vim/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2012/01/03/convert-rspec-pending-to-xit-with-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learn to speak vim &#8211; verbs, nouns, and modifiers!</title>
		<link>http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns-and-modifiers/</link>
		<comments>http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns-and-modifiers/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 17:30:32 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://yanpritzker.com/?p=409</guid>
		<description><![CDATA[.vim strong { font-size: 120%; background: lightyellow; } .vim code { background: #eee; padding: 0.5em; margin-top:1em; display:block } Using vim is like talking to your editor in &#8216;verb modifier object&#8217; sentences, turned into acronyms learn some verbs: v (visual), c (change), d (delete), y (yank/copy). these are the most important. there are others learn some [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css" media="screen">
  .vim strong { font-size: 120%; background: lightyellow; }
  .vim code { background: #eee; padding: 0.5em; margin-top:1em; display:block }
</style>
<p>Using vim is like talking to your editor in &lsquo;verb modifier object&rsquo; sentences, turned into acronyms</p>
<ul class='vim'>
<li>learn some verbs: <strong>v</strong> (visual), <strong>c</strong> (change), <strong>d</strong> (delete), <strong>y</strong> (yank/copy). these are the most important. there are others</li>
<li>learn some modifiers: <strong>i</strong> (inside), <strong>a</strong> (around), <strong>t</strong> (till..finds a character), <strong>f</strong> (find..like till except including the char), <strong>/</strong> (search..find a string/regex)</li>
<li>learn some text objects: <strong>w</strong> (word), <strong>s</strong> (sentence) <strong>p</strong> (paragraph) <strong>b</strong> (block/parentheses), <strong>t</strong> (tag, works for html/xml) there are others</li>
</ul>
<p><strong>To move efficiently in vim,</strong> don&rsquo;t try to do anything by pressing keys many times, instead speak to the editor in sentences</p>
<ul>
<li>delete the current word: diw (delete inside word)</li>
<li>change current sentence: cis (change inside sentence)</li>
<li>change a string inside quotes: ci&rdquo; (change inside quote)</li>
<li>change until next occurrence of &#8216;foo&#8217;: c/foo (change search foo)</li>
<li>change everything from here to the letter X: ctX</li>
<li>visually select this paragraph: vap (visual around paragraph)</li>
</ul>
<p>If you understand the verbs and objects you&rsquo;re dealing with, you will soon realize that adding a new plugin and learning a new verb or noun exponentially increases your productivity, as you can now apply it in all the sentences you already know. It&rsquo;s just like learning a language. </p>
<h4>Let&#8217;s add some new text object plugins!</h4>
<ul>
<li>install surround.vim: <a href="https://github.com/tpope/vim-surround">vim-surround</a>- you get a new noun, the &lsquo;surround&rsquo; (s or S)
<ul>
<li>visually select a word and surround it with quotes: viwS&rdquo;</li>
<li>change surround from single quote to double quote: cs&rsquo;&rdquo;</li>
</ul>
</li>
<li>install <a href="https://github.com/nelstrom/vim-textobj-rubyblock" title="vim-textobj-rubyblock">vim-textobj-rubyblock</a> &#8211; you get a new noun, the &lsquo;ruby block&rsquo; (r)
<ul>
<li>delete current ruby block: dir (delete inside ruby block)</li>
<li>visually select a ruby function: var (visual around ruby block)</li>
<li>visually select the innards of a function: vir (visual inside ruby block)</li>
</ul>
</li>
<li>install <a href="https://github.com/tomtom/tcomment_vim">tComment</a> &#8211; new verb: &#8220;gc&#8221; (go comment)</li>
<ul>
<li>comment the current ruby method: gcar (go comment around ruby)</li>
</ul>
</ul>
<p>Now go out and learn a new verb or noun every day!</p>
<h4>Resources and Further Reading</h4>
<ul>
<li><a href="http://blog.carbonfive.com/2011/10/17/vim-text-objects-the-definitive-guide">Vim Text Objects, Definitive Guide</a>, a great blog post!</a></li>
<li>Want an exceptionally curated collection of the best plugins vim has to offer? Check out an early beta preview of my <a href="http://github.com/skwp/dotfiles">fully modularized vim/dotfile setup called YADR (Yet Another Dotfile Repo)</a> which includes text object plugins for ruby blocks(r), indents(i), dates(da/df), function arguments(a), and ruby symbols(:)</li>
</ul>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns-and-modifiers/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns-and-modifiers/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Vim demystified: ten commands you can start using today</title>
		<link>http://yanpritzker.com/2011/11/30/vim-demystified-ten-commands-you-can-start-using-today/</link>
		<comments>http://yanpritzker.com/2011/11/30/vim-demystified-ten-commands-you-can-start-using-today/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 15:01:38 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[productivity]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://yanpritzker.com/?p=375</guid>
		<description><![CDATA[.vimtable { text-align: left; width: 600px; border: 1px solid #aaa; margin-bottom: 1em } .vimtable td,th { padding: 1em; } .vimtable tr td {border-bottom: 1px solid #ddd } .vimtable tr.last td { border-bottom: none} .vimtable td.first { font-weight: bold; font-size: 120%; } .vimtable strong { font-size: 120%; background: lightyellow; } .vimtable tr.warning td { background: #ffffcc; [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css" media="screen">
  .vimtable { text-align: left; width: 600px; border: 1px solid #aaa; margin-bottom: 1em }
  .vimtable td,th { padding: 1em; }
  .vimtable tr td {border-bottom: 1px solid #ddd  }
  .vimtable tr.last td { border-bottom: none}
  .vimtable td.first { font-weight: bold; font-size: 120%; }
  .vimtable strong { font-size: 120%; background: lightyellow; }
  .vimtable tr.warning td { background: #ffffcc; color: #1E1E1A}
  .vimtable code { background: #eee; padding: 0.5em; margin-top:1em; display:block }
</style>
<p>These commands are not only extremely useful but also mnemonic and easy to learn for a huge payoff in keystroke savings. These are the common compound commands I use every day, and I think it&#8217;s easier to dive in this way than to try to learn vim key by key. </p>
<table class="vimtable">
<tr class='warning'>
<td colspan='100%'>Read Me First! <a href='http://dailyvim.blogspot.com/2008/04/ways-to-avoid-esc-key.html'>Save your wrists, stop using ESC in vim</a></td>
</tr>
<tr>
<td class="first">yaw</td>
<td>
    <strong>y</strong>ank <strong>a</strong>round <strong>w</strong>ord &#8211; copy the current word, no matter where your cursor is inside the word</p>
</td>
</tr>
<tr>
<td class="first">ci&#8221;</td>
<td><strong>c</strong>hange <strong>i</strong>nside quote (or any other enclosure). Example: <strong>ci(</strong> to change something surrounded by parentheses. But what&#8217;s <em>really cool</em> is that you can invoke this from anywhere inside a line of code, so even if the string you want to change is far away, typing <strong>ci&#8221;</strong> will put your right inside the string, ready to change it.</td>
</tr>
<tr>
<td class="first">ctX</td>
<td>
      <strong>c</strong>hange <strong>t</strong>ill <strong>X</strong> (any character); and in general the use of <strong>tX</strong> where X is any character, to move to that character. You can combine the motion with another command such as <strong>dtX</strong> (delete till X), <strong>ytX</strong> (yank till X), or <strong>vtX</strong> (visually select till X).</p>
</td>
</tr>
<tr>
<td class="first">gf</td>
<td>
<p>      <strong>g</strong>o to <strong>f</strong>ile &#8211; open the file under the cursor (useful for traversing file references inside codebases)
    </td>
</tr>
<tr>
<td class="first">* (Shift-8)</td>
<td>Takes you to the next occurrance of the word you&#8217;re currently looking at (often the best way to navigate to the definition of a method, if witin the same file)</td>
</tr>
<tr>
<td class="first">Ctrl-6</td>
<td>Jumps you back to the previous file you were editing. I use this so often I remapped it to just the capital letter Z:<br />
      <code> nnoremap &lt;silent&gt; Z &lt;C-^&gt;</code>
    </td>
</tr>
<tr>
<td class="first">Ctrl-]</td>
<td>
<p>
        Again, immensly useful for traversing codebases, this command relies on exuberant ctags (<a href="http://www.thegeekstuff.com/2009/04/ctags-taglist-vi-vim-editor-as-sourece-code-browser/">set up ctags</a>) to take you to method and class definitions. I remap this to simply leader capital <strong>F</strong>:
      </p>
<p>      <code>nnoremap &lt;silent&gt; <leader>F &lt;C-]&gt;</code></p>
<p>
        I believe all highly used commands should be a single letter, as close as possible to home row.
    </p>
</td>
</tr>
<td class="first">mX<br/>&#8216;X</td>
<td>
<p>
        You can bookmark a file very quickly by using <strong>m</strong> plus any capital letter. Then to go back to the file at any time, hit <strong>&#8216;</strong> and the same letter again.
      </p>
</td>
<tr class='warning'>
<td colspan='100%'>The commands in this section are based on custom aliases. Please check that the alias doesn&#8217;t overload a key you&#8217;re used to.</td>
</tr>
<tr>
<td class="first">K</td>
<td>
      For super fast code navigation, nothing beats the <A href="https://github.com/tjennings/git-grep-vim">git grep </a>plugin combined with an alias to grep the <strong>K</strong>urrent word under the cursor:</p>
<p>          <code>nnoremap &lt;silent&gt; K :GitGrep &lt;cword&gt;&lt;CR&gt;</code>
    </td>
</tr>
<tr>
<td class="first">vv<br/>ss</td>
<td>
      Splitting windows is a common and every day task, so you shouldn&#8217;t spend extra time typing to do so. Just double tap <strong>vv</strong> or <strong>ss</strong>:<br />
      <code>nnoremap &lt;silent&gt; vv &lt;C-w&gt;v<br/>nnoremap &lt;silent&gt; ss &lt;C-w&gt;s</code>
    </td>
</tr>
<tr class='last'>
<td class="first">Window navigation using J,K,I,M</td>
<td><em>Bonus:</em> A very common task for which the default key bindings involve way too many keystrokes. Use directional style keys to move between windows:<br />
      <code>nnoremap &lt;silent&gt; H &lt;C-w&gt;h<br />
      nnoremap &lt;silent&gt; L &lt;C-w&gt;l<br />
      nnoremap &lt;silent&gt; I &lt;C-w&gt;k<br />
      nnoremap &lt;silent&gt; M &lt;C-w&gt;j</code>
    </td>
</tr>
</table>
<div style='background:#eee; width:600px; margin-top:1em; margin-bottom:1em'>
<p style='margin: 1em;'>
If you liked this post, you might want to watch <a href="http://github.com/skwp/dotfiles">my dotfiles repo on github</a>. My dotfiles follow a keystroke minimizing principle where all common tools are only a few characters long, and are in the process of being cleaned up in order to release as a product targeting keystroke saving enthusiasts (this is especially important for those concerned with RSI prevention).
</p>
</div>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2011/11/30/vim-demystified-ten-commands-you-can-start-using-today/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2011/11/30/vim-demystified-ten-commands-you-can-start-using-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails plugin: view a tree of all your partials</title>
		<link>http://yanpritzker.com/2011/11/21/rails-view-a-tree-of-all-your-partials/</link>
		<comments>http://yanpritzker.com/2011/11/21/rails-view-a-tree-of-all-your-partials/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 15:48:28 +0000</pubDate>
		<dc:creator>yan</dc:creator>
				<category><![CDATA[RubyOnRails]]></category>

		<guid isPermaLink="false">http://yanpritzker.com/?p=372</guid>
		<description><![CDATA[Trying to refactor your views? Too many partials got you down? Let PartialMap help! Draws an ascii or html tree of all your views and the partials that they reference. The tool is very simple and has a plugin formatter architecture so you can create formatters for other views. Please fork and contribute, or just [...]]]></description>
			<content:encoded><![CDATA[<p>Trying to refactor your views? Too many partials got you down? Let PartialMap help! Draws an ascii or html tree of all your views and the partials that they reference. The tool is very simple and has a plugin formatter architecture so you can create formatters for other views. Please fork and contribute, or just enjoy as is: <a href="https://github.com/skwp/PartialMap">PartialMap on github</a>.</p>
<div class="plus-one-wrap"><g:plusone href="http://yanpritzker.com/2011/11/21/rails-view-a-tree-of-all-your-partials/"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://yanpritzker.com/2011/11/21/rails-view-a-tree-of-all-your-partials/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.601 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-18 03:05:57 -->

