• Endmaker@ani.social
    link
    fedilink
    English
    arrow-up
    36
    arrow-down
    2
    ·
    edit-2
    7 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
    
    • Malix@sopuli.xyz
      link
      fedilink
      arrow-up
      30
      ·
      7 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

    • dohpaz42@lemmy.world
      link
      fedilink
      English
      arrow-up
      15
      ·
      edit-2
      7 days ago

      😳

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

      Please don’t give blanket destructive advice.

    • TheFogan@programming.dev
      link
      fedilink
      arrow-up
      15
      arrow-down
      1
      ·
      7 days ago

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

    • T156@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      6 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@kbin.earth
      link
      fedilink
      arrow-up
      5
      ·
      7 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.

      • msage@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        7 days ago

        This is the most correct answer.

        Rebind Caps to Esc.

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

    • Barbecue Cowboy@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 days ago

      I’m going to stick with my current process of accidentally opening vim, typing semi-random things that feel like they should work for a minute and then eventually looking up how to quit on my phone.