At work, we use vim for our editing needs – which, as programmers, means we spend our day in vim.
We have a lot of mixed-format code – sometimes it has tabs, sometimes it has spaces. Personally, I prefer spaces for my indenting, but I’m a convert to the church of make-your-code-match-the-existing-code. As opposed to reformatting the existing code, which is soooo irresistible until you’re faced with a mountain.
So, I have to switch back and forth a lot. Here, for the sake of posterity, is how to switch from spaces to tabs on-the-fly in vim: