在编辑“*.py”文件而不是其他任何文件时,如何让tab键插入4个空格?
根据Vim and PEP 8 -- Style Guide for Python Code的建议,我安装了vim-flake8(和vim病原体)。当违反PEP8风格的指导方针时,这会发出警告。这很好,但是我希望在编辑python文件时首先自动展开选项卡。我想让tab键在编辑其他类型的文件时实际插入制表符。
换句话说,当我编辑python文件并且只编辑python文件时,我希望应用以下内容:
set expandtab " tabs are converted to spaces
set tabstop=4 " numbers of spaces of tab character
set shiftwidth=4 " numbers of spaces to (auto)indent
或者更短:
相关问题 更多 >
编程相关推荐