map not working

Discussion in 'Perl Misc' started by googler, Aug 14, 2007.

  1. googler

    googler Guest

    I am trying to create map for the operation I am going to explain. I
    have some code like this:

    `ifdef FUNCTIONAL
    blah1
    blah2
    blah3
    `else
    blah4
    blah5
    blah6
    `endif

    I want to change it to:

    //`ifdef FUNCTIONAL
    // blah1
    // blah2
    // blah3
    //`else
    blah4
    blah5
    blah6
    //`endif

    I define my map as follows:
    :map v /`ifdef[CTRL-V][ENTER]ma/`else[CTRL-V][ENTER]mb'a:.,'bs/^/\/\//
    [CTRL-V][ENTER]/`endif[CTRL-V][ENTER]I//[CTRL-V][ESC][ENTER]

    the above can be broken down into the following steps:
    (1) /`ifdef[CTRL-V][ENTER] => search for `ifdef
    (2) ma => mark the line as a
    (3) /`else[CTRL-V][ENTER] => search for `else
    (4) mb => mark the line as b
    (5) 'a => go back to line marked as a
    (6) :.,'bs/^/\/\//[CTRL-V][ENTER] => add // at the start of lines
    from a to b
    (7) /`endif[CTRL-V][ENTER] => search for `endif
    (8) I//[CTRL-V][ESC] => add // to the start of this line

    When I try to execute this sequence by placing the cursor just above
    from where the block starts and pressing v, I do not get the desired
    change. Instead it shows the message:
    E488: Trailing characters

    However, if I execute the commands manually one after the other, it
    works fine. Please point out if you can see the error. Thank you.
    googler, Aug 14, 2007
    #1
    1. Advertising

  2. googler

    googler Guest

    On Aug 13, 7:21 pm, googler <> wrote:
    > I am trying to create map for the operation I am going to explain. I
    > have some code like this:
    >


    Extermely sorry.. I posted in the wrong group. My apologies.
    googler, Aug 14, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Duncan Greenhill

    client side image map in NS not working

    Duncan Greenhill, Apr 17, 2005, in forum: HTML
    Replies:
    3
    Views:
    464
    Duncan Greenhill
    Apr 17, 2005
  2. Anton
    Replies:
    0
    Views:
    508
    Anton
    Mar 12, 2007
  3. Replies:
    5
    Views:
    811
    Jukka K. Korpela
    Jun 15, 2007
  4. Kai-Uwe Bux
    Replies:
    1
    Views:
    1,133
    Kai-Uwe Bux
    Dec 21, 2008
  5. Boris Schmid
    Replies:
    8
    Views:
    170
    Erik Veenstra
    Dec 14, 2007
Loading...

Share This Page