Skip to main content

Remove trailing spaces using vim

This little function will remove trailing space and maintain your position in a file. I started with something like this.

    " Removes trailing spaces
    function! TrimWhiteSpace()
        %s/+$//e
    endfunction

I found that it left me at the bottom of my file, and I kept forgetting to mark my position before running it. After a little research I found this solution, it saves your positon and returns it to you after it's done.


Thanks to stphancheg on stack overflow
Post a Comment

Popular posts from this blog

S&P Rating, tea parties and the mad hatter.

This past week the S&P downgraded the USA credit rating from AAA to AA, this now puts us on the same footing as Spain.  All in all it appears to me as part of generalized push to decapitalize and delegitimize government in general. To force the out sourcing of the key infrastructure projects to private corporate entities, much like is done in places like Nigeria, and Colombia. Whether it's the "Tea party" or not, sharks are in the water and instead of tossing our buckets overboard to lighten the load, we need to gather all hands and use them to bail ourselves out.

We all benefit when government is involved in maintaining things like access to water, electricity, roads, and basic health care. The History of this great nation is filled with examples of government subsidies going to private industry to create wealth. To think that private corporations, or even individuals have produced this wealth _ex nihilo_ with only their sweat is hubris. It is to forget that we all…