~gpanders/dotfiles

ref: c8e63bac959db19c138dcc3198a56514f0b444ff dotfiles/.vim/after/ftplugin/c.vim -rw-r--r-- 806 bytes
c8e63bacGreg Anders Manage dotfiles directly in home directory 1 year, 3 months 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 filetype plugin
" Author: Greg Anders <greg@gpanders.com>

" Set comment string
setlocal commentstring=//%s

" Set include and define patterns
setlocal define&
setlocal include=^\\s*#\\s*include\\s*[\"<]\\@=
setlocal includeexpr&

" Keep lines at 80 characters or fewer
setlocal textwidth=79

" Support /// as a comment leader, used for writing Doxygen comments
setlocal comments-=://
setlocal comments+=:///,://

" Set path
call ft#c#set_path(&filetype)

let b:undo_ftplugin .= '|setl cms< def< inc< inex< path< tw< com<'

" Use improved :Man command as keywordprg
if exists(':Man') == 2
  setlocal keywordprg=:Man
  let b:undo_ftplugin .= '|setl kp<'
endif

if executable('clang-format')
  setlocal formatprg=clang-format\ -style=file\ -fallback-style=LLVM
  let b:undo_ftplugin .= '|setl fp<'
endif