TAB替换为空格: :set ts=4 :set expandtab :%retab!
空格替换为TAB: :set ts=4 :set noexpandtab :%retab!
加!是用于处理非空白字符之后的TAB,即所有的TAB,若不加!,则只处理行首的TAB。