• kat_angstrom@lemmy.world
    link
    fedilink
    arrow-up
    95
    ·
    3 days ago

    I don’t know why there’s so much hate for Vim. It’s simple- just use it as your default text editor since you first started using computers, and keep using it forever, and problem solved!

    • TheFogan@programming.dev
      link
      fedilink
      English
      arrow-up
      69
      ·
      3 days ago

      Setup for the overused joke - I’ve been using vim since I first started using a computer, I just can’t quit.

      • Heathcliff@lemm.ee
        link
        fedilink
        English
        arrow-up
        3
        ·
        3 days ago

        Right now I’m at the hospital in the exam yr colon queue! Maybe it helps U too.

    • dohpaz42@lemmy.world
      link
      fedilink
      English
      arrow-up
      6
      ·
      edit-2
      3 days ago

      :set nocompat

      Why VIM decided to make itself run just like VI (by default) is beyond me. Isn’t the long name “VI Improved”?

      • nous@programming.dev
        link
        fedilink
        English
        arrow-up
        15
        ·
        3 days ago

        Vims defaults are quite crap overall. It is why everyone needs 100s of lines of configs and many plugins to turn it into something decent. Well worth the setup but it could go a long way to making things nicer to use out the box.

  • darklamer@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    35
    ·
    3 days ago

    I switched from vi to vim in 1994 and found it immediately obvious how to quit — it was just like vi!

    I guess I’ll never understand these memes.

  • Landless2029@lemmy.world
    link
    fedilink
    arrow-up
    25
    ·
    3 days ago

    I’ve recently started administering windows headless. PowerShell over SSH.

    Don’t have this problem on windows server!

    It doesn’t even have a terminal text editor

    I have to install nano or use powershell commands through hoops of fire just to edit a line in a file.

    Or download the file via scp, edit and reupload.

    Pure Insanity.

  • Endmaker@ani.social
    link
    fedilink
    English
    arrow-up
    35
    arrow-down
    2
    ·
    edit-2
    3 days ago

    Personally, I have seen so many memes about exiting vim that by the time I got to use it for the first time, exiting it was a no-brainer.

    For any newbies out there, the command is

    :wq
    
    • Malix@sopuli.xyz
      link
      fedilink
      arrow-up
      28
      ·
      3 days ago

      Just to add: possible need to tap esc first, as your random flailing probably put you in insert mode, or something more exotic.

      And only add w if you want to save the file. :q! If you don’t

    • dohpaz42@lemmy.world
      link
      fedilink
      English
      arrow-up
      16
      ·
      edit-2
      3 days ago

      😳

      :w = write; or overwrite if the file already exists.

      Please don’t give blanket destructive advice.

    • T156@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      2 days ago

      :x is also an alternative to save and quit.

      Equally valid for the facial expression you’d make upon finding that out.

    • TheFogan@programming.dev
      link
      fedilink
      arrow-up
      15
      arrow-down
      1
      ·
      3 days ago

      also worth noting you open vim the first time, you get a huge ass splash screen telling you how to exit

    • Barbecue Cowboy@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 days ago

      I’m going to stick with my current process of accidentally opening vim, typing semi-random things that feel like they should work for a minute and then eventually looking up how to quit on my phone.

    • Badabinski@kbin.earth
      link
      fedilink
      arrow-up
      5
      ·
      3 days ago

      There’s also ZZ 👉😎👉 Same caveats apply, smash that fukken esc key (for bonus points rebind caps lock as esc) then ZZ Top your way out of that shit.

      • msage@programming.dev
        cake
        link
        fedilink
        arrow-up
        2
        ·
        3 days ago

        This is the most correct answer.

        Rebind Caps to Esc.

        ZZ (or ZQ if you don’t want to save the file).

    • Mikina@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      1 day ago

      I’m more fan of the https://www.vim-hero.com/.

      Also, one think I was surprised by when I switched to Lazyvim/Ideavim/vscodevim setup few months ago - it’s a lot of fun. Learning vim properly is like the dark souls of typing. Sure, you probably won’t be as efficient for the first few years, but learning new motion combos is pretty fun, to the point where the minor loss in efficiency doesn’t really bother me. Blasting out combos you’ve been practicing to do that one move efficiently, or discovering another new cool way how to do something is a continuous and fun process. It’s basically gamifying typing.

      So, if you want a boost in efficiency, just learn all the keybinds your current text editor has (jump to next param/function, multi-line editting, go to definition without using mouse, etc.), and start using them. You’ll probably master all of them in few weeks and be much more efficient.

      If, however, you enjoy slowly mastering something, vim will give you years of stuff to learn and master. Is it worth it? Probably not, but it’s suprisingly satisfying!

    • lobut@lemmy.ca
      link
      fedilink
      arrow-up
      8
      ·
      edit-2
      3 days ago

      I use VS Code mainly and I always want to go to the end of a line and beginning. On Mac it’s like CTRL+E and CTRL+A respectively. On Windows, I was like, I guess I could do Windows Key and arrows but it felt off. Installing Vim bindings on VS Code just fixed this all for me. I love it.

      [edit] for non-VIM users, you can skip words and go-to braces (and delete what’s in them) and highlight within quotes very easily … for function search, the built-in VS Code is really good too. I also have Harpoon installed to hop between files. If it doesn’t appeal to you, then that’s cool too! Whatever keeps you in there. [/edit]

      I’ve tried setting up my own vim stuff and I always bail out because I can’t figure something out. I feel like I need to really sit with it and I’d have the perfect set up for me.

      Lastly, I’ve installed vim for zsh and it’s the best. I can hop all around my terminal and highlight and remove things. It’s so beautiful.

      • Prinz Kasper@feddit.org
        link
        fedilink
        arrow-up
        4
        ·
        3 days ago

        I use VS Code mainly and I always want to go to the end of a line and beginning.

        Soo… The end key and pos1 key?

        • lobut@lemmy.ca
          link
          fedilink
          arrow-up
          4
          ·
          3 days ago

          lol yes I understand I know I sound silly. My home/end aren’t typical on my keyboard. It’s like function and stuff, which breaks my flow for something I do so often.

    • NocturnalMorning@lemmy.world
      link
      fedilink
      arrow-up
      6
      arrow-down
      14
      ·
      3 days ago

      Because they grew up with it? I cant think of any other reason. I used it in college for a class bcz my old as fuck professor required it. Its obtuse, old, and doesn’t have a lot of functionality of modern code editors.

      The only people who want to use it are people who started with it decades ago, or people who were forced to use it, and now think they’re superior somehow to everyone else who doesn’t use it.

      • Gamma@programming.dev
        link
        fedilink
        English
        arrow-up
        10
        ·
        edit-2
        3 days ago

        I don’t fit into any of those categories.

        Its obtuse, old, and doesn’t have a lot of functionality of modern code editors

        Obtuse? Yeah. The keyboard focus means natural discoverability is low. But I immediately preferred modal editing once I learned it.

        Old? Eh, most people use Neovim nowadays and write plugins in lua. Even in OG Vim, Vim9script broke compatibility for a better dev experience.

        Functionality? Out of the box, it is just a text editor. But only VSCode might have a more active plugin ecosystem. ALE has been a thing for ages if it’s LSP support you’re looking for.

        It’s not better, it’s not worse, I’m not in any way superior for using it, but I love it for a reason.

      • supersquirrel@sopuli.xyz
        link
        fedilink
        arrow-up
        12
        arrow-down
        4
        ·
        3 days ago

        The only people who want to use it are people who started with it decades ago, or people who were forced to use it, and now think they’re superior somehow to everyone else who doesn’t use it.

        oof now that is a lazy argument, I hope you were being sarcastic!

        • NocturnalMorning@lemmy.world
          link
          fedilink
          arrow-up
          3
          arrow-down
          9
          ·
          3 days ago

          How is this a lazy argument? Most people dont use Fortran, Cobol, or Assembly anymore for the same reason. There are better alternatives out there.

          • supersquirrel@sopuli.xyz
            link
            fedilink
            arrow-up
            7
            arrow-down
            1
            ·
            3 days ago

            Vim is a style of keybindings centered around only needing a keyboard, what do programming languages have to do with my point?

          • BassTurd@lemmy.world
            link
            fedilink
            arrow-up
            3
            ·
            3 days ago

            I’m not an old hat programmer and have never been forced to use VIM, but I started learning how to navigate because of the potential efficiencies that comes with it, and because I like to learn new things. I’m not good at it, but I’ve gotten a lot better, and I will continue to do so because it’s enjoyable, neovim is extremely customizable, and the vim key bindings can be used in vscode for when I use that. I also use Linux, so it felt like the right direction to go, but mostly for the memes.

            I don’t use it for high level language coding like python, JS, and definitely nothing.net related like c#, but it’s solid for lower level like C.

            You don’t have to enjoy it, but there are some extremely skilled programmers out there that can code laps around other extremely skills programmers just because they use vim/neovim and can navigate at a stupid fast rate. Watching some like the Primeagen on YT is humbling.

            • supersquirrel@sopuli.xyz
              link
              fedilink
              arrow-up
              2
              ·
              edit-2
              1 day ago

              I agree with you wholeheartedly but I wanted to elaborate in a complimentary direction to your point, I think the benefits of knowing how to navigate only using a keyboard with Vim (which importantly is much less prone to RSI than something like emacs or mouse centric workflows for most people) gives a programmer are the same as they do for someone writing a book in markdown using vim.

              When you describe the advantage of vim’s modal keybindings and navigation, it sounds like you are describing an advantage in speed but it is really like a decrease in executive function load about the how which frees you up to think farther ahead and consider more interesting questions… kind of like how people describe the mystical power of AI except not bullshit, just a basic benefit to tooling that slots into your body mechanics and mind like a finely tuned instrument… but at the same time nobody NEEDs to learn vim. If you don’t like it, forget it, what we are saying is don’t bash it without understanding the beauty to Vim style keybindings independent of any particular software including vim or vi themselves.

      • johnwicksdog@aussie.zone
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 days ago

        I was also forced to use it at uni (a few decades ago), but didn’t start using it until professionally until several years into my dev career. I promise that I don’t think I’m superior because I use it. But I do encourage junior developers to learn it for reasons that appealed to me.

        Among other things, appealing things are modal editing (the biggest advantage IMO), it runs on pretty much on any server you will be ssh’ing into, less IDE lock in. And, there’s a bunch of additional things that other editors do that I think Vim does better: regex is first class in the environment, extensible workflows, macros. Then there are definite advantages being able to quickly navigate from the home row.

        I agree that some people will demonstrate their enthusiasm by bragging and being pretentious. But I don’t think that’s why they stick with Vim.

      • Shanmugha@lemmy.world
        link
        fedilink
        arrow-up
        6
        arrow-down
        2
        ·
        3 days ago

        If you can’t think of a reason, then you could have just asked. Or read a few threads here or somewhere else. But instead you went forward typing your oh so very informed opinion, which itself is a good invitation for “shut up, lousy know-nothing type of human” kind of response. I do hope you’ll do better next time you see a piece of lore and culture you have no clue about

        • NocturnalMorning@lemmy.world
          link
          fedilink
          arrow-up
          2
          arrow-down
          7
          ·
          3 days ago

          Seems like I struck a chord. I get this same response anytime vim comes up in a thread. Its almost as bad as the linux gatekeeping. Apparently I’m not allowed to have an opinion that differs from the group.

          • Shanmugha@lemmy.world
            link
            fedilink
            arrow-up
            5
            arrow-down
            1
            ·
            3 days ago

            “It sucks because I can’t see why it is even useful” is not an opinion, it is ignorance, and you have already shown it to be a willful one. No wonder you get shat on repeatedly

              • smoker@lemm.ee
                link
                fedilink
                arrow-up
                5
                arrow-down
                1
                ·
                edit-2
                3 days ago

                “I didn’t like it” is an opinion. “Vim is dumb because I can’t think of a reason people would like it, and everyone who uses it is an elitist asshole” is ignorance.

              • Shanmugha@lemmy.world
                link
                fedilink
                arrow-up
                4
                arrow-down
                2
                ·
                3 days ago

                Nope, that’s not a definition of opinion. And this opinion is leagues away from your original post. If you can’t see this - be my guest, go on making up dreams of " I stuck a chord" and whatever else you are imagining

        • kobra@lemmy.zip
          link
          fedilink
          arrow-up
          8
          ·
          3 days ago

          Apologies for the completely random thought but this is the 2nd time in my life I’ve see “‘tude” written down. first time was in the “I can’t remember” song by Alice In Chains, so you’re in good company haha

        • bss03@infosec.pub
          link
          fedilink
          English
          arrow-up
          4
          ·
          3 days ago

          Honestly, I don’t like either programmability approach (vimscript/lua OR emacs-lisp), but I’ll probably just stick with neovim, because when I’m on a system without my configuration, I’ve more productive there, and I don’t want to learn enough emacs-lisp “APIs” to reproduce my somewhat small vim configuration.

  • SwizzleStick@lemmy.zip
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 days ago

    An old Buffalo NAS box made me learn vi. Because that’s all it had.

    Yes, this comic speaks to me.

    • pmk@lemmy.sdf.org
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      Recently I decided to try ed for real and used it exclusively for a coding project. There is a certain joy in the simplicity, but ultimately I found myself printing lines and searching files more than I liked. And rewriting long lines instead of getting the substitutions wrong again.

    • supersquirrel@sopuli.xyz
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 day ago

      Honestly if there was an award for keybindings for style in terms of the way something like the MLA style guide would describe “good style” in the context of english, Vim would easily win it. It is one of the oldest, most coherent, extendable, fast, joyful and resilient conceptions of how to manipulate text with a keyboard ever created and it is awesome how it is such a compelling idea that it no longer exists as a literal codebase at this point, but rather a style and philosophy of keybindings.

      It is shockingly beautiful even if you find it annoying to use in practice (I get it).

      For example, the Qutebrowser is just awesome, I don’t care if you don’t like vim you can’t argue with the power, ease of use and minimal UI the system requires in exchange for all the control you could want for navigating web pages without needing a mouse.

      The utility of vim keybindings in my opinion extends further into a lot of unexplored accessibility benefits because any vim style input scheme to a program is going to be by definition a nice limited set of inputs someone can custom map to their accessibility hardware or software to have full control over a software and they won’t have to worry about needing a mouse at super annoying parts because they know that is against The Core Commandments Of Vim.

      When making a custom or 3rd party controller to a software, there is always the problem of how many control inputs are you going to need, some softwares go nuts with unnecessary keybindings for silly things that becomes a nightmare to try to map a custom hardware/software controller to. Vim keybindings on the other hand well… it is the keyboard proper and that is it, boom done…

  • whodatdair@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    10
    arrow-down
    8
    ·
    3 days ago

    ‘vimtutor’ is your friend. Nobody sane uses vim as an IDE, but if you have to ssh to a host to fuck with a config file it’s pretty nice to know because you can guarantee that most distros have at least vi, if not vim.

    • expr@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      17 hours ago

      Nobody sane uses vim as an IDE

      True, same people use unix as their IDE and vim as the editor therein.

    • nous@programming.dev
      link
      fedilink
      English
      arrow-up
      32
      ·
      3 days ago

      Nobody sane uses vim as an IDE

      Huh? Many people do this. With the right plugins and config it is just as capable as any IDE.

    • NaibofTabr@infosec.pub
      link
      fedilink
      English
      arrow-up
      9
      arrow-down
      4
      ·
      3 days ago

      If you’re just doing a quick config edit, nano is significantly easier to use and is also present in most distros.

      Vi/Vim is useful as a customizable dev environment, but in the present there are better, more feature-rich development tools - unless you are specifically doing a lot of development in a GUI-free system, for some reason.

      • timbuck2themoon@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        10
        ·
        3 days ago

        I mean, if youre continually updating files on remote take the time to learn vim. My God it’s a million times more efficient. Even using the keybindings in an ide makes sense.

        That and Im not aware that rhel distros at all have nano built in. Nothing on a random rocky 9 box I randomly sshed into just now.

      • furry toaster@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        4
        ·
        3 days ago

        vim is more feature rich than nano, nano is easier to use for the first time, after you learn the very basics vim is pretty much just as easy to use and way more feature rich

        • ulterno@programming.dev
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 days ago

          One +ive for nano is that it has general commands listed down below, by default.
          So, as long as you understand ^ and M-, which you are expected to (idk why, ask sbd else), if you have been using Linux CLI, you will at least know how to exit.

          Oh, and I just realised: it also says “[ Welcome to nano. For basic help, type Ctrl+G. ]”, where it explains what ^ and M- are.

          So nano could be considered an accessibility program for people who are new to the GeNerally Used CLI, while vim is the thing you will configure for yourself when you know what you want.
          Oh and I am definitely configuring it. I hate the hjkl for movement. I have arrow keys and I am going to use them. And I am not buying your 60% mechanicals no matter how much you make sure that 100% keyboards are not available with good keys.

          • littleomid@feddit.org
            link
            fedilink
            English
            arrow-up
            2
            ·
            2 days ago

            Agree with your point on nano. I used it as a beginner too, but once you get past the basic typing something in, vim is king.

            However, I disagree with the rest of your post. Hjkl are superior to arrow keys once you get used to them. I thought that day would never come, but I got used to it way quicker than initially anticipated.

            As a 60% owner and 34 key ergo advocator, also disagree with the last point.

            • ulterno@programming.dev
              link
              fedilink
              English
              arrow-up
              1
              ·
              2 days ago

              Hjkl are superior to arrow keys once you get used to them.

              I disagree with this point. I am able to use them quite functionally and I still want my arrow keys, because they are arrow keys. Also, you can use them without exiting INSERT mode.

              I do however, agree with your last point.[1]

              Oh, and I also don’t like the pseudo ergonomics of mechanical keyboards.
              All they do is make it harder to use with a more relaxed hand position.


              1. I agree with the fact that you disagree with me. Nothing else. ↩︎

      • nous@programming.dev
        link
        fedilink
        English
        arrow-up
        3
        ·
        3 days ago

        What editor is more feature-rich then vim? Out the box it is lacking some sane config but it is one of the more powerful and flexible editors out there - more then a rival for any modern IDE.