@@ -18,21 +18,21 @@ command! -range=% -nargs=0 ClangFormatEchoFormattedCode echo clang_format#format
18
18
19
19
augroup plugin - clang- format- auto- format
20
20
autocmd !
21
- autocmd BufWritePre *
22
- \ if &ft = ~# ' ^\%(c\|cpp\|objc\|java\|javascript\|typescript\)$' &&
23
- \ g: clang_format #auto_format &&
24
- \ ! clang_format#is_invalid () |
25
- \ call clang_format#replace (1 , line (' $' )) |
21
+ autocmd BufWritePre *
22
+ \ if &ft = ~# ' ^\%(c\|cpp\|objc\|java\|javascript\|typescript\|proto\ )$' &&
23
+ \ g: clang_format #auto_format &&
24
+ \ ! clang_format#is_invalid () |
25
+ \ call clang_format#replace (1 , line (' $' )) |
26
26
\ endif
27
- autocmd FileType c,cpp,objc,java,javascript,typescript
28
- \ if g: clang_format #auto_format_on_insert_leave &&
29
- \ ! clang_format#is_invalid () |
30
- \ call clang_format#enable_format_on_insert () |
27
+ autocmd FileType c,cpp,objc,java,javascript,typescript,proto
28
+ \ if g: clang_format #auto_format_on_insert_leave &&
29
+ \ ! clang_format#is_invalid () |
30
+ \ call clang_format#enable_format_on_insert () |
31
31
\ endif
32
- autocmd FileType c,cpp,objc,java,javascript,typescript
33
- \ if g: clang_format #auto_formatexpr &&
34
- \ ! clang_format#is_invalid () |
35
- \ setlocal formatexpr = clang_format#replace (v: lnum ,v: lnum+ v: count- 1 ) |
32
+ autocmd FileType c,cpp,objc,java,javascript,typescript,proto
33
+ \ if g: clang_format #auto_formatexpr &&
34
+ \ ! clang_format#is_invalid () |
35
+ \ setlocal formatexpr = clang_format#replace (v: lnum ,v: lnum+ v: count- 1 ) |
36
36
\ endif
37
37
augroup END
38
38
0 commit comments