I am surprised, but after searching, I cannot find an emacs configuration that I can use to have emacs follow Google Java Style.
If there is such a configuration already available I would appreciate links to it.
Otherwise, how would I create such a configuration?
UPDATE:
The most basic thing I would like to learn : what customization variables do I set to get 2 spaces for block indentation and 4 spaces for continuation lines?
Put https://github.com/google/styleguide/blob/gh-pages/google-c-style.el on your load path, such as in ~/.emacs.d/.
Then, in your Emacs init file, add:
;; Also works for Java.
(autoload 'google-set-c-style "google-c-style")
(autoload 'google-make-newline-indent "google-c-style")
(add-hook 'c-mode-common-hook 'google-set-c-style)
(add-hook 'c-mode-common-hook 'google-make-newline-indent)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With