tags:

views:

154

answers:

2

I'm using VIM do alot of work for me using the macros.

There's alot of text in columns and I want the macro to move between columns effortlessly by pressing the w key to "move to the beginning of the next word"

For example:

DataSourceName            string                       ""   
DetailFields              []string                          
DynamicControlBorder      boolean                 empty  may be void 
EscapeProcessing          boolean                    True   
FetchDirection            long                       1000   
FetchSize                 long                         12   
Filter                    string                       ""   
GroupBy                   string                       ""   
HavingClause              string                       ""

However when I do this, VIM only does this for letters; whenever it encounters a "[" or a " it interprets this as another word, messing up the macro because it now appears that there is an additional column.

Is there any setting I can change to make vim ignore the special characters and treat them just like the letters by skipping over them?

[Update]

I found an even better answer to this question over at superuser.com:

http://superuser.com/questions/12679/is-there-anyway-to-have-vim-not-count-special-characters-as-words/12828#12828

+6  A: 

The W command (Shift+W) moves to the next word delimited only by spaces, not whatever Vim is configured to consider a "word" (as unshifted w does).

Greg Hewgill
@Greg, maybe clarify that you mean capital W there to distinguish?
Rob Wells
Fixed, thanks..
Greg Hewgill
+6  A: 

You could make the special characters a part of word, see the iskeyword option. In your case you could simply try the following commands:

:set iskeyword+=[
:set iskeyword+=]
zoul
Thanks chief! That did the trick :)
leeand00
Found an even more elaborate answer to this same question over at Superuser for anybody that's interested:http://superuser.com/questions/12679/is-there-anyway-to-have-vim-not-count-special-characters-as-words/12828#12828
leeand00