~gpanders/dotfiles

ref: 12291d3163062a0a3c879f53a0b0d02541376ca4 dotfiles/vim/.vim/after/ftplugin/c.vim -rw-r--r-- 604 bytes
12291d31Greg Anders [vim] Make git commit buffers in vim always start at line 1 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
" C
if &filetype !=# 'c'
  finish
endif

" Set comment string
setlocal commentstring=//%s

" Include macros in completion
setlocal complete+=i,d

" Set include pattern
setlocal include=^\\s*#\\s*include

" Use improved :Man command as keywordprg
setlocal keywordprg=:Man

" Include headers on Unix
if has('unix')
  if g:os ==# 'Darwin'
    setlocal path+=/usr/local/opt/llvm/include/c++/v1
  else
    setlocal path+=/usr/include
  endif
endif

let b:undo_ftplugin .= '|setl cms< cpt< inc< path< kp<'

if executable('clang-format')
  setlocal formatprg=clang-format
  let b:undo_ftplugin .= ' fp<'
endif