Skip to content

Commit 9505158

Browse files
randrejrhysd
authored andcommitted
Added Arduino support (rhysd#63)
Arduino's language has been supported by vim (ft=arduino) for a while (3+ years) and it's pretty much plain C++. Users should be able to use ClangFormat to format it.
1 parent c1c9bd1 commit 9505158

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugin/clang_format.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ command! -range=% -nargs=0 ClangFormatEchoFormattedCode echo clang_format#format
1919
augroup plugin-clang-format-auto-format
2020
autocmd!
2121
autocmd BufWritePre *
22-
\ if &ft =~# '^\%(c\|cpp\|objc\|java\|javascript\|typescript\|proto\)$' &&
22+
\ if &ft =~# '^\%(c\|cpp\|objc\|java\|javascript\|typescript\|proto\|arduino\)$' &&
2323
\ g:clang_format#auto_format &&
2424
\ !clang_format#is_invalid() |
2525
\ call clang_format#replace(1, line('$')) |
2626
\ endif
27-
autocmd FileType c,cpp,objc,java,javascript,typescript,proto
27+
autocmd FileType c,cpp,objc,java,javascript,typescript,proto,arduino
2828
\ if g:clang_format#auto_format_on_insert_leave &&
2929
\ !clang_format#is_invalid() |
3030
\ call clang_format#enable_format_on_insert() |
3131
\ endif
32-
autocmd FileType c,cpp,objc,java,javascript,typescript,proto
32+
autocmd FileType c,cpp,objc,java,javascript,typescript,proto,arduino
3333
\ if g:clang_format#auto_formatexpr &&
3434
\ !clang_format#is_invalid() |
3535
\ setlocal formatexpr=clang_format#replace(v:lnum,v:lnum+v:count-1) |

0 commit comments

Comments
 (0)