scratch/output/Scratch/en/blog/Learn-Vim-Progressively/index.html

597 lines
25 KiB
HTML
Raw Normal View History

2011-08-26 13:48:47 +00:00
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="vi, vim, editor, tutorial">
<link rel="shortcut icon" type="image/x-icon" href="/Scratch/img/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/Scratch/assets/css/main.css" />
<link rel="stylesheet" type="text/css" href="/Scratch/css/twilight.css" />
<link rel="stylesheet" type="text/css" href="/Scratch/css/idc.css" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://feeds.feedburner.com/yannespositocomen"/>
<link rel="alternate" lang="fr" xml:lang="fr" title="Apprenez Vim Progressivement" type="text/html" hreflang="fr" href="/Scratch/fr/blog/Learn-Vim-Progressively/" />
<link rel="alternate" lang="en" xml:lang="en" title="Learn Vim Progressively" type="text/html" hreflang="en" href="/Scratch/en/blog/Learn-Vim-Progressively/" />
<script type="text/javascript" src="/Scratch/js/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="/Scratch/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/Scratch/js/index.js"></script>
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->
<!-- < % if containMaths %>
<script type="text/javascript" src="/Scratch/js/MathJax/MathJax.js"></script>
< % end %>
-->
<title>Learn Vim Progressively</title>
</head>
<body lang="en">
<script type="text/javascript">// <![CDATA[
document.write('<div id="blackpage"><img src="/Scratch/img/loading.gif" alt="loading..."/></div>');
// ]]>
</script>
<div id="content">
<div id="choix">
<div class="return"><a href="#entete">&darr; Menu &darr;</a></div>
<div id="choixlang">
<a href="/Scratch/fr/blog/Learn-Vim-Progressively/" onclick="setLanguage('fr')">en Français</a>
</div>
2011-09-28 15:45:28 +00:00
<div class="flush"></div>
2011-08-26 13:48:47 +00:00
</div>
<div id="titre">
<h1>
Learn Vim Progressively
</h1>
</div>
<div class="flush"></div>
<div class="flush"></div>
<div id="afterheader">
<div class="corps">
<p><img alt="Über leet use vim!" src="/Scratch/img/blog/Learn-Vim-Progressively/uber_leet_use_vim.jpg" /></p>
<div class="intro">
2011-09-02 11:40:34 +00:00
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> Want to learn vim (the best text editor known to human kind) the fastest way possible. I suggest you a way. Start by learning the minimal to survive, then integrate slowly all tricks.</p>
2011-08-26 13:48:47 +00:00
</div>
<p><a href="http://www.vim.org">Vim</a> the Six Billion Dollar editor</p>
<blockquote>
<p>Better, Stronger, Faster.</p>
</blockquote>
<p>Learn <a href="http://www.vim.org">vim</a> and it will be your last text editor.
There isn&rsquo;t any better text editor I know.
Hard to learn, but incredible to use.</p>
<p>I suggest you to learn it in 4 steps:</p>
<ol>
<li>Survive</li>
<li>Feel comfortable</li>
<li>Feel Better, Stronger, Faster</li>
<li>Use vim superpowers</li>
</ol>
<p>By the end of this journey, you&rsquo;ll become a vim superstar. </p>
<p>But before we start, just a warning.
Learning vim will be painful at first.
2011-08-26 14:32:49 +00:00
It will take time.
It will be a lot like playing a music instrument.
2011-08-26 13:48:47 +00:00
Don&rsquo;t expect to be more efficient with vim than with another editor in less than 3 days.
In fact it will certainly take 2 weeks instead of 3 days.</p>
<h2 id="st-level----survive">1<sup>st</sup> Level &ndash; Survive</h2>
<ol>
<li>Install <a href="http://www.vim.org">vim</a></li>
<li>Launch vim</li>
<li>DO NOTHING! Read.</li>
</ol>
<p>In a standard editor, typing on the keyboard is enough to write something and see it on the screen.
Not this time.
2011-08-29 13:14:17 +00:00
Vim is in <em>Normal</em> mode.
2011-08-30 06:07:50 +00:00
Let&rsquo;s get in <em>Insert</em> mode.
2011-08-26 13:48:47 +00:00
Type on the letter <code>i</code>.</p>
2011-08-26 14:32:49 +00:00
<p>You should feel a bit better.
2011-08-26 13:48:47 +00:00
You can type letters like in a standard notepad.
2011-08-29 13:14:17 +00:00
To get back in <em>Normal</em> mode just tap the <code>ESC</code> key.</p>
2011-08-26 13:48:47 +00:00
2011-08-29 13:14:17 +00:00
<p>You know how to switch between <em>Insert</em> and <em>Normal</em> mode.
And now, the list of command you can use in <em>Normal</em> mode to survive:</p>
2011-08-26 13:48:47 +00:00
<blockquote>
<ul>
2011-08-29 21:13:33 +00:00
<li><code>i</code><em>Insert</em> mode. Type <code>ESC</code> to return to Normal mode.</li>
<li><code>x</code> → Delete the char under the cursor</li>
<li><code>:wq</code> → Save and Quit (<code>:w</code> save, <code>:q</code> quit)</li>
<li><code>dd</code> → Delete (and copy) current line</li>
<li><code>p</code> → Paste</li>
2011-08-26 14:32:49 +00:00
</ul>
<p>Recommended:</p>
<ul>
2011-08-29 21:13:33 +00:00
<li><code>hjkl</code> (highly recommended but not mandatory) → basic cursor move (&larr;&darr;&uarr;→). Hint: <code>j</code> look like a down arrow.</li>
2011-08-30 06:07:50 +00:00
<li><code>:help &lt;command&gt;</code> → Show help about <code>&lt;command&gt;</code>, you can start using <code>:help</code> without anything else.</li>
2011-08-26 13:48:47 +00:00
</ul>
</blockquote>
<p>Only 5 commands. This is very few to start.
Once these command start to become natural (may be after a complete day), you should go on level 2.</p>
2011-08-29 13:14:17 +00:00
<p>But before, just a little remark on <em>Normal mode</em>.
2011-08-26 14:32:49 +00:00
In standard editors, to copy you have to use the <code>Ctrl</code> key (<code>Ctrl-c</code> generally).
2011-08-26 13:48:47 +00:00
In fact, when you press <code>Ctrl</code>, it is a bit like if all your key change meaning.
2011-08-29 13:14:17 +00:00
With vim in Normal mode, it is a bit like if your <code>Ctrl</code> key is always pushed down.</p>
2011-08-26 13:48:47 +00:00
2011-08-29 21:13:33 +00:00
<p>A last word about notations: </p>
<ul>
<li>instead of writing <code>Ctrl-λ</code>, I&rsquo;ll write <code>&lt;C-λ&gt;</code>.</li>
<li>command staring by <code>:</code> will must end by <code>&lt;enter&gt;</code>. For example, when I write <code>:q</code> it means <code>:q&lt;enter&gt;</code>.</li>
</ul>
2011-08-26 13:48:47 +00:00
<h2 id="nd-level----feel-comfortable">2<sup>nd</sup> Level &ndash; Feel comfortable</h2>
2011-08-29 13:31:54 +00:00
<p>You know the commands required for survival.
It&rsquo;s time to learn a few more commands.
2011-08-26 13:48:47 +00:00
I suggest:</p>
<ol>
<li>
2011-08-29 13:14:17 +00:00
<p>Insert mode variations:</p>
2011-08-26 13:48:47 +00:00
<blockquote>
<ul>
2011-08-26 14:39:45 +00:00
<li><code>a</code> → insert after the cursor</li>
2011-08-26 13:48:47 +00:00
<li><code>o</code> → insert a new line after the current one</li>
<li><code>O</code> → insert a new line before the current one</li>
2011-08-29 13:14:17 +00:00
<li><code>cw</code> → replace from the cursor to the end the word</li>
2011-08-26 13:48:47 +00:00
</ul>
</blockquote>
</li>
<li>
<p>Basic moves</p>
<blockquote>
<ul>
<li><code>0</code> → go to first column</li>
2011-08-29 14:35:13 +00:00
<li><code>^</code> → go to first non-blank character of the line</li>
2011-08-26 13:48:47 +00:00
<li><code>$</code> → go to the end of line</li>
2011-08-29 14:35:13 +00:00
<li><code>g_</code> → go to the last non-blank character of line</li>
2011-08-26 13:48:47 +00:00
<li><code>/pattern</code> → search for <code>pattern</code> </li>
</ul>
</blockquote>
</li>
<li>
<p>Copy/Paste</p>
<blockquote>
<ul>
2011-08-29 11:39:13 +00:00
<li><code>P</code> → paste before, remember <code>p</code> is paste after current position.</li>
2011-08-26 13:48:47 +00:00
<li><code>yy</code> → copy current line, easier but equivalent to <code>ddP</code></li>
</ul>
</blockquote>
</li>
<li>
<p>Undo/Redo</p>
2011-08-29 12:03:03 +00:00
<blockquote>
<ul>
<li><code>u</code> → undo</li>
2011-08-29 13:08:11 +00:00
<li><code>&lt;C-r&gt;</code> → redo</li>
2011-08-29 12:03:03 +00:00
</ul>
</blockquote>
</li>
<li>
<p>Load/Save/Quit/Change File (Buffer)</p>
2011-08-26 13:48:47 +00:00
2011-08-29 12:03:03 +00:00
<blockquote>
<ul>
<li><code>:e &lt;path/to/file&gt;</code> → open</li>
<li><code>:w</code> → save</li>
<li><code>:saveas &lt;path/to/file&gt;</code> → save to <code>&lt;path/to/file&gt;</code></li>
2011-08-31 08:55:25 +00:00
<li><code>:x</code>, <code>ZZ</code> or <code>:wq</code> → save and quit (<code>:x</code> only save if necessary)</li>
2011-08-29 12:03:03 +00:00
<li><code>:q!</code> → quit without saving, also <code>:qa!</code> to even if there are some modified hidden buffers.</li>
<li><code>:bn</code> (resp. <code>:bp</code>) → show next (resp. previous) file (buffer)</li>
</ul>
</blockquote>
</li>
2011-08-26 13:48:47 +00:00
</ol>
<p>Take the time to integrate all of these command.
Once done, you should be able to do every thing you are able to do on other editors.
But until now, it is a bit awkward. But follow me to the next level and you&rsquo;ll see why.</p>
<h2 id="rd-level----better-stronger-faster">3<sup>rd</sup> Level &ndash; Better. Stronger. Faster.</h2>
2011-08-29 13:31:54 +00:00
<p>Congratulation reaching this far!
We can start the interesting stuff.
2011-08-26 13:48:47 +00:00
At level 3, we&rsquo;ll only talk about command which are compatible with the old vi.</p>
<h3 id="better">Better</h3>
2011-08-30 06:07:50 +00:00
<p>Let&rsquo;s look at how vim could help you to repeat yourself: </p>
2011-08-26 13:48:47 +00:00
<ol>
<li><code>.</code> → (dot) will repeat the last command,</li>
<li>N&lt;command&gt; → will do the command N times.</li>
</ol>
<p>Some examples, open a file and type:</p>
<blockquote>
<ul>
<li><code>2dd</code> → will delete 2 lines</li>
<li><code>3p</code> → will paste the text 3 times</li>
<li><code>100idesu [ESC]</code> → will write &ldquo;desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu &ldquo;</li>
<li><code>.</code> → Just after the last command will write again the 100 &ldquo;desu &ldquo;. </li>
<li><code>3.</code> → Will write 3 &ldquo;desu&rdquo; (and not 300, how clever).</li>
</ul>
</blockquote>
<h3 id="stronger">Stronger</h3>
<p>Knowing how to move efficiently with vim is <em>very</em> important.
Don&rsquo;t skip this section.</p>
<ol>
<li>N<code>G</code> → Go to line N</li>
<li><code>gg</code> → shortcut for <code>1G</code>, go to the start of the file</li>
<li><code>G</code> → Go to last line</li>
<li>
<p>Word moves:</p>
<blockquote>
<ol>
<li><code>w</code> → go to the start of the following word,</li>
<li><code>e</code> → go to the end of this word.</li>
</ol>
<p>By default, word are composed of letter and the underscore character.
2011-08-29 21:13:33 +00:00
Let&rsquo;s call a WORD a group of letter separated by blank characters.
If you want to consider WORDS, then just use uppercases:</p>
2011-08-26 13:48:47 +00:00
<ol>
2011-08-29 21:13:33 +00:00
<li><code>W</code> → go to the start of the following WORD,</li>
<li><code>E</code> → go to the end of this WORD.</li>
2011-08-26 13:48:47 +00:00
</ol>
<p><img alt="Word moves example" src="/Scratch/img/blog/Learn-Vim-Progressively/word_moves.jpg" /></p>
</blockquote>
</li>
</ol>
2011-08-29 14:35:13 +00:00
<p>Now let&rsquo;s talk about very efficient moves:</p>
2011-08-26 13:48:47 +00:00
<blockquote>
<ul>
<li><code>%</code>&nbsp;: Go to corresponding <code>(</code>, <code>{</code>, <code>[</code>.</li>
<li><code>*</code> (resp. <code>#</code>)&nbsp;: go to next (resp. previous) occurrence of the word under the cursor</li>
</ul>
</blockquote>
2011-08-29 13:31:54 +00:00
<p>Believe me, the last three commands are gold.</p>
2011-08-26 13:48:47 +00:00
<h3 id="faster">Faster</h3>
<p>Remember about the importance of vi moves?
Here is the reason.
Most commands can be used using the following general format:</p>
<p><code>&lt;start position&gt;&lt;command&gt;&lt;end position&gt;</code></p>
<p>For example&nbsp;: <code>0y$</code> means</p>
<ul>
<li><code>0</code> → go to the beginning of this line</li>
<li><code>y</code> → yank from here</li>
<li><code>$</code> → up to the end of this line</li>
</ul>
2011-08-29 13:08:11 +00:00
<p>We also can do things like <code>ye</code>, yank from here to the end of the word.
2011-08-26 13:48:47 +00:00
But also <code>y2/foo</code> yank up to the second occurrence of &ldquo;foo&rdquo;.</p>
<p>But what was true for <code>y</code> (yank),
is also true for <code>d</code> (delete), <code>v</code> (visual select), <code>gU</code> (uppercase), <code>gu</code> (lowercase), etc&hellip;</p>
<h2 id="th-level----vim-superpowers">4th Level &ndash; Vim Superpowers</h2>
<p>With all preceding commands you should be comfortable to use vim.
But now, here are the killer features.
Some of these features were the reason I started to use vim.</p>
2011-09-08 15:49:59 +00:00
<h3 id="move-on-current-line-0---g-f-f-t-t--">Move on current line: <code>0</code> <code>^</code> <code>$</code> <code>g_</code> <code>f</code> <code>F</code> <code>t</code> <code>T</code> <code>,</code> <code>;</code></h3>
2011-08-26 13:48:47 +00:00
<blockquote>
<ul>
<li><code>0</code> → go to column 0</li>
<li><code>^</code> → go to first character on the line</li>
2011-09-08 15:45:10 +00:00
<li><code>$</code> → go to the last column</li>
<li><code>g_</code> → go to the last character on the line</li>
2011-08-26 13:48:47 +00:00
<li><code>fa</code> → go to next occurrence of the letter <code>a</code> on the line. <code>,</code> (resp. <code>;</code>) will seek for the next (resp. previous) occurrence.</li>
2011-08-29 12:31:23 +00:00
<li><code>t,</code> → go just before the character <code>,</code>.</li>
2011-08-26 13:48:47 +00:00
<li><code>3fa</code> → search the 3<sup>rd</sup> occurrence of <code>a</code> on this line.</li>
<li><code>F</code> and <code>T</code> → like <code>f</code> and <code>t</code> but backward.
<img alt="Line moves" src="/Scratch/img/blog/Learn-Vim-Progressively/line_moves.jpg" /></li>
</ul>
</blockquote>
2011-08-29 21:13:33 +00:00
<p>A useful tip is: <code>dt"</code> → remove everything until the <code>"</code>.</p>
<h3 id="zone-selection-actionaobject-or-actioniobject">Zone selection <code>&lt;action&gt;a&lt;object&gt;</code> or <code>&lt;action&gt;i&lt;object&gt;</code></h3>
<p>These command can only be used after an operator of in visual mode.
But they are very powerful. Their main pattern is:</p>
<p><code>&lt;action&gt;a&lt;object&gt;</code> and <code>&lt;action&gt;i&lt;object&gt;</code></p>
<p>Where action can be any action, for example, <code>d</code> (delete), <code>y</code> (yank), <code>v</code> (select in visual mode).
And object can be: <code>w</code> a word, <code>W</code> a WORD (extended word), <code>s</code> a sentence, <code>p</code> a paragraph. But also, natural character such as <code>"</code>, <code>'</code>, <code>)</code>, <code>}</code>, <code>]</code>.</p>
<p>Suppose the cursor is on the first <code>o</code> of <code>(map (+) ("foo"))</code>.</p>
2011-08-26 13:48:47 +00:00
<blockquote>
<ul>
2011-08-29 21:13:33 +00:00
<li><code>vi"</code> → will select <code>foo</code>.</li>
<li><code>va"</code> → will select <code>"foo"</code>.</li>
<li><code>vi)</code> → will select <code>"foo"</code>.</li>
<li><code>va)</code> → will select <code>("foo")</code>.</li>
<li><code>v2i)</code> → will select <code>map (+) ("foo")</code></li>
<li><code>v2a)</code> → will select <code>(map (+) ("foo"))</code></li>
2011-08-26 13:48:47 +00:00
</ul>
</blockquote>
2011-08-29 21:13:33 +00:00
<p><img alt="Text objects selection" src="/Scratch/img/blog/Learn-Vim-Progressively/textobjects.png" /></p>
2011-08-29 14:35:13 +00:00
<h3 id="select-rectangular-blocks-c-v">Select rectangular blocks: <code>&lt;C-v&gt;</code>.</h3>
2011-08-26 13:48:47 +00:00
<p>Rectangular blocks are very useful to comment many lines of code.
2011-08-29 14:35:13 +00:00
Typically: <code>0&lt;C-v&gt;&lt;C-d&gt;I-- [ESC]</code></p>
2011-08-26 13:48:47 +00:00
<ul>
<li><code>^</code> → go to start of the line</li>
2011-08-29 13:41:15 +00:00
<li><code>&lt;C-v&gt;</code> → Start block selection</li>
2011-08-29 13:08:11 +00:00
<li><code>&lt;C-d&gt;</code> → move down (could also be <code>jjj</code> or <code>%</code>, etc&hellip;)</li>
2011-08-29 14:35:13 +00:00
<li><code>I-- [ESC]</code> → write <code>-- </code> to comment each line</li>
2011-08-26 13:48:47 +00:00
</ul>
<p><img alt="Rectangular blocks" src="/Scratch/img/blog/Learn-Vim-Progressively/rectangular-blocks.gif" /></p>
2011-09-08 15:45:10 +00:00
<p>Note on windows you might have to use <code>&lt;C-q&gt;</code> instead of <code>&lt;C-v&gt;</code> if your clipboard is not empty.</p>
2011-08-29 13:41:15 +00:00
2011-08-29 13:08:11 +00:00
<h3 id="completion-c-n-and-c-p">Completion: <code>&lt;C-n&gt;</code> and <code>&lt;C-p&gt;</code>.</h3>
2011-08-26 13:48:47 +00:00
2011-08-29 13:08:11 +00:00
<p>In Insert mode, just type the start of a word, then type <code>&lt;C-p&gt;</code>, magic&hellip;
2011-08-26 13:48:47 +00:00
<img alt="Completion" src="/Scratch/img/blog/Learn-Vim-Progressively/completion.gif" /> </p>
<h3 id="macros--qa-do-something-q-a-">Macros&nbsp;: <code>qa</code> do something <code>q</code>, <code>@a</code>, <code>@@</code></h3>
<p><code>qa</code> record your actions in the <em>register</em> <code>a</code>.
Then <code>@a</code> will replay the macro saved into the register <code>a</code> as if you typed it.
<code>@@</code> is a shortcut to replay the last executed macro.</p>
<blockquote>
<p><em>Example</em></p>
<p>On a line containing only the number 1, type this:</p>
<ul>
<li>
2011-08-29 13:08:11 +00:00
<p><code>qaYp&lt;C-a&gt;q</code></p>
2011-08-26 13:48:47 +00:00
<ul>
<li><code>qa</code> start recording. </li>
<li><code>Yp</code> duplicate this line.</li>
2011-08-29 13:08:11 +00:00
<li><code>&lt;C-a&gt;</code> increment the number.</li>
2011-08-26 13:48:47 +00:00
<li><code>q</code> stop recording.</li>
</ul>
</li>
<li><code>@a</code> → write 2 under the 1</li>
<li><code>@@</code> → write 3 under the 2</li>
<li>Now do <code>100@@</code> will create a list of increasing numbers until 103.</li>
</ul>
</blockquote>
<p><img alt="Macros" src="/Scratch/img/blog/Learn-Vim-Progressively/macros.gif" /></p>
2011-08-29 13:08:11 +00:00
<h3 id="visual-selection-vvc-v">Visual selection: <code>v</code>,<code>V</code>,<code>&lt;C-v&gt;</code></h3>
2011-08-26 13:48:47 +00:00
2011-08-29 13:41:15 +00:00
<p>We saw an example with <code>&lt;C-v&gt;</code>.
2011-08-26 13:48:47 +00:00
There is also <code>v</code> and <code>V</code>.
Once the selection made, you can:</p>
<ul>
<li><code>J</code> → join all lines together.</li>
<li><code>&lt;</code> (resp. <code>&gt;</code>) → indent to the left (resp. to the right).</li>
<li><code>=</code> → auto indent</li>
</ul>
<p><img alt="Autoindent" src="/Scratch/img/blog/Learn-Vim-Progressively/autoindent.gif" /></p>
2011-08-29 13:31:54 +00:00
<p>Add something at the end of all visually selected lines:</p>
2011-08-26 13:48:47 +00:00
<ul>
2011-08-29 13:08:11 +00:00
<li><code>&lt;C-v&gt;</code> </li>
<li>go to desired line (<code>jjj</code> or <code>&lt;C-d&gt;</code> or <code>/pattern</code> or <code>%</code> etc&hellip;)</li>
2011-08-26 13:48:47 +00:00
<li><code>$</code> go to the end of line</li>
2011-08-29 13:31:54 +00:00
<li><code>A</code>, write text, <code>ESC</code>.</li>
2011-08-26 13:48:47 +00:00
</ul>
<p><img alt="Append to many lines" src="/Scratch/img/blog/Learn-Vim-Progressively/append-to-many-lines.gif" /></p>
2011-08-26 14:39:45 +00:00
<h3 id="splits-split-and-vsplit">Splits: <code>:split</code> and <code>vsplit</code>.</h3>
2011-08-26 13:48:47 +00:00
<p>Here are the main commands, but you should look at <code>:help split</code>.</p>
<blockquote>
<ul>
<li><code>:split</code> → create a split (<code>:vsplit</code> create a vertical split)</li>
2011-08-29 13:08:11 +00:00
<li><code>&lt;C-w&gt;&lt;dir&gt;</code>&nbsp;: where dir is any of <code>hjkl</code> or &larr;&darr;&uarr;→ to change split.</li>
<li><code>&lt;C-w&gt;_</code> (resp. <code>&lt;C-w&gt;|</code>)&nbsp;: maximise size of split (resp. vertical split)</li>
<li><code>&lt;C-w&gt;+</code> (resp. <code>&lt;C-w&gt;-</code>)&nbsp;: Grow (resp. shrink) split</li>
2011-08-26 13:48:47 +00:00
</ul>
</blockquote>
<p><img alt="Split" src="/Scratch/img/blog/Learn-Vim-Progressively/split.gif" /></p>
<h2 id="conclusion">Conclusion</h2>
<p>That was 90% of commands I use every day.
I suggest you to learn no more than one or two new command per day.
After two to three weeks you&rsquo;ll start to feel the power of vim in your hands.</p>
2011-08-29 21:13:33 +00:00
<p>Learning Vim is more a matter of training than plain memorization.
Fortunately vim comes with some very good tools and an excellent documentation.
Run vimtutor until you are familiar with most basic commands.
Also, you should read carefully this page: <code>:help usr_02.txt</code>.</p>
2011-08-26 14:39:45 +00:00
<p>Then, you will learn about <code>!</code>, folds, registers, the plugins and many other features.
Learn vim like you&rsquo;d learn piano and all should be fine.</p>
2011-08-26 13:48:47 +00:00
<script>
// Style the keywords
$(document).ready(function() {
$('code').css({ 'border': 'solid 1px #CCC', 'padding':'3px'});
});
</script>
</div>
<div id="choixrss">
<a id="rss" href="http://feeds.feedburner.com/yannespositocomen">
Subscribe
</a>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#comment').hide();
$('#clickcomment').click(showComments);
});
function showComments() {
$('#comment').show();
$('#clickcomment').fadeOut();
}
document.write('<div id="clickcomment">Comments</div>');
</script>
<div class="flush"></div>
<div class="corps" id="comment">
<h2 class="first">comments</h2>
<noscript>
You must enable javascript to comment.
</noscript>
<script type="text/javascript">
var idcomments_acct = 'a307f0044511ff1b5cfca573fc0a52e7';
var idcomments_post_id = '/Scratch/en/blog/Learn-Vim-Progressively/';
var idcomments_post_url = 'http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/';
</script>
<span id="IDCommentsPostTitle" style="display:none"></span>
<script type='text/javascript' src='/Scratch/js/genericCommentWrapperV2.js'></script>
</div>
<div id="entete" class="corps_spaced">
<div id="liens">
<ul><li><a href="/Scratch/en/">Home</a></li>
<li><a href="/Scratch/en/blog/">Blog</a></li>
<li><a href="/Scratch/en/softwares/">Softwares</a></li>
<li><a href="/Scratch/en/about/">About</a></li></ul>
</div>
<div class="flush"></div>
<hr/>
<div id="next_before_articles">
<div id="previous_articles">
previous entries
2011-08-26 14:42:13 +00:00
<div class="previous_article">
2011-09-27 15:11:40 +00:00
<a href="/Scratch/en/blog/Password-Management/"><span class="nicer">«</span>&nbsp;40 character's passwords</a>
2011-08-26 14:42:13 +00:00
</div>
2011-08-26 13:48:47 +00:00
2011-08-26 14:42:13 +00:00
2011-08-26 13:48:47 +00:00
</div>
<div id="next_articles">
next entries
2011-09-06 06:59:30 +00:00
<div class="next_article">
2011-09-28 15:47:13 +00:00
<a href="/Scratch/en/blog/programming-language-experience/">Programming Language Experience&nbsp;<span class="nicer">»</span></a>
2011-09-06 06:59:30 +00:00
</div>
2011-08-26 13:48:47 +00:00
2011-09-27 15:11:40 +00:00
<div class="next_article">
2011-09-28 15:47:13 +00:00
<a href="/Scratch/en/blog/Higher-order-function-in-zsh/">Higher order function in zsh&nbsp;<span class="nicer">»</span></a>
2011-09-27 15:11:40 +00:00
</div>
2011-08-26 13:48:47 +00:00
</div>
<div class="flush"></div>
</div>
</div>
<div id="bottom">
<div>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Copyright ©, Yann Esposito</a>
</div>
<div id="lastmod">
Created: 08/25/2011
2011-09-08 15:47:09 +00:00
Modified: 09/08/2011
2011-08-26 13:48:47 +00:00
</div>
<div>
Entirely done with
<a href="http://www.vim.org">Vim</a>
and
<a href="http://nanoc.stoneship.org">nanoc</a>
</div>
<div>
<a href="/Scratch/en/validation/">Validation</a>
<a href="http://validator.w3.org/check?uri=referer"> [xhtml] </a>
.
<a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3"> [css] </a>
.
<a href="http://validator.w3.org/feed/check.cgi?url=http%3A//yannesposito.com/Scratch/en/blog/feed/feed.xml">[rss]</a>
</div>
</div>
<div class="clear"></div>
</div>
<script type="text/javascript">
var clicky = { log: function(){ return; }, goal: function(){ return; }};
var clicky_site_id = 66374971;
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = ( document.location.protocol == 'https:' ? 'https://static.getclicky.com/js' : 'http://static.getclicky.com/js' );
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="http://in.getclicky.com/66374971ns.gif" /></p></noscript>
</body>
</html>