{"id":50,"description":"vim - clear all trailing whitespaces","tags":["linux","vim","tools"],"contents":["\" function to clear trailing white spaces","fun! TrimTrailingWhiteSpace()","    let l:save = winsaveview()","    keeppatterns %s/\\s\\+$//e","    call winrestview(l:save)","    \" without saving and restoring the view, the cursor","    \" moves to the line of the last search result where","    \" the edit is made","endfun","","\" Use a shortcut to invoke the function","\" for e.g. I use the leader key \\ followed by w","\\ + w to clear the trailing whitespace",":noremap \u003cLeader\u003ew :call TrimTrailingWhiteSpace()\u003cCR\u003e"]}
