Skip to content

Commit

Permalink
Add support for Objective C++ (#481)
Browse files Browse the repository at this point in the history
Add definition for Objective C++ files for uncrustify, clang-format and astyle
  • Loading branch information
ethanol20924 authored Nov 10, 2023
1 parent 51f0eef commit e5fe7e8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ that caused Neoformat to be invoked.
- [`uncrustify`](http://uncrustify.sourceforge.net),
[`clang-format`](http://clang.llvm.org/docs/ClangFormat.html),
[`astyle`](http://astyle.sourceforge.net)
- Objective-C++
- [`uncrustify`](http://uncrustify.sourceforge.net),
[`clang-format`](http://clang.llvm.org/docs/ClangFormat.html),
[`astyle`](http://astyle.sourceforge.net)
- OCaml
- [`ocp-indent`](http://www.typerex.org/ocp-indent.html),
[`ocamlformat`](https://github.com/ocaml-ppx/ocamlformat),
Expand Down
20 changes: 20 additions & 0 deletions autoload/neoformat/formatters/objcpp.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function! neoformat#formatters#objcpp#enabled() abort
return ['uncrustify', 'clangformat', 'astyle']
endfunction

function! neoformat#formatters#objcpp#uncrustify() abort
return {
\ 'exe': 'uncrustify',
\ 'args': ['-q', '-l OC+'],
\ 'stdin': 1,
\ }
endfunction

function! neoformat#formatters#objcpp#clangformat() abort
return neoformat#formatters#c#clangformat()
endfunction

function! neoformat#formatters#objcpp#astyle() abort
return neoformat#formatters#c#astyle()
endfunction

4 changes: 4 additions & 0 deletions doc/neoformat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,10 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes*
- [`uncrustify`](http://uncrustify.sourceforge.net),
[`clang-format`](http://clang.llvm.org/docs/ClangFormat.html),
[`astyle`](http://astyle.sourceforge.net)
- Objective-C++
- [`uncrustify`](http://uncrustify.sourceforge.net),
[`clang-format`](http://clang.llvm.org/docs/ClangFormat.html),
[`astyle`](http://astyle.sourceforge.net)
- OCaml
- [`ocp-indent`](http://www.typerex.org/ocp-indent.html),
[`ocamlformat`](https://github.com/ocaml-ppx/ocamlformat),
Expand Down

0 comments on commit e5fe7e8

Please sign in to comment.