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

...to shoot into oneelse feet...

Expand Messages
  • meino.cramer@gmx.de
    Hi, is it possible to get out of a started change command (dont know, whether this is this the correct naming...) with a single key pressed ? For example the
    Message 1 of 4 , Apr 30, 2007
    • 0 Attachment
      Hi,

      is it possible to get out of a started
      "change command" (dont know, whether this
      is this the correct naming...) with a single
      key pressed ?

      For example the text is

      Vim is a #eally$nice editor.


      "#" is marking my cursor position and "$"
      is the sign appearing after I have submitted
      "cfn" already.

      Since vim is really a nice editor, I do not
      want to change anything and pressed "cfn" by
      accident.

      Hmmm....<ESC> kills everything between "#" and "$"...
      "u" would undo it...but this like "do the wrong thing
      and repair it afterwards".

      What I want is to prevent doing wrong things by aborting
      them,..not to do them and saying "ooops sorry...my fault"
      afterwards and starting repairing the desaster then... :)

      So....how can I _abort_ this ?

      Keep editing!
      mcc






      --
      Please don't send me any Word- or Powerpoint-Attachments
      unless it's absolutely neccessary. - Send simply Text.
      See http://www.gnu.org/philosophy/no-word-attachments.html
      In a world without fences and walls nobody needs gates and windows.
    • russ@windofkeltia.com
      ... Just press ESC followed by u to undo. Or, press ESC follwed by :q! to get out completely.
      Message 2 of 4 , Apr 30, 2007
      • 0 Attachment
        > -------- Original Message --------
        > Subject: ...to shoot into oneelse feet...
        > From: meino.cramer@...
        > Date: Mon, April 30, 2007 11:36 am
        > To: vim <vim@...>
        >
        > Hi,
        >
        > is it possible to get out of a started
        > "change command" (dont know, whether this
        > is this the correct naming...) with a single
        > key pressed ?
        >
        > For example the text is
        >
        > Vim is a #eally$nice editor.
        >
        >
        > "#" is marking my cursor position and "$"
        > is the sign appearing after I have submitted
        > "cfn" already.
        >
        > Since vim is really a nice editor, I do not
        > want to change anything and pressed "cfn" by
        > accident.
        >
        > Hmmm....<ESC> kills everything between "#" and "$"...
        > "u" would undo it...but this like "do the wrong thing
        > and repair it afterwards".
        >
        > What I want is to prevent doing wrong things by aborting
        > them,..not to do them and saying "ooops sorry...my fault"
        > afterwards and starting repairing the desaster then... :)
        >
        > So....how can I _abort_ this ?

        Just press ESC followed by u to undo. Or, press ESC follwed by :q! to
        get out completely.
      • Peter Palm
        ... As far as I know, you can t abort it. But as you dont use the black hole register, you could just re-insert the text you wanted to change by typing:
        Message 3 of 4 , May 1, 2007
        • 0 Attachment
          Op maandag 30 april 2007, schreef meino.cramer@...:
          > Hmmm....<ESC> kills everything between "#" and "$"...
          > "u" would undo it...but this like "do the wrong thing
          > and repair it afterwards".
          >
          > What I want is to prevent doing wrong things by aborting
          > them,..not to do them and saying "ooops sorry...my fault"
          > afterwards and starting repairing the desaster then... :)
          >
          > So....how can I _abort_ this ?

          As far as I know, you can't abort it. But as you dont use the 'black
          hole' register, you could just re-insert the text you wanted to change
          by typing:
          <Ctrl-R>"

          Not the best solution, probably (don't type cfn if you don't want to
          change the text :) )


          Peter
        • A.J.Mechelynck
          ... In my version of Vim, as soon as you hit cfn the text is deleted and Vim is in Insert mode, awaiting the replacement text. So it s too late to abort, the
          Message 4 of 4 , May 1, 2007
          • 0 Attachment
            meino.cramer@... wrote:
            > Hi,
            >
            > is it possible to get out of a started
            > "change command" (dont know, whether this
            > is this the correct naming...) with a single
            > key pressed ?
            >
            > For example the text is
            >
            > Vim is a #eally$nice editor.
            >
            >
            > "#" is marking my cursor position and "$"
            > is the sign appearing after I have submitted
            > "cfn" already.
            >
            > Since vim is really a nice editor, I do not
            > want to change anything and pressed "cfn" by
            > accident.
            >
            > Hmmm....<ESC> kills everything between "#" and "$"...
            > "u" would undo it...but this like "do the wrong thing
            > and repair it afterwards".
            >
            > What I want is to prevent doing wrong things by aborting
            > them,..not to do them and saying "ooops sorry...my fault"
            > afterwards and starting repairing the desaster then... :)
            >
            > So....how can I _abort_ this ?
            >
            > Keep editing!
            > mcc
            >
            >
            >
            >
            >
            >

            In my version of Vim, as soon as you hit cfn the text is deleted and Vim is in
            Insert mode, awaiting the replacement text. So it's too late to abort, the
            best you can do is undo, using either <Esc>u or <C-R>" as the other replies said.


            Best regards,
            Tony.
            --
            Ken Thompson has an automobile which he helped design. Unlike most
            automobiles, it has neither speedometer, nor gas gage, nor any of the
            numerous idiot lights which plague the modern driver. Rather, if the
            driver makes any mistake, a giant "?" lights up in the center of the
            dashboard. "The experienced driver", he says, "will usually know
            what's wrong."
          Your message has been successfully submitted and would be delivered to recipients shortly.