• @JustinAngel
      link
      1411 months ago

      VIM Golf… Same outcome, fewer strokes:

      %d|wq

    • meow
      link
      fedilink
      1211 months ago

      E492: Not an editor command: ggdGwq

    • Ignotum
      link
      1111 months ago

      I use Vim daily, and i have absolutely no clue what that command would do, what would it do? Delete the document, save and quit?

      • @filiberto_kunstlinger
        link
        15
        edit-2
        11 months ago

        exactly.

        gg -> go to top of document

        d -> delete (actually, it’s cut, but it destroys the mnemonic)

        G -> here is a modifier to “d” and tells it do “delete until end of document”

        w -> write current state of buffer to disk

        q -> exit program

        • meow
          link
          fedilink
          1711 months ago

          Actually not, binds and commands aren’t the same. ggdG only works as a series of inputs, while wq only works as a command (with the colon).

          • Victor
            cake
            link
            811 months ago

            Exactly. The colon needs to be just before the w, not at the front of the sequence…

            • CaptainBlagbird
              link
              611 months ago

              And while you’re at it, throw an ESC in there at the beginning, will ya?

              • Victor
                cake
                link
                211 months ago

                If you want to cover every case (mode), indeed. 😊

    • i_am_tired_boss
      link
      111 months ago

      ggdGZZ

      This actually does what you intend to do. On nvim atleast.