• sem@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 hours ago

    I keep thinking that as I use vim, I’ll feel the need to learn more commands, but I hardly do anything except:

    • q, wq, or q!, quit with or without saving
    • i, insert
    • set:paste, preserves spacing
    • Shift-insert, pastes if shift-ctrl-v doesn’t work
    • / , search for a string (iirc, don’t really need it much).

    What are your vim GOTOs?

    • Stitch0815@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      4 hours ago

      My most used commands are also just the classics

      cw - delete the next word amd enter insert mode

      dd - delete line

      gg - go to first line

      G - go to last line

      :s/searchphrase/replacephrase - search and replace

      And a couple of visual mode commands do cut and paste blocks or comment out blocks of code

      • GiveOver@feddit.uk
        link
        fedilink
        arrow-up
        2
        ·
        2 hours ago

        To build on cw:

        ciw works when the cursor is anywhere in the word

        ci( to delete everything between brackets and enter insert mode. Also ci" ciW or whatever