Cleaning trailing spaces in vim and neovim

I’m not sure where this all started. I’m pretty sure that at some point in a place I used to work at, we tried to normalize our code and get rid of trailing whitespaces was a part of that. Since then, I’ve always kept this bit of configuration, but the way I do this evolved over time. Here are a few solutions I used to get rid of these unnecessary trailing spaces. Solution 1: using a custom…