1. 程式人生 > >source insight也可以自動排版

source insight也可以自動排版

eclipse的一個強悍功能,就是可以把程式碼自動排版

但source insight卻不行

不過,有工具和配置,可以幫助完成這個事情:

2,開啟你的SourceInsight, 選擇選單“Options-->Custom Commands-->Add”, 輸入Artistic Style(可以隨便輸入一個名字)。
3,Run中輸入: "C:\Program Files\astyle\astyle.exe" -n -t --style=ansi %f (注意路徑不可以是中文的)

4,Dir留空,將Iconic Window, Pause when done, Wait until done, File,then Line 四項前打上勾。
5,然後點對話方塊中右側的按鈕“Menu”, Menu--->Menu-->View--><end of menu>, 右側Insert, OK.
6,此時在SourceInsight中的View選單下多了個Style的子選單選項,可以用它來對單個C/C++檔案進行格式化。