The general way to change the indentation is to change the tab:
Paste your file into an empty buffer, then:
:set ts=2 sts=2 noet :retab!
This changes every 2 spaces to a TAB character, and then:
:set ts=4 sts=4 et :retab
This changes each TAB to 4 spaces.
The advantage of this method is that you can also use it in another way, for example, to convert from 4 to 2 spaces.
Daan Bakker Jun 03 '13 at 7:42 on 2013-06-03 07:42
source share