If you are using Emacs as your default editor, you can use following setting for auto style checking.
在~/.emacs 目录下配置文件 .emacs 此文件是隐藏文件 配置结束后不用source命令,直接emacs -nw filename 打开即可!
(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(auto-compression-mode t nil (jka-compr))
'(auto-save-default nil)
'(case-fold-search t)
'(current-language-environment "UTF-8")
'(default-input-method "rfc1345")
'(global-font-lock-mode t nil (font-lock))
'(make-backup-files nil)
'(show-paren-mode t nil (paren))
'(transient-mark-mode t))
(custom-set-faces
;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
)
(setq-default indent-tabs-mode nil)
(add-hook 'c-mode-common-hook ( lambda() ( c-set-style "stroustrup" ) ) )
(add-hook 'c++-mode-common-hook ( lambda() ( c-set-style "stroustrup" ) ) )
(line-number-mode 1)
(column-number-mode 1)