<?xml version="1.0" encoding="UTF-8"?>
<feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="en"
   >
  <title type="text">Code Kills</title>
  <subtitle type="text"></subtitle>

  <updated>2012-01-22T21:05:58Z</updated>
  <generator uri="http://blogofile.com/">Blogofile</generator>

  <link rel="alternate" type="text/html" href="http://blog.codekills.net" />
  <id>http://blog.codekills.net/feed/atom/</id>
  <link rel="self" type="application/atom+xml" href="http://blog.codekills.net/feed/atom/" />
  <entry>
    <author>
      <name></name>
      <uri>http://blog.codekills.net</uri>
    </author>
    <title type="html">Vim functions to change tab treatment</title>
    <link rel="alternate" type="text/html" href="http://blog.codekills.net/2012/01/22/vim-functions-to-change-tab-treatment" />
    <id>http://blog.codekills.net/2012/01/22/vim-functions-to-change-tab-treatment</id>
    <updated>2012-01-22T21:00:00Z</updated>
    <published>2012-01-22T21:00:00Z</published>
    <category scheme="http://blog.codekills.net" term="Vim" />
    <summary type="html">Vim functions to change tab treatment</summary>
    <content type="html" xml:base="http://blog.codekills.net/2012/01/22/vim-functions-to-change-tab-treatment">

&lt;p&gt;I&#39;ve gotten tired of doing the &lt;tt&gt;:setlocal tabstop=...&lt;/tt&gt; dance every
time I start editing a file from someone who has their own unique feelings
about how wide tabs should be... So I&#39;ve written two little functions which
make it easy to change a buffer&#39;s tab mode:&lt;/p&gt;

&lt;script src=&#34;https://gist.github.com/1658762.js?file=tabtreatment.vim&#34;&gt;&lt;/script&gt;

&lt;p&gt;For example, when I start editing something written by someone who believes
spaces are evil and tabs should be five spaces wide, I just need to &lt;tt&gt;:call
HardTabs(5)&lt;/tt&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <author>
      <name>David Wolever</name>
      <uri>http://blog.codekills.net</uri>
    </author>
    <title type="html">You and Your Editor: Vim normal mode commands g, : and d (3 of N)</title>
    <link rel="alternate" type="text/html" href="http://blog.codekills.net/2009/12/05/you-and-your-editor--vim-normal-mode-commands-g,---and-d-(3-of-n)" />
    <id>http://blog.codekills.net/2009/12/05/you-and-your-editor--vim-normal-mode-commands-g,---and-d-(3-of-n)</id>
    <updated>2009-12-06T01:22:00Z</updated>
    <published>2009-12-06T01:22:00Z</published>
    <category scheme="http://blog.codekills.net" term="Vim" />
    <summary type="html">You and Your Editor: Vim normal mode commands g, : and d (3 of N)</summary>
    <content type="html" xml:base="http://blog.codekills.net/2009/12/05/you-and-your-editor--vim-normal-mode-commands-g,---and-d-(3-of-n)">

&lt;p&gt;In my last post, I &lt;a href=&#34;/archives/67-You-and-Your-Editor-Data-from-vim-logging-2-of-N.html&#34;&gt;showed off some normal-mode data from vim-logging&lt;/a&gt;. In this (and the next few) posts, I&#39;ll go though my most-used commands and describe how I use them.&lt;/p&gt;
&lt;p&gt;(Don&#39;t use Vim? This post won&#39;t be too interesting… Although you may pick up something useful)&lt;/p&gt;
&lt;h3&gt;&lt;a name=&#34;g&#34;&gt;g&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;My logs contain more than 60,000 references to the &#39;g&#39; command (eight times more than &#39;:&#39;, the next most frequently used command).  This may seem surprising at first, but stick with me and let me explain: the &#39;g&#39; command is something of a &#39;gateway&#39; command - a prefix for a number of common actions which don&#39;t have their own single-character command (for example, &lt;tt&gt;gd&lt;/tt&gt;, goto definition and &lt;tt&gt;g?&lt;/tt&gt;, rot13 encode).&lt;/p&gt;
&lt;p&gt;Here is a breakdown of the &#39;g&#39; suffixes I often use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;gj&lt;/strong&gt; and &lt;strong&gt;gk&lt;/strong&gt;: cursor to next row, cursor to previous row (&#34;make &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt; do the right thing&#34;). The &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt; commands are defined as &#34;move to next line&#34; and &#34;move to previous line&#34;, not &#34;move to next screen row&#34; and &#34;move to previous screen row&#34;. This is an important distinction to make when long lines are wrapped, and I find &#34;move to next/previous screen row&#34; is a more reasonable default. &lt;em&gt;Protip&lt;/em&gt;: use &lt;code&gt;noremap j gj&lt;/code&gt; and &lt;code&gt;noremap k gk&lt;/code&gt; in your &lt;code&gt;vimrc&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;gg&lt;/strong&gt;: cursor to top of file. After using &lt;code&gt;gg&lt;/code&gt; (for example, to edit some import statements or add a shebang line), I often use &lt;code&gt;&#39;&#39;&lt;/code&gt; (tick-tick) to jump back to the line I was editing at the time (for example, &lt;code&gt;ggofrom foo import bar&amp;lt;esc&amp;gt;&#39;&#39;&lt;/code&gt;). Also, I often use &lt;code&gt;ggVG&lt;/code&gt; (go to top, enter line-visual-mode, go to bottom) to select the entire file. From there, I can pipe it to something (for example, &lt;code&gt;:!sort&lt;/code&gt;), format it (&lt;code&gt;gw&lt;/code&gt;) or copy it to the clipboard.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;gt&lt;/strong&gt; and &lt;strong&gt;gT&lt;/strong&gt;: go tab - move to next/previous tab.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;gf&lt;/strong&gt;: goto file - edit the file under the cursor. For example, if the cursor is over the &#39;e&#39; in &lt;code&gt;import &#34;../eventDispatercherImpl.as&#34;&lt;/code&gt;, the equivalent of &lt;code&gt;:e ../eventDispatercherImpl.as&lt;/code&gt; will be executed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;gw&lt;/strong&gt;: go wrap. Wrap the selected text (that is, text selected in visual mode). Try selecting a long line (pressing &lt;code&gt;V&lt;/code&gt;), then using &lt;code&gt;gw&lt;/code&gt; to wrap it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&#39;s all the &#39;g&#39; commands I can think of for now... The next version of vim-logging will log the sub-command used, so I will be able to provide better data in the future.&lt;/p&gt;
&lt;h3&gt;&lt;a name=&#34;colon&#34;&gt;:&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The colon command is fairly obvious: enter command-line mode to run commands like &lt;code&gt;:w&lt;/code&gt; or &lt;code&gt;:help :&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I&#39;ll write more about this later, when I analyze my most-used ex commands.&lt;/p&gt;
&lt;h3&gt;&lt;a name=&#34;d&#34;&gt;d&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Ah, &lt;code&gt;d&lt;/code&gt; - delete - the programmers best friend.&lt;/p&gt;
&lt;p&gt;As with &lt;code&gt;g&lt;/code&gt;, I do not have detailed information about how I use &lt;code&gt;d&lt;/code&gt;, but I&#39;ll list the first few combinations that come to mind when I move my left index finger over the &lt;code&gt;d&lt;/code&gt; key:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;dd&lt;/code&gt; to delete whole lines&lt;/li&gt;
&lt;li&gt;&lt;code&gt;di(&lt;/code&gt; to delete everything inside a pair of parenthesise&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dfx&lt;/code&gt; to delete everything between the current position and the next occurrence of &#39;x&#39;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dj&lt;/code&gt; and &lt;code&gt;dk&lt;/code&gt; to delete this and the next/previous line&lt;/li&gt;
&lt;li&gt;&lt;code&gt;d$&lt;/code&gt; to delete from the current position to the end of the line&lt;/li&gt;
&lt;li&gt;&lt;code&gt;d&lt;/code&gt; in visual mode to delete the selected text.&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <author>
      <name>David Wolever</name>
      <uri>http://blog.codekills.net</uri>
    </author>
    <title type="html">You and Your Editor: Data from vim-logging (2 of N)</title>
    <link rel="alternate" type="text/html" href="http://blog.codekills.net/2009/12/05/you-and-your-editor--data-from-vim-logging-(2-of-n)" />
    <id>http://blog.codekills.net/2009/12/05/you-and-your-editor--data-from-vim-logging-(2-of-n)</id>
    <updated>2009-12-06T00:19:00Z</updated>
    <published>2009-12-06T00:19:00Z</published>
    <category scheme="http://blog.codekills.net" term="Vim" />
    <summary type="html">You and Your Editor: Data from vim-logging (2 of N)</summary>
    <content type="html" xml:base="http://blog.codekills.net/2009/12/05/you-and-your-editor--data-from-vim-logging-(2-of-n)">

&lt;p&gt;Remember when I &lt;a href=&#34;/archives/64-vim-logging-taking-the-superstition-out-of-most-used-command.html&#34;&gt;blogged about &lt;tt&gt;vim-logging&lt;/tt&gt;&lt;/a&gt;? Well, I&#39;ve finally gotten around to interpreting the results.&lt;/p&gt;
&lt;p&gt;First, I will cover what I believe to be the most important thing to know about vim: the normal mode commands.&lt;/p&gt;
&lt;p&gt;Below is a chart of my 39 &lt;small&gt;(why 39? I can&#39;t remember - when I created the graph, that&#39;s the number I chose)&lt;/small&gt; most-frequently-used normal-mode commands:&lt;/p&gt;

&lt;!-- EXTENDED BODY --&gt;
&lt;a id=&#34;extended&#34;&gt;&lt;/a&gt;&lt;table style=&#34;min-width: 850px&#34;&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;&lt;a href=&#34;http://blog.codekills.net/archives/68-You-and-Your-Editor-Vim-normal-mode-commands-g,-and-d-3-of-N.html&#34;&gt;(many - see discussion)&lt;/a&gt;&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;g&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;
&lt;div style=&#34;padding: 0; margin-bottom: 2px; background-color: #6699cc; width: 600.0px; height: 3px&#34;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&#34;padding: 0; margin-bottom: 2px; background-color: #6699cc; width: 600.0px; height: 3px&#34;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&#34;padding: 0; margin-bottom: 2px; background-color: #6699cc; width: 600.0px; height: 3px&#34;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&#34;padding: 0; margin-bottom: 2px; background-color: #6699cc; width: 600.0px; height: 3px&#34;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&#34;padding: 0; margin-bottom: 2px; background-color: #6699cc; width: 600.0px; height: 3px&#34;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&#34;padding: 0; margin-bottom: 2px; background-color: #6699cc; width: 600.0px; height: 3px&#34;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&#34;padding: 0; margin-bottom: 2px; background-color: #6699cc; width: 100.0px; height: 3px&#34;&gt;&amp;nbsp;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;&lt;a href=&#34;http://blog.codekills.net/archives/68-You-and-Your-Editor-Vim-normal-mode-commands-g,-and-d-3-of-N.html&#34;&gt;(ex mode command)&lt;/a&gt;&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;:&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 460.56px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;&lt;a href=&#34;http://blog.codekills.net/archives/68-You-and-Your-Editor-Vim-normal-mode-commands-g,-and-d-3-of-N.html&#34;&gt;(delete)&lt;/a&gt;&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;d&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 354.72px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(find in line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;f&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 332.1px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(move forward word)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;w&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 323.46px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(insert mode at beginning of line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;I&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 302.52px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(change)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;c&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 247.312px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(move to beginning of line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;^&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 192.66px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(insert mode at end of line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;A&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 191.7px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(move back word)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;b&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 190.74px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(undo)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;u&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 148.44px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(move to next search match)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;n&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 146.7px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(search)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;/&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 144.06px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(move left)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;h&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 142.14px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(z[nm]): close/open folds, z[tbz]: scroll window)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;z&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 136.2px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(insert mode before character)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;i&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 130.2px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(move to end of line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;$&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 128.22px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(c_w-c_[wljh_] - window commands)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;Ctrl_W&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 127.26px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(insert mode after character)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;a&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 110.212px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(find backwards in line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;F&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 96.6px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(insert node in next line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;o&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 90.412px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(move cursor half screen down)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;Ctrl_D&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 90.3px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(move line down)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;j&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 85.92px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(move line up)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;k&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 83.52px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(enter normal mode)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;ESC&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 82.14px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(repeat previous find in line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 77.22px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(substitute character)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;s&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 75.84px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(delete character)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;x&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 72.3px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(put from register)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;p&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 69.412px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(delete line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;D&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 69.412px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(}} - move to next blank line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 67.92px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;({{ - move to previous blank line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 64.86px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(enter visual-line-mode)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;V&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 57.9px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(go to bottom of file)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;G&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 55.44px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(replace)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;r&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 53.52px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(visual mode)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;v&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 40.02px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(yank text)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;y&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 39.72px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(change line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;C&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 39.112px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&#34;background-color: #dddddd&#34;&gt;&lt;td align=&#34;right&#34;&gt;&lt;em&gt;(insert mode on previous line)&lt;/em&gt;&lt;/td&gt;&lt;td align=&#34;center&#34;&gt;&lt;strong&gt;O&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;div style=&#34;height: 12px; background-color: #6699cc; width: 37.32px&#34;&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</content>
  </entry>
  <entry>
    <author>
      <name>David Wolever</name>
      <uri>http://blog.codekills.net</uri>
    </author>
    <title type="html">vim-logging: taking the superstition out of &#34;most used command&#34;</title>
    <link rel="alternate" type="text/html" href="http://blog.codekills.net/2009/10/17/vim-logging--taking-the-superstition-out-of--most-used-command-" />
    <id>http://blog.codekills.net/2009/10/17/vim-logging--taking-the-superstition-out-of--most-used-command-</id>
    <updated>2009-10-17T19:33:00Z</updated>
    <published>2009-10-17T19:33:00Z</published>
    <category scheme="http://blog.codekills.net" term="Vim" />
    <summary type="html">vim-logging: taking the superstition out of &#34;most used command&#34;</summary>
    <content type="html" xml:base="http://blog.codekills.net/2009/10/17/vim-logging--taking-the-superstition-out-of--most-used-command-">

&lt;p&gt;After writing the last entry, &lt;a href=&#34;http://blog.codekills.net/archives/63-You-and-Your-Editor-The-Bare-Minimum-You-Should-Be-Doing-1-of-N.html&#34;&gt;You and Your Editor&lt;/a&gt;, I got wondering… What commands do I &lt;strong&gt;really&lt;/strong&gt; use most often?&lt;/p&gt;
&lt;p&gt;A few hours of hacking (and a bit of help from &lt;a href=&#34;http://twitter.com/bwinton&#34;&gt;Blake Winton&lt;/a&gt;) later, I&#39;d like to present: &lt;strong&gt;&lt;a href=&#34;http://wolever.net/~wolever/wiki/vim-logging&#34;&gt;vim-logging&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If you&#39;re interested in trying it, &lt;a href=&#34;http://wolever.net/~wolever/wiki/vim-logging&#34;&gt;the wiki page&lt;/a&gt; has all the information you&#39;ll need to get started.&lt;/p&gt;
&lt;p&gt;You can expect a blog post in a week or two, detailing what I&#39;ve discovered.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <author>
      <name>David Wolever</name>
      <uri>http://blog.codekills.net</uri>
    </author>
    <title type="html">You and Your Editor: The Bare Minimum You Should Be Doing (1 of N)</title>
    <link rel="alternate" type="text/html" href="http://blog.codekills.net/2009/10/15/you-and-your-editor--the-bare-minimum-you-should-be-doing-(1-of-n)" />
    <id>http://blog.codekills.net/2009/10/15/you-and-your-editor--the-bare-minimum-you-should-be-doing-(1-of-n)</id>
    <updated>2009-10-15T04:26:00Z</updated>
    <published>2009-10-15T04:26:00Z</published>
    <category scheme="http://blog.codekills.net" term="Vim" />
    <summary type="html">You and Your Editor: The Bare Minimum You Should Be Doing (1 of N)</summary>
    <content type="html" xml:base="http://blog.codekills.net/2009/10/15/you-and-your-editor--the-bare-minimum-you-should-be-doing-(1-of-n)">

&lt;p&gt;It&#39;s come up a few times, so I&#39;ll just go and post it here: the things, in no particular order, I believe to be the bare minimum you should be able to do while you&#39;re editing source code (and how to do them in Vim):&lt;/p&gt;
&lt;h3&gt;Easily move between files&lt;/h3&gt;
&lt;p&gt;All but the simplest scripts require more than one file, so you&#39;ll often need to switch between them.&lt;/p&gt;
&lt;p&gt;Eclipse has two very useful features here: Quick Access (command+3) and Open Resource (command+shift+r):&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://img.skitch.com/20091015-1i77c8765brbn3uguti323bssd.png&#34; alt=&#34;quick access&#34; /&gt;&lt;img src=&#34;http://img.skitch.com/20091015-nwf1xjsxp9xc8xr9k4e67s66ua.png&#34; alt=&#34;open resource&#34; /&gt;&lt;/p&gt;
&lt;p&gt;And in Vim, I make heavy use of multiple windows (&lt;code&gt;:new&lt;/code&gt; and &lt;code&gt;:vnew&lt;/code&gt;, using custom shortcuts, &lt;code&gt;c-h&lt;/code&gt;, &lt;code&gt;c-j&lt;/code&gt;, &lt;code&gt;c-k&lt;/code&gt; and &lt;code&gt;c-l&lt;/code&gt; to move between them) and multiple buffers, using &lt;code&gt;:b&lt;/code&gt;. For example, below, I have typed &lt;code&gt;:b url&amp;lt;tab&amp;gt;&lt;/code&gt;, then I use &lt;code&gt;c-p&lt;/code&gt; and &lt;code&gt;c-n&lt;/code&gt; to cycle through the list of matching buffers (I also have &lt;code&gt;&amp;lt;right&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;left&amp;gt;&lt;/code&gt; bound to &lt;code&gt;:bn&lt;/code&gt; and &lt;code&gt;:bp&lt;/code&gt;, making it easy to flip through buffers if I&#39;m not sure what I want).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://img.skitch.com/20091015-tt3ybdairm6j3k71rkrqwafimp.png&#34; alt=&#34;windows and buffers in Vim&#34; /&gt;&lt;/p&gt;
&lt;h3&gt;Jump-to-definition&lt;/h3&gt;
&lt;p&gt;When you&#39;re working with a large project, especially one for which you aren&#39;t the only author, it can become nontrivial to figure out where things (classes, functions, etc) are defined. I&#39;ve found that it&#39;s very hard to read source code without a jump-to-definition function because it forces a mental context switch from &#34;figuring out what this code does&#34; to &#34;figuring out where this method is defined&#34;, then once I&#39;ve found where it&#39;s defined, &#34;ok, now what was I looking for again?&#34;, and once I&#39;ve finished reading the definition &#34;why am I looking here again?&#34; and finally to &#34;what was the point of this sentence?&#34;&lt;/p&gt;
&lt;p&gt;With Vim, I use &lt;a href=&#34;http://ctags.sourceforge.net/&#34;&gt;exuberant ctags&lt;/a&gt; to do this.&lt;/p&gt;
&lt;p&gt;First, I run &lt;code&gt;ctags -R .&lt;/code&gt; to build a &lt;code&gt;tags&lt;/code&gt; file, then I access it using &lt;code&gt;:tag&lt;/code&gt;, &lt;code&gt;c-]&lt;/code&gt; and &lt;code&gt;c-w ]&lt;/code&gt; from within Vim. Also useful is &lt;code&gt;c-t&lt;/code&gt;: after &lt;code&gt;c-]&lt;/code&gt; is used to examine a definition, &lt;code&gt;c-t&lt;/code&gt; will take you back to the place you had originally found that definition. Very, very useful.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://img.skitch.com/20091015-kfqyjynau4mg8shsb3n3sbxbbe.png&#34; alt=&#34;tags in Vim&#34; /&gt;&lt;/p&gt;
&lt;p&gt;(note, for this to work properly, make sure &lt;code&gt;:set tags=tags;/&lt;/code&gt; is set in Vim)&lt;/p&gt;
&lt;h3&gt;Search for/highlight the current word&lt;/h3&gt;
&lt;p&gt;Often, when I&#39;m reading code, I&#39;ll want to quickly look through all the references to some word in the current file (for example, to see where a variable is referenced or how a function is called). This sounds trivial, but I find myself doing it often. Very often. So give it a try before immediately disregarding it.&lt;/p&gt;
&lt;p&gt;I do this in Vim using &lt;code&gt;*&lt;/code&gt; and &lt;code&gt;#&lt;/code&gt; and &lt;code&gt;:set hlsearch&lt;/code&gt; (as a side note, I&#39;ve also got &lt;code&gt;\\&lt;/code&gt; bound to &lt;code&gt;:set nohlsearch&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;For example, if my cursor is over &lt;code&gt;load_BufferedImage&lt;/code&gt;, then I hit &lt;code&gt;*&lt;/code&gt;, I can quickly jump through all the tests which call it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;http://img.skitch.com/20091015-p7fa8ph5y74jgyd8trip71rsag.png&#34; alt=&#34;Using &#39;*&#39; to search&#34; /&gt;&lt;/p&gt;
&lt;h3&gt;That&#39;s all… For now&lt;/h3&gt;
&lt;p&gt;That&#39;s all for now, but stay tuned – I do love editing text, so I&#39;ll probably come back and write some more on this later.&lt;/p&gt;
&lt;p&gt;PS: Just to make very sure it&#39;s clear, the only editors I mean to bash here are the ones which make it very hard to do the things I&#39;ve talked about (nano, notepad, etc)… Every decent editor can do these things, you&#39;ve just got to learn how.&lt;/p&gt;
&lt;p&gt;PPS: If you don&#39;t already use it, Vim has a great built-in help system. Access it with &lt;tt&gt;:help &lt;i&gt;{subject}&lt;/i&gt;&lt;/tt&gt;. For example, &lt;code&gt;:help vnew&lt;/code&gt; or &lt;code&gt;:help &amp;lt;c-w&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;PPPS: &lt;a href=&#34;http://imaddicted.ca/&#34;&gt;Todd&lt;/a&gt; has posted a followup, &lt;a href=&#34;http://imaddicted.ca/dev/worthwhile-vim-tips/&#34;&gt;Worthwhile vim tips&lt;/a&gt; – they are a bit more basic, but even more important than the things I&#39;ve talked about here.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <author>
      <name>David Wolever</name>
      <uri>http://blog.codekills.net</uri>
    </author>
    <title type="html">DrProject/Trac Wiki Syntax Highlighting for Vim</title>
    <link rel="alternate" type="text/html" href="http://blog.codekills.net/2007/08/16/drproject-trac-wiki-syntax-highlighting-for-vim" />
    <id>http://blog.codekills.net/2007/08/16/drproject-trac-wiki-syntax-highlighting-for-vim</id>
    <updated>2007-08-16T14:39:00Z</updated>
    <published>2007-08-16T14:39:00Z</published>
    <category scheme="http://blog.codekills.net" term="DrProject" />
    <category scheme="http://blog.codekills.net" term="Vim" />
    <summary type="html">DrProject/Trac Wiki Syntax Highlighting for Vim</summary>
    <content type="html" xml:base="http://blog.codekills.net/2007/08/16/drproject-trac-wiki-syntax-highlighting-for-vim">

&lt;p&gt;After being frustrated with boring &lt;a href=&#34;http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/spectro-html.html&#34;&gt;white-on-almost-black&lt;/a&gt; (&lt;a href=&#34;http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/spectro.vim&#34;&gt;spectro&lt;/a&gt;) while working with &lt;a href=&#34;http://drproject.org&#34;&gt;DrProject&lt;/a&gt; wiki files, I broke down and wrote a Vim plugin to make the syntax pretty.  It will also parse most of the &lt;a href=&#34;http://trac.edgewall.org&#34;&gt;Trac&lt;/a&gt; syntax (and more should be easy to add).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Get it:&lt;/strong&gt; &lt;a href=&#34;http://wolever.net/~wolever/drpwiki.vim&#34;&gt;http://wolever.net/~wolever/drpwiki.vim&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using it:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Save it to ~/.vim/syntax/drpwiki.vim (create the directory if it doesn&#39;t exist)
&lt;/li&gt;&lt;li&gt;In Vim, enter `:set filetype=drpwiki`
&lt;/li&gt;&lt;/ol&gt;
</content>
  </entry>
  <entry>
    <author>
      <name>David Wolever</name>
      <uri>http://blog.codekills.net</uri>
    </author>
    <title type="html">Fixing Files with Vim Macros</title>
    <link rel="alternate" type="text/html" href="http://blog.codekills.net/2007/06/15/fixing-files-with-vim-macros" />
    <id>http://blog.codekills.net/2007/06/15/fixing-files-with-vim-macros</id>
    <updated>2007-06-16T02:51:00Z</updated>
    <published>2007-06-16T02:51:00Z</published>
    <category scheme="http://blog.codekills.net" term="Vim" />
    <summary type="html">Fixing Files with Vim Macros</summary>
    <content type="html" xml:base="http://blog.codekills.net/2007/06/15/fixing-files-with-vim-macros">

&lt;p&gt;I got an email a couple days ago asking me to add a small header to all the pages of a website I work on from time to time.  The site was built with static HTML a couple of years ago and this was the first site-wide modification I&#39;ve had to make since then.  So I fired up Vim, loaded the session I use to work on the page and got to work.  It didn&#39;t take too long to make the changes to one page -- add a couple of JavaScript functions, add a call to the the body&#39;s &lt;code&gt;onLoad&lt;/code&gt; property and finally a little div just below that.&lt;/p&gt;
&lt;p&gt;But then came the problem.  How do I apply this change to all the pages?  Normally, to do multi-file search-and-replace, I use &lt;code&gt;perl -pi -e &#39;s/search/replace/g&#39; `find . -name &#39;*.html&#39;`&lt;/code&gt;... But, in this case, I would have to run that three times (one for each block of text)... And more importantly I want to see the file before I edit it (because some of the HTML files don&#39;t use the standard template, so they would get horribly mangled).&lt;sup&gt;1&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;So how did I do it?  By writing a Vim script!  I used &lt;code&gt;gvim *.html&lt;/code&gt; to open up all the HTML files, them &lt;code&gt;qa&lt;/code&gt; to record all my keystrokes in to register &lt;code&gt;a&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;As I made the changes, I used general steps so that they could be repeated on each file.  For instance, I used &lt;code&gt;/onLoad&lt;/code&gt; to search for the &lt;code&gt;onLoad&lt;/code&gt; property of the body, then &lt;code&gt;f=la&lt;/code&gt; to find the &lt;code&gt;=&lt;/code&gt;, move one character to the right then insert my text.  When that was done, I opened up the line right below the body tag with &lt;code&gt;o&lt;/code&gt; and put in the &lt;code&gt;div&lt;/code&gt; tag that I needed.&lt;/p&gt;
&lt;p&gt;Finally, after saving the file, I used &lt;code&gt;:bn&lt;/code&gt; to move to the next buffer and hit &lt;code&gt;q&lt;/code&gt; to stop the recording.  I could now look at the new file to see if it needed to be changed, then change it with &lt;code&gt;@a&lt;/code&gt; or move on to the next buffer with &lt;code&gt;:bn&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now, this makes me curious... Faced with a similar situation, how would you solve a problem like this?&lt;/p&gt;
&lt;p&gt;&lt;small&gt;1: Now, in retrospect, I realize I could have used:
&lt;code&gt;&lt;/code&gt;&lt;/small&gt;&lt;/p&gt;
&lt;pre&gt;
for FILE in `find . -name &#39;*.html&#39;`; do
  read -p &#34;Edit $FILE? &#34; R
  if [[ $R == &#34;y&#34; ]]; then
     perl -pi -e &#39;s/old/new&#39; $FILE
  fi
done
&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But that would assume that I was putting some serious level of thought in to this.  Also, unless I also had the presence of mind to add &lt;code&gt;cp $FILE{,.backup}&lt;/code&gt; I would not have any way to un-do my changes.&lt;/p&gt;
</content>
  </entry>
</feed>

