@@ -18,21 +18,21 @@ command! -range=% -nargs=0 ClangFormatEchoFormattedCode echo clang_format#format
1818
1919augroup plugin - clang- format- auto- format
2020 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 (' $' )) |
2626 \ 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 () |
3131 \ 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 ) |
3636 \ endif
3737augroup END
3838
0 commit comments