How do I convert between tabs and spaces in a visual selection?
:'<,'>retab!
The :retab! command converts between tabs and spaces based on your expandtab setting.
:'<,'>retab!
The :retab! command converts between tabs and spaces based on your expandtab setting.
autocmd BufWritePre * :%s/\s\+$//e
By adding an autocmd for the BufWritePre event, you can make Vim automatically strip trailing whitespace from every line each time you save.