~gpanders/dotfiles

ref: 1e9f8dd001f12b57c7ff1b45adb7c59541b752c6 dotfiles/.vim/after/ftplugin/c.vim -rw-r--r-- 899 bytes
1e9f8dd0Gregory Anders fish: remove fuzzy finder from buku alias 6 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
34
35
36
37
38
" 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=80

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

" Set path
call ft#c#set_path()

" Create and set tags file
call ft#c#tags(v:false)

augroup ftplugin_c
  autocmd!
  autocmd BufWritePost <buffer> call ft#c#tags(v:true)
augroup END

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

" 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=none
  let b:undo_ftplugin .= '|setl fp<'
endif