• amphetaminisiert
    link
    fedilink
    arrow-up
    25
    ·
    1 month ago

    And I still don’t really know how to use registers in vim 😂 I just use yy and paste 🥲

    • Psaldorn@lemmy.world
      link
      fedilink
      arrow-up
      29
      ·
      edit-2
      1 month ago

      You just do " (listen for next character as register name)

      Then, say q,w,e etc, then yy to yank as normal.

      So "wyy

      To retrieve it you use "wp

      To add to it "Wyy

      To view them :reg

      Remember you can make "w anything, like "x or "p

      And each time you yank it gets pushed into the default register history "0 "1 "2 etc

    • barsquid@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      1 month ago

      I only know how to use them with q. I hope that’s a register, otherwise I will look foolish.

      • suy@programming.dev
        link
        fedilink
        arrow-up
        4
        ·
        1 month ago

        They are. Registers are just “named boxes” where you can store some text and/or keystrokes. When yanking and pasting, the unnamed register is used if you don’t specify a name (you can still see or edit it explicitly). For recording a macro there is no default register, though. You need to give it a name.