Loading ...
Sorry, an error occurred while loading the content.

basic command problems...

Expand Messages
  • at
    Kind of a newbie question here, hope its obvious! I m trying to implement the following: nmap d 80A* 80|D The idea is that it would write a line
    Message 1 of 4 , Jul 1, 2009
    • 0 Attachment
      Kind of a newbie question here, hope its obvious!

      I'm trying to implement the following:
      nmap <Leader>d 80A*<ESC>80|D

      The idea is that it would write a line of * symbols up to column 80 by
      first writing 80 *s, then doing to the 80th column and then deleting
      the rest of the line.

      The D at the end seems to be causing a problem. When I have it in
      there I get "Not an editor command: D" when I load up vim. However, if
      I write the same thing except with no D then things work fine (except
      the next command I issue after <Leader>d will be repeated 80 times it
      seems).

      Any hint on what I'm doing wrong? Thanks!
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Dennis Benzinger
      ... The | is used to separate commands. There are several ways to use the | on the right hand side of the mapping. Read :help map_bar HTH, Dennis Benzinger
      Message 2 of 4 , Jul 1, 2009
      • 0 Attachment
        Am 01.07.2009 17:02, at schrieb:
        > Kind of a newbie question here, hope its obvious!
        >
        > I'm trying to implement the following:
        > nmap <Leader>d 80A*<ESC>80|D
        >
        > The idea is that it would write a line of * symbols up to column 80 by
        > first writing 80 *s, then doing to the 80th column and then deleting
        > the rest of the line.
        >
        > The D at the end seems to be causing a problem. When I have it in
        > there I get "Not an editor command: D" when I load up vim. However, if
        > I write the same thing except with no D then things work fine (except
        > the next command I issue after <Leader>d will be repeated 80 times it
        > seems).
        >
        > Any hint on what I'm doing wrong? Thanks!
        > [...]

        The | is used to separate commands. There are several ways to use the |
        on the right hand side of the mapping. Read :help map_bar


        HTH,
        Dennis Benzinger

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Charles Campbell
        ... nmap d 80A* 80 D A literal | terminates the mapping. Regards, Chip Campbell --~--~---------~--~----~------------~-------~--~----~ You
        Message 3 of 4 , Jul 1, 2009
        • 0 Attachment
          at wrote:
          > Kind of a newbie question here, hope its obvious!
          >
          > I'm trying to implement the following:
          > nmap <Leader>d 80A*<ESC>80|D
          >
          > The idea is that it would write a line of * symbols up to column 80 by
          > first writing 80 *s, then doing to the 80th column and then deleting
          > the rest of the line.
          >
          > The D at the end seems to be causing a problem. When I have it in
          > there I get "Not an editor command: D" when I load up vim. However, if
          > I write the same thing except with no D then things work fine (except
          > the next command I issue after <Leader>d will be repeated 80 times it
          > seems).
          >
          > Any hint on what I'm doing wrong? Thanks!
          >

          nmap <Leader>d 80A*<esc>80<bar>D

          A literal | terminates the mapping.

          Regards,
          Chip Campbell



          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • at
          Got it...Thanks a lot to both! On Jul 1, 11:22 am, Charles Campbell ... --~--~---------~--~----~------------~-------~--~----~
          Message 4 of 4 , Jul 1, 2009
          • 0 Attachment
            Got it...Thanks a lot to both!

            On Jul 1, 11:22 am, Charles Campbell <Charles.E.Campb...@...>
            wrote:
            > at wrote:
            > > Kind of a newbie question here, hope its obvious!
            >
            > > I'm trying to implement the following:
            > >  nmap <Leader>d  80A*<ESC>80|D
            >
            > > The idea is that it would write a line of * symbols up to column 80 by
            > > first writing 80 *s, then doing to the 80th column and then deleting
            > > the rest of the line.
            >
            > > The D at the end seems to be causing a problem. When I have it in
            > > there I get "Not an editor command: D" when I load up vim. However, if
            > > I write the same thing except with no D then things work fine (except
            > > the next command I issue after <Leader>d will be repeated 80 times it
            > > seems).
            >
            > > Any hint on what I'm doing wrong? Thanks!
            >
            > nmap <Leader>d  80A*<esc>80<bar>D
            >
            > A literal | terminates the mapping.
            >
            > Regards,
            > Chip Campbell
            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          Your message has been successfully submitted and would be delivered to recipients shortly.