Living on the Edge

Vim Macros Screencast

Posted on August 22, 2008

My good friend Justin Lilly just posted a great short screencast on using Vim macros. In the screencast he walks you through using the Vim macro commands to record and play back key sequences. Justin, several other friends, and I have been helping each other get the most out of MacVim. I highly recommend you take one minute and give it a viewing.

Since I forgot to blog about it earlier he has also created a excellent post on his Vim setup called Vim: My new IDE. If you’re into Vim or want to get going on it, this post contains an awesome collection of stuff that Justin has found useful.

Comments
  1. David ZhouAugust 22, 2008 @ 11:44 PM

    I’ve been using MacVim for a while now. Textmate was great, but I’ve been trying to get comfortable with an editor I can use across a range of platforms.

    One thing I missed with MacVim was the ability to move between tabs via the Command key—i.e., Command-2 to move to the second tab.

    With a little help with the MacVim mailing list a while back, the following in .gvimrc performed admirably:

    map <d-1> :tabn 1<cr> map <d-2> :tabn 2<cr> map <d-3> :tabn 3<cr> map <d-4> :tabn 4<cr> map <d-5> :tabn 5<cr> map <d-6> :tabn 6<cr> map <d-7> :tabn 7<cr> map <d-8> :tabn 8<cr> map <d-9> :tabn 9<cr>

    map! <d-1> <c-o>:tabn 1<cr> map! <d-2> <c-o>:tabn 2<cr> map! <d-3> <c-o>:tabn 3<cr> map! <d-4> <c-o>:tabn 4<cr> map! <d-5> <c-o>:tabn 5<cr> map! <d-6> <c-o>:tabn 6<cr> map! <d-7> <c-o>:tabn 7<cr> map! <d-8> <c-o>:tabn 8<cr> map! <d-9> <c-o>:tabn 9<cr>

  2. David ZhouAugust 22, 2008 @ 11:46 PM

    I think formatting got messed up :( It should’ve been

    map &lt;D-1&gt; :tabn 1&lt;CR&gt;
    map &lt;D-2&gt; :tabn 2&lt;CR&gt;
    map &lt;D-3&gt; :tabn 3&lt;CR&gt;
    map &lt;D-4&gt; :tabn 4&lt;CR&gt;
    map &lt;D-5&gt; :tabn 5&lt;CR&gt;
    map &lt;D-6&gt; :tabn 6&lt;CR&gt;
    map &lt;D-7&gt; :tabn 7&lt;CR&gt;
    map &lt;D-8&gt; :tabn 8&lt;CR&gt;
    map &lt;D-9&gt; :tabn 9&lt;CR&gt;
    
    map! &lt;D-1&gt; &lt;C-O&gt;:tabn 1&lt;CR&gt;
    map! &lt;D-2&gt; &lt;C-O&gt;:tabn 2&lt;CR&gt;
    map! &lt;D-3&gt; &lt;C-O&gt;:tabn 3&lt;CR&gt;
    map! &lt;D-4&gt; &lt;C-O&gt;:tabn 4&lt;CR&gt;
    map! &lt;D-5&gt; &lt;C-O&gt;:tabn 5&lt;CR&gt;
    map! &lt;D-6&gt; &lt;C-O&gt;:tabn 6&lt;CR&gt;
    map! &lt;D-7&gt; &lt;C-O&gt;:tabn 7&lt;CR&gt;
    map! &lt;D-8&gt; &lt;C-O&gt;:tabn 8&lt;CR&gt;
    map! &lt;D-9&gt; &lt;C-O&gt;:tabn 9&lt;CR&gt;