You can configure different styles of C/C++ indenting by setting 'cindent' and 'cinoptions'.
See :help cinoptions-values for more details on what can be configured and :help C-indenting for information on C indenting in general.
You can have different settings for C and C++ by placing your configuration in two locations:
In ~/.vim/after/ftplugin/c.vim:
set cindent
set cinoptions=<the options you want for C>
In ~/.vim/after/ftplugin/cpp.vim:
set cindent
set cinoptions=<the options you want for C++>
You might also like to take a look at this question about using clang-format for the = command.
Vim also allows you to set up completely custom indenting using an indent expression. (See :help 'indentexpr') This is what the script you mention in the comments does. You can install that for CPP by renaming the file and placing it in the location:
~/.vim/indent/cpp.vim
You can find more details at :help 30.3 and :help indent-expression.
line 17: sourcing "/home/eof/.config/nvim/after/ftplugin/cpp/google.vim" finished sourcing /home/eof/.config/nvim/after/ftplugin/cpp/google.vimHowever, if I typeint main(void) {and hit enter in a buffer named test.cc (I see cpp in airline, so it's in the right mode), the cursor jumps to column 8 instead of column 2. – eof Jan 25 '18 at 08:59