Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1b283c5

Browse files
committed
Change C code to use 4-space indents.
Highlighting tab indents is off at the moment since that would be rather noisy, but should be turned on in the future when conversion to the new indentation style has been done.
1 parent d624f18 commit 1b283c5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Misc/Vim/vimrc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
" Number of spaces to use for an indent.
2020
" This will affect Ctrl-T and 'autoindent'.
2121
" Python: 4 spaces
22-
" C: tab (8 spaces)
23-
au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
24-
au BufRead,BufNewFile *.c,*.h set shiftwidth=8
22+
" C: 4 spaces
23+
au BufRead,BufNewFile *.py,*pyw,*.c,*.h set shiftwidth=4
2524

2625
" Number of spaces that a pre-existing tab is equal to.
2726
" For the amount of space used for a new tab use shiftwidth.
@@ -32,16 +31,17 @@ au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=8
3231
" Replace tabs with the equivalent number of spaces.
3332
" Also have an autocmd for Makefiles since they require hard tabs.
3433
" Python: yes
35-
" C: no
34+
" C: yes
3635
" Makefile: no
37-
au BufRead,BufNewFile *.py,*.pyw set expandtab
38-
au BufRead,BufNewFile *.c,*.h set noexpandtab
36+
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h set expandtab
3937
au BufRead,BufNewFile Makefile* set noexpandtab
4038

4139
" Use the below highlight group when displaying bad whitespace is desired
4240
highlight BadWhitespace ctermbg=red guibg=red
4341

4442
" Display tabs at the beginning of a line in Python mode as bad
43+
" Should be done for C code, but not until all code has been moved to 4-space
44+
" indents.
4545
au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
4646

4747
" Wrap text after a certain number of characters

0 commit comments

Comments
 (0)