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

Re: Preserving buffers

Expand Messages
  • Antoine J. Mechelynck
    ... [...] Registers are saved in the viminfo file. See ... HTH, Tony.
    Message 1 of 7 , Nov 30, 2004
    • 0 Attachment
      On 30/11/2004 20:58, José Alves de Castro wrote:
      > On Ter, Nov 30, 2004 at 08:30:22 +0100, Joe Koenig wrote:
      >
      >>José Alves de Castro wrote:
      >>
      >>
      >>>I noticed that if I set a buffer (with q), I can exit vim, get in
      >>>again, and the buffer is still defined.
      >>
      >>[...]
      >>
      >>>2) How can I define a buffer in .vimrc?
      >>
      >>Sorry, but what does "set a buffer" (with "q"?) resp. "define a
      >
      >
      > Oops... wrong word, sorry :-| I believe the correct one is "register", but now
      > I'm not so sure...
      >
      > I type something like "qq" (without the quotes) to start "recording" it, type
      > "q" again to stop, and then I can use something like "@q" to reuse the...
      > register? :-|
      >
      > Sorry for the confusion :-) I hope I got it right this time :-)
      [...]

      Registers are saved in the viminfo file.

      See
      :help 'viminfo'
      :help viminfo-file

      HTH,
      Tony.
    • Mathias Michaelis
      Hi * ... Uups -- not so fast! With qq you start _not_ a register, but a keyboard makro. You end the recording of the makro by pressing a single q again. With
      Message 2 of 7 , Dec 1, 2004
      • 0 Attachment
        Hi *

        > Ah, OK, that makes sense ;-)
        > Yeah, well, "register" is already the right keyword. Just do
        >
        > :registers
        >
        > and you'll see all the registers, currently occupied. So
        >
        > "q
        >
        > would be the register used by "qq".
        >
        Uups -- not so fast! With qq you start _not_ a register, but a
        keyboard makro. You end the recording of the makro by pressing a
        single q again.

        With "qy<motion> you "yank" some text in the register q.

        With :registers you don't see the makro, but the text you yanked
        with "qy<motion>. However, the makro still exists, as @q prooves.

        Regards,
        Mathias
      • Antoine J. Mechelynck
        ... Not so fast, Mathias. With qq you start a keyboard macro which is stored in register q ( qa would store it in register a , qQ would append it to the
        Message 3 of 7 , Dec 1, 2004
        • 0 Attachment
          On 1/12/2004 11:58, Mathias Michaelis wrote:
          > Hi *
          >
          >
          >>Ah, OK, that makes sense ;-)
          >>Yeah, well, "register" is already the right keyword. Just do
          >>
          >> :registers
          >>
          >>and you'll see all the registers, currently occupied. So
          >>
          >> "q
          >>
          >>would be the register used by "qq".
          >>
          >
          > Uups -- not so fast! With qq you start _not_ a register, but a
          > keyboard makro. You end the recording of the makro by pressing a
          > single q again.
          >
          > With "qy<motion> you "yank" some text in the register q.
          >
          > With :registers you don't see the makro, but the text you yanked
          > with "qy<motion>. However, the makro still exists, as @q prooves.
          >
          > Regards,
          > Mathias
          >
          >
          >

          Not so fast, Mathias.

          With qq you start a keyboard macro which is stored in register q ( qa
          would store it in register a , qQ would append it to the existing
          contents of register q , etc.); ":registers" or ":echo @q" will then
          show your keyboard macro as the contents of register q ; and "qp will
          "put" that contents without interpretation.

          If, after starting a keyboard macro with qq and ending it with q , you
          yank something into register q with "qy<motion> , it replaces your
          keyboard macro with the yanked text.

          see
          :help q

          Regards,
          Tony.
        • Mathias Michaelis
          Hi Tony ... Indeed, I was too fast. Thanks for your adjustment. Mathias
          Message 4 of 7 , Dec 1, 2004
          • 0 Attachment
            Hi Tony

            > Not so fast, Mathias.
            >
            Indeed, I was too fast.
            Thanks for your adjustment.
            Mathias
          Your message has been successfully submitted and would be delivered to recipients shortly.