[issue5611] Auto-detect indentation in C source in vimrc

Kirk McDonald report at bugs.python.org
Mon Mar 30 20:10:46 CEST 2009


New submission from Kirk McDonald <kirklin.mcdonald at gmail.com>:

According to PEP 7, older C source files are indented with tabs, and
newer ones are indented with spaces. The vimrc file in the repository
assumes that existing C source files should be indented with tabs, and it
should indent with spaces when you create a new C source file. This has
an obvious drawback: It will configure vim to use tabs when you edit a
file that in fact uses spaces.

The attached patch will search for the regex '^\t'; if it is found, vim
will be configured to use tabs and an 8-column shiftwidth; and if it is
not found, it will be configured to use spaces and a 4-column shiftwidth.

----------
components: Demos and Tools
files: vimrc.diff
keywords: patch
messages: 84602
nosy: KirkMcDonald
severity: normal
status: open
title: Auto-detect indentation in C source in vimrc
versions: Python 2.7
Added file: http://bugs.python.org/file13477/vimrc.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5611>
_______________________________________


More information about the Python-bugs-list mailing list