aboutsummaryrefslogtreecommitdiff
path: root/vim/after/indent/c.vim
blob: 9cea0a2dae0871686ba54096cdabc6ee1a7f136f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
" Use plain old tabs for indent in C files
setlocal noexpandtab
let b:undo_indent .= '|setlocal expandtab<'
if v:version > 703
      \ || v:version == 703 && has('patch629')
  setlocal shiftwidth=0
else
  let &l:shiftwidth = &l:tabstop
endif
let b:undo_indent .= '|setlocal shiftwidth<'
if &softtabstop != -1
  let &l:softtabstop = &l:shiftwidth
  let b:undo_indent .= '|setlocal softtabstop<'
endif

" If the path to the file looks like the Vim sources, set 'shiftwidth' to 4
if expand('%:p') =~# '/vim.*src/'
  setlocal shiftwidth=4
endif