How do i change the c coding style format in emacs ? Specifically i need to change the indentation in the c code shown 开发者_如何学运维by emacs from i per block to 2 per block
Type M-x followed by "customize-mode" followed by "c-mode". Then use the built-in customization page to override the default "C Basic Offset" with your new value of "2". When you're done, be sure to select "Save for future sessions" at the top of the page.
Among the built-in indentation styles, "gnu" has an indentation width of 2 characters. You can choose an indentation style with c-set-style
, bound to C-c..
Take a look at http://code.google.com/p/google-styleguide/
There is ready to use macro. You can customize it if you want.
精彩评论