Monday, June 16, 2008

vim+sed scripts to conform a file to coding standards

I have created sed scripts (that run within vim) which can fix up your source code file to conform to coding-style of the kernel.

This one adds space after every comma:
:%s/,\([^ ]\)/, \1/g

This one adds space before and after every +=,==
:%s/\([^ ]*\)\([+=]\+=\)\([^ ]*\)/\1 \2 \3/g

Stay tuned for more!

No comments: