First time when you ssh into your Linux terminal and you gotta “sudo crontab -e” or something and it’s like “what editor do you want to use?” and nano sounds lame so you choose vim cause the sound is cool when you say it and then you have to wipe the whole comp and start over

  • AVincentInSpace@pawb.social
    link
    fedilink
    English
    arrow-up
    47
    ·
    edit-2
    11 months ago

    How do I exit Vim?

    escape colon w q

    One of life’s great mysteries

    escape colon w q

    I’m pretty sure it’s impossible

    it is literally. the first result on google.

    The best way is to change to another terminal and forcequit it from there

    escape then Shift+Z twice also works. or shift+Z shift+Q to quit without saving.

    Or hard restart your entire computer

    Are you people allergic to search engines or someth–

    Bill Joy made vi impossible to exit because he wanted the source to always be open

    siiiiiiiiigh

    Yes, I’m an old man yelling at cloud, but Vim and Neovim are fantastic text editors that really are worth the half hour you’ll spend running through the tutorial to learn them, and the subsequent two weeks you’ll spend installing plugins and configuring it exactly to your liking. It really does make writing software more efficient and really doesn’t deserve the reputation it gets from “vim is hard to exit lmao” memes made by people who haven’t bothered to change their $EDITOR to nano, had it launch automatically when they tried to write a commit message, and instantly decided it was just yet another piece of arcane 80s Unix bullshit

    • commandar@lemmy.world
      link
      fedilink
      arrow-up
      21
      ·
      11 months ago

      vi isn’t a text editor as much as it’s a text manipulation language.

      It has a syntax, grammar, idioms, and, yes, a learning curve.

      But once you learn it, it’s as close to a brain-computer interface as I’ve experienced. You start thinking about edits as chainable operations and it literally becomes muscle memory – if you ask someone experienced with vi how they just did a complex sequence of edits, chances are they’ll have to stop and consciously walk through it because they literally didn’t have to think about it the first time.

      • hulemy@ani.social
        link
        fedilink
        English
        arrow-up
        5
        ·
        11 months ago

        got any online course recommendations? my college recommended missing semester for the basics of the basics, but i know there are so many more and other vim workflows (easy motions etc)

        although i should first start getting into touch typing

      • Voroxpete@sh.itjust.works
        link
        fedilink
        arrow-up
        9
        ·
        11 months ago

        I am a professional linux sysadmin, and I don’t use Vim. There is honestly no task you will ever do that will actually require familiarity with Vim. You can get by with Nano just fine.

        • Fitzsimmons@lemmy.blahaj.zone
          link
          fedilink
          arrow-up
          3
          ·
          11 months ago

          I use nano on my servers because the default configuration can be used by pretty much anyone, even if I had to explain it to someone over the phone. And hopefully you rarely if ever have to make sophisticated changes to files on servers that would benefit from vim’s model.

          If you do need to do consistent heavy-duty file editing on a server, rmate is really nice for that: https://github.com/aurora/rmate

          But honestly both of these strategies are dated and I don’t use either of them professionally. These days it’s all immutable infrastructure: I use my local editor to make build scripts for immutable server images that there’s no point in editing files on running instances because none of the changes will be persisted.

          • Voroxpete@sh.itjust.works
            link
            fedilink
            arrow-up
            2
            ·
            11 months ago

            Exactly. The days of doing long form editing directly on your server are gone. Most likely any editing I’m doing is happening in VSCode or Notepad++/qq.

      • TheHarpyEagle@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        edit-2
        11 months ago

        I actually learned while writing docs for work because it was boring as fuck otherwise. Now I’m one of those people. Give it a shot if you want to spice up (and dramatically slow down at first) some tedious work for a bit.

      • AVincentInSpace@pawb.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        10 months ago

        step 1. alt
        step 2. tab

        alternately:
        step 1. switch VTs back to your desktop environment and Google it there

        if you’re using vim without a GUI running at all (I hate embedded systems too):
        step 1. you still have your phone on you, right

      • Kidplayer_666@lemm.ee
        link
        fedilink
        arrow-up
        3
        ·
        11 months ago

        I wanted the rest of the song. I asked Bing to make it, sorry Copilot. I am not disappointed

        You heard there was a secret chord That you could use to meet the Lord 'Cause you don’t care about power safety, do ya? You plugged it in without a thought And then you saw a bright blue spark And from your lips you screamed a loud “Hallelujah!”

        Hallelujah, Hallelujah Hallelujah, Hallelu-u-u-u-jah

        Your room was dark, you smelled some smoke You realized you made a joke Of basic rules of electricity, didn’t ya? You tried to find another plug But all you got was just a shrug And from your phone you heard a low “Hallelujah!”

        Hallelujah, Hallelujah Hallelujah, Hallelu-u-u-u-jah

        You called the landlord right away He said he’d come and fix the fray But he would charge you extra for the labor, yeah You felt a pang of guilt and shame You knew you only had yourself to blame And from your wallet you let out a sigh “Hallelujah!”

        Hallelujah, Hallelujah Hallelujah, Hallelu-u-u-u-jah

      • soupuos@sopuli.xyz
        link
        fedilink
        arrow-up
        1
        ·
        11 months ago

        Maybe it was just me, but I found VSCode’s undo/redo vim trees (u/r) to be kind of awkward when compared to real vim.

    • janabuggs@beehaw.org
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      Native vim? Or with an elaborate preference file?

      I personally have grown so accustomed to vim that if I have to ssh to a new (to me) server I would rather use stock vi (which in most systems is actually an alias for vim) to any other editor. But honestly I have made an alias for a script that ports over my elaborate vimrc file for every first login to a new server or instance lol. It makes me feel a little like a diva 💁💅

      • Novman@feddit.it
        link
        fedilink
        arrow-up
        2
        ·
        11 months ago

        Vim with a minimal preference file, but sometimes vim only, i don’t like vi cause it lacks syntax highlighting

  • biscuitswalrus@aussie.zone
    link
    fedilink
    arrow-up
    15
    ·
    11 months ago

    Quitting Vim is called ‘escaping’ because it was designed to be a trap and you’ve escaped. Congratulations to everyone who has.

  • phorq@lemmy.ml
    link
    fedilink
    Español
    arrow-up
    9
    ·
    11 months ago

    Who told you to add a job to your root crontab? Vim was just protecting you from yourself

  • zorro@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    11 months ago

    I think someone else mentioned this but just run vimtutor in your command line for a pretty exhaustive tutorial.