I work on a team of 4-person engineers, mostly writing javascript, and sometimes doing ruby ββand python. So, as a team, we use code all the time, and as most programmers do, each member of the team has their own favorite level of indentation and related settings. I am one of two team members who use and love Vim as the main code editor. I like my command, but I also like my indentation, which is used to use 4 space characters. For more context, here is what I use in my .vimrc:
set ts = 4 sts = 4 sw = 4 expandtab " 4 space tabs
Due to the large amount of code exchange and co-editing in a team, the main code files usually begin to appear as an array of mixed tables and spaces, so even the classic Vim trick for selecting all and pressing = for smart indentation does not have much effect.
Anyway, my question is this: in Vim (MacVim specifically) is there a better (more reliable) way to convert a code file from a dirty mixed indent to my preferred indent? Whether it's the .vimrc parameter or the command I entered when editing the file, I don't care.
Thanks for any suggestions in advance!
source share