• barsquid@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    3 months ago

    It is easy, though? I cannot even use it correctly. I just know some of the commands and that if you hold down shift it goes backwards.

    • Voytrekk@lemmy.world
      link
      fedilink
      arrow-up
      14
      ·
      3 months ago

      I’m a vim user and I would say it’s not. It’s very powerful, but only once you become familiar with the commands.

      Nano is a better default for the average user because it works in a way most users would expect for a text editor to work.

    • ysjet@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      3 months ago

      Honestly, these days it’s pretty simple. The thing you need to remember is that you do not need to know EVERYTHING all at once. Learn a little bit, use it, keep what you use, discard what you don’t, get it in muscle memory, and learn a bit more. Very quickly you’ll be zooming through vim.

      You can learn the basics, and go from there- the basics of vim (which imo everyone should know- vi is often the fallback editor), and then you can just casually learn stuff as you go.

      Here’s the basics for modern default/standard vim: Arrow keys move you around like you expect in all ‘modes’ (there’s some arguments about if you should be using arrow keys in the vim community- for now, consider them a crutch that lets you learn other things). There’s two ‘modes’- command mode, and edit mode.

      Edit mode acts like a standard, traditional text editor, though a lot of your keybinds (e.g. ctrl-c/ctrl-v) don’t work.

      Press escape to go back into command mode (in command mode, esc does nothing- esc is always safe to use. If you get lost/trapped/are confused, just keep hitting escape and you’ll drop into command mode). You start vim in command mode. Press i to go into edit mode at your current cursor position.

      To exit vim entirely, go to command mode (esc), and type :wq<enter>.

      ‘:’ is ‘issue command string’,

      ‘w’ is ‘write’, aka save,

      ‘q’ is quit.

      In other words, ‘:wq’ is ‘save and quit’

      ‘:q’ is quit without saving, ‘:w’ is save and don’t quit. Logical.

      Depending on your terminal, you can probably select text with your mouse and have it be copied and then pasted with shift-ins in edit mode, which is a terminal thing and not a vim thing, because vim ties into it natively.

      That gets you started with basically all the same features as nano, except they work in a minimal environment and you can build them up to start taking advantage of command mode, which is where the power and speed of vim start coming into play.

      For example ‘i’ puts you in edit mode on the spot- capital i puts you in command mode at the beginning of the line. a is edit mode after your spot- capital A is edit mode at the end of the current line.

      Do you need these to use vim? Nope. Once you learn them, start using them, and have them as muscle memory, is it vastly faster to use? Yes. And there’s hundreds of keybinds like that, all of which are fairly logical once you know the logic behind them- ‘insert’ and ‘after’ for i/a, for example.

      Fair warning, vim is old enough that the logic may seem arcane sometimes- e.g. instead of ‘copy and paste’ vim has ‘yank and put,’ because copy/paste didn’t exist yet, so the keybinds for copy/paste are y and p.

      • wise_pancake@lemmy.ca
        link
        fedilink
        arrow-up
        3
        ·
        3 months ago

        The second most important thing about vim to learn is:

        If nothing is behaving then you probably have caps lock on.

    • s_s@lemm.ee
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 months ago

      Vim makes it easy to edit text in complicated ways, once you’ve learned it.

      Vim is not easy to learn nor intuitive.

      It is simple and compounding.

      You might not ever edit enough text to ever need to learn a new skillset to edit text. If that’s the case, use nano.

      But if you do find yourself editing a lot of text, consider trying vimtutor.

      It takes 20 minutes and you’ll be proficient enough to match nano’s efficiency ceiling.