up vote 2 down vote favorite
share [g+] share [fb]

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?

link|improve this question

67% accept rate
This is borderline a stackoverflow.com question since it's mostly programmers who use vim, you'll have better luck getting it answered there. – Charles Ma Jul 25 '09 at 5:01
@cma Okay moved question here: stackoverflow.com/questions/1182012/… – leeand00 Jul 25 '09 at 12:29
feedback

1 Answer

up vote 1 down vote accepted

You can change the definition of a word in vim by using

:set iskeyword=<specification>

Remeber to change it back, though, when you have finished with the special usage.

:set iskeyword?

will show the current usage. My terminal responds with

iskeyword=@,48-57,_,192-255

for all the letters a-z and A-Z (@), digits 0 to 9 (ASCII 48-57), underscore and international letters (ASCII 192-255)

link|improve this answer
Wow that's a better answer then I got over on Stackoverflow (almost the same but better! Thanks! – leeand00 Jul 27 '09 at 23:44
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.