• Endmaker
    link
    fedilink
    English
    32
    edit-2
    10 days ago

    Personally, I have seen so many memes about exiting vim that by the time I got to use it for the first time, exiting it was a no-brainer.

    For any newbies out there, the command is

    :wq
    
    • dohpaz42
      link
      fedilink
      English
      14
      edit-2
      10 days ago

      😳

      :w = write; or overwrite if the file already exists.

      Please don’t give blanket destructive advice.

    • @[email protected]
      link
      fedilink
      1410 days ago

      also worth noting you open vim the first time, you get a huge ass splash screen telling you how to exit

    • @[email protected]
      link
      fedilink
      2810 days ago

      Just to add: possible need to tap esc first, as your random flailing probably put you in insert mode, or something more exotic.

      And only add w if you want to save the file. :q! If you don’t

    • @[email protected]
      link
      fedilink
      English
      410 days ago

      :x is also an alternative to save and quit.

      Equally valid for the facial expression you’d make upon finding that out.

    • Badabinski
      link
      fedilink
      510 days ago

      There’s also ZZ 👉😎👉 Same caveats apply, smash that fukken esc key (for bonus points rebind caps lock as esc) then ZZ Top your way out of that shit.

      • @[email protected]
        link
        fedilink
        210 days ago

        This is the most correct answer.

        Rebind Caps to Esc.

        ZZ (or ZQ if you don’t want to save the file).

    • Elvith Ma'for
      link
      fedilink
      510 days ago

      And if you panicked before and fucked up the opened file while hammering on the keyboard:

      :q!