1好渠、我的風格
vim ~/.indent.pro
-bad -bap -bbb -bbo -nbc -bli0 -c33 -cd33 -ncdb -cli0 -cp33 -d0 -nbfda -di2 -nfc1 -nfca -hnl -ip5 -l75 -lp -pcs -nprs -psl -saf -sai -saw -nsc -nsob -nss -i4 -ts4 -ut
2文虏、常用參數(shù)
長格式參數(shù) | 短格式參數(shù) | 含義 |
---|---|---|
--blank-lines-after-declarations | -bad | 變量聲明后加空行 |
--blank-lines-after-procedures | -bap | 函數(shù)結(jié)束后加空行 |
--blank-lines-before-block-comments | -bbb | 塊注釋前加空行 |
--break-before-boolean-operator | -bbo | 對于較長的行,在邏輯運算符之前分行 |
--blank-lines-after-commas | -nbc | 變量聲明中坷备,逗號分隔的變量不分行 |
--braces-after-if-line | -bl | "if"和"{"分做兩行 |
--brace-indent 0 | -bli0 | "{"不繼續(xù)縮進 |
--braces-after-struct-decl-line | -bls | 定義結(jié)構(gòu)體時熄浓,"struct"和"{"分行 |
--comment-indentationn | -c33 | 語句后注釋開始于行33 |
--declaration-comment-columnn | -cd33 | 變量聲明后注釋開始于行33 |
--comment-delimiters-on-blank-lines | -ncdb | 不將單行注釋變?yōu)閴K注釋 |
--cuddle-do-while | -ncdw | "do ... while"的"while"和其前面的"}"另起一行 |
--cuddle-else | -nce | "else"和其前面的"}"另起一行 |
--case-indentation 0 | -cli0 | switch中的case語句縮進0個空格 |
--else-endif-columnn | -cp33 | #else, #endif后面的注釋開始于行33 |
--space-after-cast | -cs | 在類型轉(zhuǎn)換后面加空格 |
--line-comments-indentation n | -d0 | 單行注釋(不從1列開始的),不向左縮進 |
--break-function-decl-args | -nbfda | 關(guān)閉:函數(shù)的參數(shù)一個一行 |
--declaration-indentationn | -di2 | 變量聲明省撑,變量開始于2行赌蔑,即不必對齊 |
--format-first-column-comments | -nfc1 | 不格式化起于第一行的注釋 |
--format-all-comments | -nfca | 不開啟全部格式化注釋的開關(guān) |
--honour-newlines | -hnl | Prefer to break long lines at the position of newlines in the input. |
--indent-leveln | -i4 | 設(shè)置縮進多少字符,如果為tab的整數(shù)倍竟秫,用tab來縮進娃惯,否則用空格填充。 |
--parameter-indentationn | -ip5 | 舊風格的函數(shù)定義中參數(shù)說明縮進5個空格 |
--line-length 75 | -l75 | 非注釋行最長75 |
--continue-at-parentheses | -lp | 續(xù)行從上一行出現(xiàn)的括號開始 |
--space-after-procedure-calls | -pcs | 函數(shù)和"("之間插入一個空格 |
--space-after-parentheses | -nprs | 在"("后")"前不插入空格 |
--procnames-start-lines | -psl | 將函數(shù)名和返回類型放在兩行定義 |
--space-after-for | -saf | for后面有空格 |
--space-after-if | -sai | if后面有空格 |
--space-after-while | -saw | while后面有空格 |
--start-left-side-of-comments | -nsc | 不在生成的塊注釋中加* |
--swallow-optional-blank-lines | -nsob | 不去掉可添加的空行 |
--space-special-semicolon | -nss | 一行的for或while語句肥败,在";"前不加空趾浅。 |
--tab-size | -ts4 | 一個tab為4個空格(要能整除"-in") |
--use-tabs | -ut | 使用tab來縮進 |