Upgrade to Pro — share decks privately, control downloads, hide ads and more …

When & why you should stay out of visual mode

nelstrom
January 29, 2013

When & why you should stay out of visual mode

nelstrom

January 29, 2013
Tweet

More Decks by nelstrom

Other Decks in Programming

Transcript

  1. v{motion}{command} VISUAL OPERATIONS (Vim at it’s most user-friendly) v engage

    visual mode {motion} select the range of text to act upon
  2. v{motion}{command} VISUAL OPERATIONS (Vim at it’s most user-friendly) v engage

    visual mode {motion} select the range of text to act upon {command} execute
  3. COMMAND EFFECT HELP {Visual}u Make highlighted text lowercase :help v_u

    gu{motion} Make {motion} text lowercase :help gu DOWNCASING
  4. gu it it u v . downcase next 3 characters

    downcase inner tag VISUAL OPERATOR OPERATOR- PENDING Vs.
  5. COMMAND EFFECT HELP {Visual}gw Format the highlighted text :help v_gw

    gw{motion} Format the lines that {motion} moves over :help gw HARD-WRAPPING
  6. gq ip ip gq v . reformat next 4 lines

    reformat inner paragraph VISUAL OPERATOR OPERATOR- PENDING Vs.
  7. Operator, the true power of Vim by Kana Natsuno http://whileimautomaton.net/2008/11/vimm3/operator

    Practical Vim, Tip 23 Prefer operators to Visual commands where possible http://pragprog.com/book/dnvim/practical-vim FURTHER READING