Tuesday, November 1, 2011

function to apply multiple whole-file substitutions

Greetings all,

I'm trying to craft a function to apply a series of pattern-matching substitutions to the file. So far I've got this in my .vimrc

function Scrub ()
:%s// /g
:%s/\s*$//g
endfunction
map :call Scrub ()

but it's not working, seems to complain about lack of line-endings. Would someone help me out please?



Trick-or-treat,

Still-learning Steve


Get your own email service at ZZN.COM.

No comments: