10 years ago
This command trims trailing spaces and moves the cursor back to its initial position.
command! -range=% TR mark ` | execute <line1> . ',' . <line2> . 's/\s\+$//' | normal! ``