For Visual C++1, Menu: Tools->Customize; Tab: Tools
2, Add Command:
Command : astyle.exe
Arguments : --style=linux --mode=c -S -C --pad=oper $(FileName)$(FileExt)
Initial Dir: $(FileDir)
For Eclipse1, External Tools, Programs->new
2,

3, refresh the specila resource after reload.
2 Comments:
1, it is refresh select resourse.
2, Window->Preferences->Run/Debug->Launching
Uncheck "Build before launching"
By
Xin, Qian, At
12:41 PM
integrate with emacs
(defvar astyle-command "astyle -p --style=gnu")
(defun astyle-region (start end)
"Run astyle on region, formatting it in a pleasant way."
(interactive "r")
(save-excursion
(shell-command-on-region start end astyle-command nil t)
(indent-region start end nil)))
(defun astyle-buffer ()
"Run astyle on whole buffer, formatting it in a pleasant way."
(interactive)
(save-excursion
(astyle-region (point-min) (point-max))))
(add-hook 'c-mode-common-hook
'(lambda ()
(define-key c-mode-map "\C-cr" 'astyle-region)
(define-key c-mode-map "\C-cb" 'astyle-buffer)
(define-key c++-mode-map "\C-cr" 'astyle-region)
(define-key c++-mode-map "\C-cb" 'astyle-buffer)))
By
Xin, Qian, At
3:18 PM
Post a Comment
Subscribe to Post Comments [Atom]
<< Home