• @[email protected]
    link
    fedilink
    28 months ago

    If I’m doing quick txt editing nano is great and what I know I can’t figure vim out for the live of me

    • rhys
      link
      fedilink
      English
      98 months ago

      Uh, just trying non-modal vim for the first time and… how do I quit it? I can’t :q.

      • Boxscape
        link
        fedilink
        11
        edit-2
        8 months ago

        Uh, just trying non-modal vim for the first time and… how do I quit it? I can’t :q.

        • @[email protected]
          link
          fedilink
          38 months ago

          I’ve never tried modal vim because I’ve only just heard about it. The next thing I’d try is restarting the computer. Or Ctrl + Q whichever’s easier.

  • @[email protected]
    link
    fedilink
    388 months ago

    Sometimes you don’t even have the luxury of nano. Any moderately advanced Linux user should probably learn the basics of vi. Just knowing how to insert text and save it can fix a system that’s stuck in recovery. Even if it’s just to add a comment in front of a line in a config file.

    • Mactan
      link
      fedilink
      68 months ago

      Sometimes you don’t even have the luxury of vi. Any moderately advanced Linux user should probably learn the basics of sed. Just knowing how to insert text and save it can fix a system that’s stuck in recovery. Even if it’s just to add a comment in front of a line in a config file.

    • JackbyDev
      link
      fedilink
      English
      128 months ago

      I do like that some distros make visudo use Nano instead.

      • Saki
        link
        fedilink
        English
        18 months ago

        you can change that really easily

      • @[email protected]
        link
        fedilink
        19
        edit-2
        8 months ago

        Not in rescue mode. If you can’t mount your root partition because something was fudged in /etc/fstab, for example, you may be stuck in recovery and depending on your distribution, it may not have nano in that minimalist mode.

        For me it also happens when I install a VM of Debian using the small image, on my dedicated server in a data center. The company hosting the server requires a special network configuration and AFAIK, there’s only vi. So i need to use the console to access the VM and from there, edit /etc/network/something with vi to setup the network. Once done I can reboot and install the rest of the software over the network, including nano.

        I’ve been using Linux for more than two decades. Before nano I was using pico, but it also required to have pine/alpine installed. So knowing the basics of vi has often been helpful over the years for me.

        Maybe it’s because I like tinkering with VMs and SBCs, and most people will not encounter situations where they don’t have nano, but it can happen. And you’ll be glad to know at least “i” and “:wq!”.

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

        In a professional context, you might end up on servers that don’t have nano installed, but do have vi. Or if you’re helping out a friend on their laptop, they might not have the same software as you. Or if you often end up tinkering with random devices and/or setting up new systems it might be tedious to install the same applications every time.

        It’s basically an argument for learning the very basics of the most common editors so you have flexibility no matter where you end up. Even when you have the ability to download and install your preferred software, it’s still an extra step that might not be desirable for a variety of reasons. But if it’s just your own personal device, I see no problem with just installing whatever you prefer and running with it.

        EDIT: Personally, I find that I don’t end up using those other editors often enough to remember the abstruse commands of tools like vim, so I’m not worried about it. When it does happen, 99% of the time I can just whip out a smartphone and look up the directions for the n-dozenth time.

    • mub
      link
      fedilink
      138 months ago

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

      • @[email protected]
        link
        fedilink
        English
        98 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]
          link
          fedilink
          18 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
            18 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]
              link
              fedilink
              18 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
    148 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
      98 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
        88 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
          58 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.

        • @[email protected]
          link
          fedilink
          7
          edit-2
          8 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
      English
      18 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
    228 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

  • @[email protected]
    link
    fedilink
    128 months ago

    Easy is relative. What are you trying to do? Replace a value in an yaml file? Then nano is easier. Trying to refactor a business critical perl/brainfuck polyglot script in production? Then you probably want to use vim (or emacs if you are one of those people)

    • @[email protected]
      link
      fedilink
      18 months ago

      Honestly, roll back to previous release for production and use best IDE your developers are used to on their local machines, test the fix in a non production environment then release to prod. When is editing business critical scripts in production really needed?

      • @[email protected]
        link
        fedilink
        28 months ago

        It was a joke to make the point that vim can be the easiest tool to use if you are trying to do a complex task.

        • @[email protected]
          link
          fedilink
          18 months ago

          I’m a bit slow on the uptake there haha. I started with vi and moved over to nano at some point and never looked back. I can refactor code in production with the best of them. There’s still some tricks I’ve seen done in vi that amazes me that I haven’t tried to figure out in nano, but for the most part it’s fairly easy to use to do nearly anything in. Even supports color for supported files, YAML, etc.

    • SpongeBorgCubePants
      link
      fedilink
      2
      edit-2
      8 months ago

      Replacing a value in a config file is still easier in vim due to e.g. ciw or ci" being a thing.

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

      Walk someone else through editing a config file on the command-line over screenshare? Nano. Omg nano is your friend.

  • @[email protected]
    link
    fedilink
    28 months ago

    On my laptop, I update my bashrc on Excel, in Wine, then export it as a PDF, OCR to .md, Pandoc it to an .Org, and then finally, write it down on paper and re-type it on my phone’s Termux’s Emacs instance, then TRAMP it to my PC, in the other room.

    I use biebian, btw.