• 0x4E4F@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      16
      ·
      1 year ago

      When you know how to exit, you just slap your face 🤦 and ask “why… why, please, why don’t they add new shortcuts 🤦!”.

      • mvirts@lemmy.world
        link
        fedilink
        arrow-up
        18
        ·
        1 year ago

        Lol if you know how to exit, you may know that you actually can change almost everything about vim.

        • 0x4E4F@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          9
          ·
          edit-2
          1 year ago

          I don’t think you can add modifier keys in shortcuts.

          And this behavior should come out of the box, not me changing stuff around so I can make it usable. For something that I use all the time, sure, but I only use a terminal text editor with git, and I don’t use git that often. For everything else, I use a GUI text editor (mousepad, leafpad, whatever).

          • bisby@lemmy.world
            link
            fedilink
            English
            arrow-up
            7
            ·
            edit-2
            1 year ago

            nnoremap <C-q> :q<CR>

            This works for me to bind control+q to quit.

            edit: easier to upload an image because lemmy is eating the “html” characters

          • taladar@sh.itjust.works
            link
            fedilink
            arrow-up
            4
            ·
            1 year ago

            You can set which editor to use with git using the GIT_EDITOR environment variable instead of telling other people their editor isn’t usable by your standards.

            • 0x4E4F@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              1
              ·
              1 year ago

              Yes, I know, and I have it set to nano, but even then, I don’t use nano that much anyway, I do most edits in a GUI text editor.

  • Danny M@lemmy.escapebigtech.info
    link
    fedilink
    arrow-up
    32
    arrow-down
    1
    ·
    edit-2
    1 year 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

  • aard@kyu.de
    link
    fedilink
    arrow-up
    35
    arrow-down
    8
    ·
    1 year 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
        9
        arrow-down
        22
        ·
        1 year 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.

        • nixcamic@lemmy.world
          link
          fedilink
          arrow-up
          14
          arrow-down
          3
          ·
          1 year ago

          My man, most of us aren’t connecting to our mainframes on VT20s these days. Even on my phone screen the three extra lines nano takes over vi aren’t a problem.

          Also if you have the time to go through all that you have the time to learn ctrl+x.

          • voidMainVoid@lemmy.world
            link
            fedilink
            arrow-up
            9
            arrow-down
            1
            ·
            1 year ago

            In most apps, Ctrl-X means “cut”, not “quit”. Especially when it’s a freakin’ text editor!

            I will grant you that it’s more intuitive than vi, but that is a very, very low bar.

            • GoosLife@lemmy.world
              link
              fedilink
              arrow-up
              3
              ·
              1 year ago

              Ctrl-X in Nano is arguably more nonsensical, considering that vi was made in an era long (decades) before many of the conventions we know today came about. They were figuring it out in real time. And the criterium here is much simpler: it must be available on all keyboards so no fancy keys. That’s all.

              On the other hand, when nano decided to use Ctrl+X for eXit, Apples Ctrl+X/C/V had already been brought over to Windows and Apple, and was also the de facto way for most Linux apps to handle these inputs although I do think it came before any “official” efforts to standardize these shortcuts in desktop environments.

            • 0x4E4F@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              1
              arrow-down
              4
              ·
              edit-2
              1 year ago

              It doesn’t have to be X, just the fact that it uses modifier keys is enough. It could be Q or anything else, just please, for the love of god, we live in the 21st century now, all keyboards have modifier keys, please, add modifier keys shortcuts as well.

              • 0x4E4F@sh.itjust.works
                link
                fedilink
                English
                arrow-up
                2
                arrow-down
                4
                ·
                edit-2
                1 year ago

                That’s normal for people that didn’t grow up in the 70s and 80s and GUI wasn’t the first thing they knew. I was a teen in the late 90s and early 00s, so yeah, we had GUIs for almost everything.

                We’re basically trying to do catchup with the cool kids, but let’s face it, they live somewhat in the past regarding modifier keys and vi/vim.

        • UnfortunateShort@lemmy.world
          link
          fedilink
          arrow-up
          5
          arrow-down
          1
          ·
          1 year ago

          Because it also sends the kill signal in every terminal I’ve witnessed yet… And you have it right on screen the second you start Nano.

          • GoosLife@lemmy.world
            link
            fedilink
            arrow-up
            5
            arrow-down
            1
            ·
            1 year ago

            Can you please elaborate on the first part? It is not standard Linux terminal behavior to send the KILL signal on Ctrl+X.

            • UnfortunateShort@lemmy.world
              link
              fedilink
              arrow-up
              1
              ·
              1 year ago

              Actually, you are right. I will stand by my point that Nano tells you what to press, but I wonder where I got the stuff about Ctrl+X… I am very positive that I have used it at some point (outside of Nano), but maybe my brain is playing tricks on me 🤔

        • 0x4E4F@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          2
          arrow-down
          1
          ·
          edit-2
          1 year ago

          Yeah, sure, that works as well.

          As long as I get to use modifier keys, almost anything is fine with me. We don’t live in the 70s, that was 50 years ago. If backwards compatibility is what they’re after, I’m sorry but I think they overdid it. Plus, you can just add them, the defaults don’t need to be changed.

  • Doctor xNo@r.nf
    link
    fedilink
    English
    arrow-up
    26
    arrow-down
    1
    ·
    1 year ago

    There’s a button to exit vim on your pc. Just hold it 7 seconds and vim is closed. 😅

    • raptir@lemdro.id
      link
      fedilink
      English
      arrow-up
      18
      ·
      1 year ago

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

    • DocMcStuffin@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      1 year 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.

  • LainOfTheWired@lemy.lol
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year 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.