• KillingTimeItself
    link
    fedilink
    English
    1210 months ago

    idk man, vims pretty chill, it even has a tutor in it already, what more could you want?

  • @[email protected]
    link
    fedilink
    1410 months ago

    Isn’t this supposed to be VIM vs Emac? What’s is there point to be programming in the terminal anyway? Nano is good to fix some config files while your are in there, but if I needed to do real programming I’ll be finding something that works in the GUI.

    • @[email protected]
      link
      fedilink
      English
      110 months ago

      supposed to be VIM vs Emac?

      30 years ago it was vi vs everything. I don’t see it changed today.

    • @[email protected]
      link
      fedilink
      910 months ago

      Efficiency.

      There’s 0 chance if you have to pick up your mouse that you can keep up with a Unix gray beard.

      That’s just editing, if they’re from the emacs era there might be nothing you can do with text faster across their whole system.

      I like vscode as a entry point, but if you care to get faster learning just vim motions and sys utils alone is going to cut time from the process.

      • @[email protected]
        link
        fedilink
        810 months ago

        Oh it’s about speed. What’s the one that get your brain to be faster at programming? I use 4 fingers typing and am still typing much faster than I can think.

        • @[email protected]
          link
          fedilink
          7
          edit-2
          10 months ago

          Definitely worth running through vim tutor at least once.

          It’s beyond typing speed, things like piping out strings to utilities is using one program to write another, you aren’t just getting faster because of access, it’s a paradigm shift.

          Edit just for fun: im a non Dev dummy who happened to grow up in a Unix household. Even having dropped vim for helix and bounced around the MS admin/Apple IT space for 30+ years. When I switched to Linux I could still remember binds I’d set up and last used at 9.

          Kinda like riding a bike.

        • @[email protected]
          link
          fedilink
          510 months ago

          It’s speed, but it’s also flow and a continuous stream of thought. If all your editing is being done with muscle memory and minimal thought, you can continue thinking about the problem at hand rather than interrupting your thoughts process to fumble through some context menu to make a change.

  • MostRandomGuy
    link
    fedilink
    English
    410 months ago

    Vim actually IS easy to use once you get the hang of it, plus more comfortable and efficient.

    Nanos just an excuse for lazyness, cmv.

  • @[email protected]
    link
    fedilink
    2210 months ago

    I’ll say that I find easier to exit vim that to exit nano.

    I don’t know what ^ means. I just start pressing special keys until it doesn’t the thing

  • Queue
    link
    fedilink
    English
    1410 months ago

    Nano isn’t even that simple. Ctrl+X to quit? I guess if you use phonetic sounds to figure out how to exit a program. At least Vim uses the idea of “use what the words start with.”

    I personally use micro in the terminal, and Kate if I want a GUI to write. Vim and Emacs are fine for those who want it, I have no stakes in the editor wars beyond “I just want my program to do what I want, and I want it to be simple to learn.”

      • Queue
        link
        fedilink
        1110 months ago

        Meanwhile I can just use the same shortcuts every other program made in the last 40 years uses. Ctrl+Q to quit, Ctrl+S to save, Ctrl+Z for undo. If I wanted to consult a cheatsheet to relearn keyboard shortcuts, I’ll use vim and emacs.

  • @[email protected]
    link
    fedilink
    1010 months ago

    The problem I had with nano is that, for the time being, it was supposed to be easy to use. With that in account I always get lost when saving a file and closing the thing because one’s used to doing something else with Ctrl+O and Ctrl+X.

    Whereas with Vim (and Neovim for a little while, and now with Vis) I knew it had a steep learning curve from the start so I always had it in mind. And all the funny stories about quitting vim.

    • @[email protected]
      link
      fedilink
      English
      110 months ago

      The problem with using nano for years is that I now try using nano shortcuts in other programs. Random new windows opening is confusing, until you figure out Ctrl+o isn’t save in that program. Then it’s just annoying because you still have your inappropriate muscle memory.

    • @[email protected]
      link
      fedilink
      7
      edit-2
      10 months ago

      they’ve changed those bindings now, Ctrl+S, Ctrl+X, Ctrl+V, and Ctrl+C all do what you think they do

      • lemmyvore
        link
        fedilink
        English
        510 months ago

        I’m thinking Ctrl+C quits and Ctrl+S is scroll lock is that correct?

        • @[email protected]
          link
          fedilink
          7
          edit-2
          10 months ago
          • nano

            • Ctrl-Q search backwards
            • Ctrl-S and Ctrl-X is save file
            • Ctrl-V is scroll down
            • Ctrl-C is cancel or info
          • nano --modernbindings

            • Ctrl-Q quits
            • Ctrl-S is save file
            • Ctrl-X is cut
            • Ctrl-C is copy
            • Ctrl-V is paste
      • @[email protected]
        link
        fedilink
        8
        edit-2
        10 months ago

        Great, now the next time I use nano I surely will forget about this and get frustrated when trying to save a file with Ctrl+O

        • @[email protected]
          link
          fedilink
          310 months ago

          you still can, but I think Ubuntu and other prepacked distros will switch soon to the better bindings

          • socsa
            link
            fedilink
            410 months ago

            Great so now I will mangle all my merge commits depending on which version the host is using.

    • mub
      link
      fedilink
      1310 months ago

      I like Nano. I think it is quite good. There, I said it.

      • @[email protected]
        link
        fedilink
        English
        910 months ago

        Edit a file, writing a quick shell script or whatever in the terminal. Nano is great. I don’t see any use in learning vim or emacs. If I need something more I’m going use a gui editor anyway.

        Don’t get triggered anyone it’s just my preference

        • @[email protected]
          cake
          link
          fedilink
          110 months ago

          This is my thought process exactly.

          I get it, for a power user, vim is probably incredibly powerful. However, I just want to edit text files. I don’t want a text editor where I need a cheat sheet just to save my changes and quit.

          • The Quuuuuill
            link
            fedilink
            English
            110 months ago

            Funny, that’s what I hate about Nano. The key binds seem completely random to me and the programs solution to this is to display a cheatsheet on the screen

            • @[email protected]
              cake
              link
              fedilink
              110 months ago

              Control+W = "Where is," Control+O = "Overwrite", Control+X = “Exit.”

              Makes just enough sense to me, and those are really the only three binds I ever need for editing config files.

              I don’t want to come off like a vim hater, because I do believe it when people say it’s powerful, but… I don’t need powerful. I just need to edit text files.

  • @[email protected]
    link
    fedilink
    English
    810 months ago

    I just use this:

    #!/bin/bash
    
    keep_generating=1
    while [[ $keep_generating == 1 ]]; do
        dd if=/dev/random of=$1 bs=1 count=$2 status=none
        echo Contents of $1 are:
        cat $1
        echo
        read -p "Try generating again? " -s -n1 answer
        while true; do
            case $answer in
                [Yy] )
                    echo
                    break
                    ;;
                [Nn] )
                    keep_generating=0
                    break
                    ;;
                *)
            esac
            read -s -n1 answer
        done
    done
    
    • @[email protected]
      link
      fedilink
      510 months ago

      Just ask if it’s correct. If not destroy the universe. Only The correct will survive, it’s O(1)

        • @[email protected]
          link
          fedilink
          1
          edit-2
          10 months ago

          It’s not fun when you have to explain it. But basically it is based on the infinite multiverse theory. Since the multiverse splits whenever you make choices, in this case the program would spawn a large number of multiverses each with different combinations of those bits, which means at least one of them would have the exactly the combination we want. If the program destroys the multiverse it is in after it determines it is not correct, only reality that remains is the one with correct combination of bytes. Making it that we will get the code we want on the first try.

          • @[email protected]
            link
            fedilink
            English
            110 months ago

            You are assuming here that I know what I want. What if there is no obviously correct answer, and even in the Everett branch that generates the optimal content for the file I’ll still think it can be improved and tell it to destroy the universe?

            • @[email protected]
              link
              fedilink
              110 months ago

              I guess yeah. In that condition the algorithm would probably destroy all universe. Although you might be able to set a threshold and not destroy when it is over the threshold.

              But situation where you don’t know the answer is not for this algorithm as this one came from sorting problem.