• owsei@programming.dev
    link
    fedilink
    arrow-up
    8
    ·
    3 months ago

    Vim has several modes. INSERT mode let’s you write text, NORMAL mode let’s you navigate (with h,j,k,l and others) and perform operations on the text with your keyboard, like “dw” to Delete Word or “A” to enter insert mode at the end of the line.

    You can use arrow keys to navigate in insert mode. However I just press escape, which changes to normal, navigate to where I want to, then change to insert mode.

    I may seem like this makes simple navigation complex, and it kinda does. But complex navigation becomes easier.

    Vi (and vim and neovim)'s primary concern is viewing and editing code, writing is secondary (although it’s still an excellent experience)

    • poinck@lemmy.worlddeleted by creator
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      Oh, I did not know of ‘A’ before. Hopefully I can train myself to use it.

      • SystemDisc@feddit.org
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 months ago

        I use ‘O’ the most. It inserts a newline at the end of the line and starts Insert Mode after the newline.

        • poinck@lemmy.worlddeleted by creator
          link
          fedilink
          arrow-up
          1
          ·
          3 months ago

          Awesome. After many years of vim-use I learned about CTRL+n as well. A game changer.

          And while we’re at it, I also installed vim-nox to be able to use vim-snippets with utilsnips to TAB for even more joy of programming with vim. [=