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

Re: Problem with interpretation of "!!"

Expand Messages
  • Jürgen Krämer
    Hi, ... typing !! immediately after the colon repeats the last external command (see :help :!! ). Your use case is covered by :help :! , which starts wit ...
    Message 1 of 12 , Oct 28, 2011
    • 0 Attachment
      Hi,

      Axel wrote:
      >
      > I typed the "!!" not right after the colon (where the repetition would
      > make sense - if we compare this with bash's behaviour) but in the
      > middle of a command line - which starts with "!start" in this case.
      > Here only two successive "!"s were entered (no colon before the
      > first).
      >
      > I'd consider this - at least - unwanted behavior.

      typing !! immediately after the colon repeats the last external command
      (see ":help :!!"). Your use case is covered by ":help :!", which starts
      wit

      | Execute {cmd} with the shell. See also the 'shell'
      | and 'shelltype' option.
      | Any '!' in {cmd} is replaced with the previous
      | external command (see also 'cpoptions'). But not when
      | there is a backslash before the '!', then that
      | backslash is removed. Example: ":!ls" followed by
      | ":!echo ! \! \\!" executes "echo ls ! \!".

      According to this, the last line in

      :!start
      :!start !!

      should be expanded to

      :!start startstart

      And so it does for me. But I cannot reproduce the result you intially
      provided. Can you tell us the commands you actually used?

      Regards,
      Jürgen

      --
      Sometimes I think the surest sign that intelligent life exists elsewhere
      in the universe is that none of it has tried to contact us. (Calvin)

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Axel
      @Jürgen, Tony thanks for the answers. Seems I read over the second line of Jürgen s quote in the docs (though having been pointed to it by Tony). Obviously
      Message 2 of 12 , Oct 28, 2011
      • 0 Attachment
        @Jürgen, Tony

        thanks for the answers. Seems I read over the second line of Jürgen's quote in the docs (though having been pointed to it by Tony).
        Obviously the exposed behavior goes with the specs (and is also consistent with bash's behavior...).

        Sorry for the noise.

        Axel

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.