Thursday, March 25, 2010

'w' command to actually move to the next word

Is there any way to get vim's 'w' command (and similar) to move from word to word?

E.g.:   tar <foo bar="jar">

I want vim to see this as 4 words separated by non-words (i.e. whitespace and punctuation). After all, tar, foo, bar and jar are words and =" is certainly not a word! And that's how I want vim to behave. I want to be on 't' and hitting '3w' should take me to 'j'.

Obviously I want this to work with all punctuation, :;,.- etc.

Thanks!

No comments: