• floofloof@lemmy.ca
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    7 months ago

    Being able to do things like “Delete everything inside these parentheses”. di( or “wrap this line and the two lines below in a pair of {}” ys2j{ , or “swap this parameter with the next one” cxia]a. with a single shortcut is game changing.

    Those are handy, but most IDEs make at least the second two easy to do without reaching for the mouse (not sure about the first one), and for most people the other conveniences offered by IDEs are pretty attractive. I do use vim when I’m working in the terminal though, because it’s solid and handles large files better than anything else I know.

    • Hexarei@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      7 months ago

      I have most of the features of an IDE in my neovim config; name a feature and there’s almost certainly a plugin for it!

      Those are just a few small examples. One of my favorite things that vim enables for me is working with text objects. Things like functions, variables, classes, conditionals, paramters… Etc. Any action works with any text object - Want to jump to the next function in the file? Copy everything inside of a conditional? Cut everything up to (but not including) the nearest capital D on the line? Delete just the word your cursor is in the middle of (and one of the spaces around it)? Delete the current line and the N lines below it?

      The motions make editing code incredibly fast, and I still have modern features like variable completion, copilot, intellisense, ‘jump to definition’, “hover” information, fuzzy search in project… Name a feature. I highly recommend giving it a closer look for stuff like that.

      • floofloof@lemmy.ca
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        7 months ago

        That does sound pretty good, and all without an IDE that hangs several times a day too. I haven’t really taken advantage of vim’s power.