Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

tomhukins (4457)

tomhukins
  (email not shown publicly)

Perl, Web, Database developer, and Milton Keynes Perl Monger [pm.org].

Journal of tomhukins (4457)

Thursday July 01, 2010
03:05 AM

Test counts and vim

[ #40425 ]

My current favourite vim trick when writing tests in Perl is CTRL-A.

My tests contain a line near the top that looks like use Test::More tests => 12 where my test suite has 12 tests. I move my cursor over the number 12 and type mc which sets a mark labelled "c" for test count.

Then, if I write 5 new tests, I type `c (backtick c) to jump to my test count, then 5 CTRL-A to increment my test count by 5. Finally, `` (2 backticks) takes me back to where I was last editing.

If I remove tests, I use CTRL-V instead of CTRL-A to decrement the test count.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I did not know about CTRL-A, so thanks for the tip. BTW on my gvim, I need CTRL-x to decrement.
    --
    mirod
    • Yes, I use CTRL-X too, but I got confused when writing this. I guess touch typing has some disadvantages..

  • Thanks for this tip. I knew about CTRL-A, but the `` (2 backticks) were new to me.
    --
    /* Bernhard.Schmalhofer@gmx.de */