• raptir@lemdro.id
      link
      fedilink
      English
      arrow-up
      12
      ·
      8 months ago

      If anything it is dangerous as it will still exit even if changes cannot be saved.

    • DocMcStuffin@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      Try editing a file in /etc as a regular user. It happens sometimes and you really want that warning that the write failed.

      Anyway, :x is superior. It only writes if there are changes. So, your mtime doesn’t change unnecessarily.

  • JGrffn@lemmy.world
    link
    fedilink
    arrow-up
    8
    arrow-down
    4
    ·
    edit-2
    8 months ago

    Serious question. Why? No, for real, why? Why are these hard to understand editors still the default on most distros and flavors? Why haven’t they reinvented themselves with easier to understand shortcuts?

    I get the feeling my comment will attract heat, but I’m a web dev, studied comp Sci for years, have worked for nearly a decade and have spent over half my 30 year old life using computers of all sorts. I’m by no means a genius and I by no means know enough about this or most tech subjects, but I literally only knew how to close vim with and without saving changes in a recent vim encounter, purely due to a meme I saw in this community a few days prior, and I had already forgotten the commands by the time I saw this post. Nothing about vim and alternatives feels intuitive or easy to use, and you may say it’s a matter of sitting down and learning, which you can argue that, but you can’t argue this isn’t a bit of a gatekeeper for people trying to dip their toes into anything that could eventually rely on opening vim to do something.

    I won’t try to deny its place in computer history, or its use for many, or even that it is preferred by some, but when every other software with keyboard shortcuts agrees on certain easy to remember standards, I don’t quite understand how software that goes against all of that hasn’t been replaced or hasn’t reinvented itself in newer versions.

    Then again, I have no idea what the difference between vi, vim, emacs, and nano are, so roast away!

    • camr_on@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      Why would vim reinvent itself? Vim’s functionality has been standard for years, and works as expected. You can always use nano or something similar instead, which is probably a lot more usable to someone who doesn’t want to learn all the advanced functionality of vim or emacs

    • Captain Janeway@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      Vi is meant for old school and modern terminals. Ctrl+S or Ctrl+C had very particular purposes in software control flow. With Vi you can communicate via SSH on almost any unix file system. It’s basically a universal editor that doesn’t require a mouse or a lot of keys on a keyboard. You can get away with just a subset of the ASCII set.

      So for one, it’s kind of like having a backwards compatible piece of software that exists on almost any system you might need to remotely control via a keyboard with no GUI.

      For two, once you do learn how to use Vi/Vim/Emacs, you’ll be far faster at typing. It has several useful tricks for automating typing (faster copy/paste, copy/paste n-times, jump around lines/chars, go-to lines, search via Regex, etc.) which are particularly useful in a programming context.

      Generally, it’s worth a developer spending at least a day or a week typing only in Vi for programming. Yes, you’ll be slow and clunky. But the moment you have to SSH into a server and make meaningful changes to a file, you’ll be happy you spent the time.

    • rtxn@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      8 months ago

      To ensure the Unix-like standard of maximum backwards compatibility. Vi (the original, before Vim) was made in an age where computer keyboards might not have had luxury features like arrow keys, but did have alphanumeric keys and minimally competent users. It has worked for almost half a century, so unless you’re Microsoft, why would you change it?

      Even today, many people prefer it because you don’t have to move your hand far away from the home row while typing or navigating, and the modality gives the user a much greater toolkit (seriously, I just about nutted when I discovered d i "). Not having to rely on modifiers and the arrow keys also reduces the risk of the repeated stress injury known as Emacs pinky.

    • bitwaba@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      8 months ago

      As a ~20 year vim user, and by no means a proficient power user (any time I end up in recording mode, I just mash ESC repeatedly until this start behaving normally again.), I think it’s just “it’s easier for someone that doesn’t know how to use it to learn, than it is for everyone that already knows how to use it to relearn”.

      Like the damn scroll options on laptop trackpads. Multitouch scroll down = scroll down. Then someone decided it needed to match the way phone scrolling works after smartphones became popular, so now there’s lots of scroll down = scroll up software behavior. But the options are still there to behave neither way. If you don’t like the vim commands, you’re free to install something that behaves in a way that you expect. If you do like vim commands, install it and get the behavior that users have come to expect for the last 20+ years.

  • aard@kyu.de
    link
    fedilink
    arrow-up
    3
    ·
    8 months ago

    I always get annoyed when I’m on some system and nano pops up and I need to figure out how to kill that thing.

      • aard@kyu.de
        link
        fedilink
        arrow-up
        0
        arrow-down
        1
        ·
        8 months ago

        It shows a message which wastes valuable screen estate, especially on low resolution terminals, containing a message I have to read every single time because the keys are not in muscle memory, and never will because the bindings are stupid.

        On systems I have control over the reaction to nano popping up is exiting, removing it, making sure the package system blocks reinstallation attempts, and go back to what I was initially doing in a sane editor.

  • LainOfTheWired@lemy.lol
    link
    fedilink
    English
    arrow-up
    2
    ·
    8 months ago

    Wouldn’t you want to just want to type q! As you’ve probably opened it and accidentally made changes you didn’t want to. So you wouldn’t want to save the config file. Or the text file you just created.

  • Danny M@lemmy.escapebigtech.info
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    8 months ago

    I prefer the extremely intuitive:

    [C-R]=system("grep -P "PPid:\t(\d+)" /proc/$$/status | cut -f2 | xargs kill -9")

    or

    i:!grep -P "PPid:\t(\d+)" /proc/$$/status | cut -f2 | xargs kill -9[esc]Y:@"[cr]

    It just rolls off the fingers, doesn’t it?

    Edit: damn it lemmy didn’t like my meme because it assumes that characters between angle brackets are html tags :( you ruined it lemmy

    EDIT 2: rewrote it, just assume that square brackets are buttons not characters