Python“八荣八耻”中建议,自动缩进使用4个空格而非Tab,因为不同地方Tab代表的空格数可能不一样。因此最好在vim中配置Python的自动缩进为4个空格: 修改VIM的配置: autocmd FileType python setlocal et sta sw=4 sts=4