• graycube@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    6 hours ago

    Instead of using the arrow keys most vi & him users navigate the cursor around the doc by using letter keys. I do it so subcociously now I am not sure which direction is the j when I use my phone.

      • owsei@programming.dev
        link
        fedilink
        arrow-up
        4
        ·
        4 hours 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)

      • NominatedNemesis@reddthat.com
        link
        fedilink
        arrow-up
        3
        ·
        4 hours ago

        Yes, (neo)vi(m) has different modes, in normal mode the characters are shortcuts, hjkl is used for navigation. However other methods are prefered, w, e, b - jumping words, f,t - jumping to a specific character etc. Its way faster. Also it can be combined d2w (d)eletes the next (2) (w)ord. Or more advanced di" (d)eletes the text (i)nside the “…”

        Insert mode is what you except: it writes what you type. Can be accessed by i - (i)nsert before a - (a)append after. Going back to normal mode is ESC (or many configure tab)