vim - how am I suppose to read this command to remove all blanks at the end of a line

Posted by whaley on Stack Overflow See other posts from Stack Overflow or by whaley
Published on 2010-06-17T03:18:31Z Indexed on 2010/06/17 3:23 UTC
Read the original article Hit count: 256

Filed under:
|

I happened across this page full of super useful and rather cryptic vim tips at http://rayninfo.co.uk/vimtips.html. I've tried a few of these and I understand what is happening enough to be able to parse it correctly in my head so that I can possibly recreate it later. One I'm having a hard time getting my head wrapped around though are the following two commands to remove all spaces from the end of every line

:%s=  *$==                  : delete end of line blanks
:%s= \+$==                  : Same thing

I'm interpreting %s as string replacement on every line in the file, but after that I am getting lost in what looks like some gnarly variation of :s and regex. I'm used to seeing and using :s/regex/replacement. But the above is super confusing.

What do those above commands mean in english, step by step?

© Stack Overflow or respective owner

Related posts about regex

Related posts about vim