Slide 1

Slide 1 text

29th January, 2013 Drew Neil WHEN & WHY YOU SHOULD STAY OUT OF VISUAL MODE

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

{command}{motion} NORMAL OPERATIONS (the old-school vi way)

Slide 7

Slide 7 text

{command}{motion} NORMAL OPERATIONS (the old-school vi way) {command} execute operation

Slide 8

Slide 8 text

{command}{motion} NORMAL OPERATIONS (the old-school vi way) {command} execute operation {motion} over the specified range

Slide 9

Slide 9 text

COMMAND EFFECT HELP {Visual}u Make highlighted text lowercase :help v_u gu{motion} Make {motion} text lowercase :help gu DOWNCASING

Slide 10

Slide 10 text

gu it it u v . downcase next 3 characters downcase inner tag VISUAL OPERATOR OPERATOR- PENDING Vs.

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

gq ip ip gq v . reformat next 4 lines reformat inner paragraph VISUAL OPERATOR OPERATOR- PENDING Vs.

Slide 13

Slide 13 text

FOR REPETITIVE WORK (where dot is your friend) . PREFER NORMAL OPERATIONS over VISUAL

Slide 14

Slide 14 text

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