看板 Editor 關於我們 聯絡資訊
請問大家 如何將各Arithmetic operators 算術運算子及邏輯運算子 的前後加上空格. 像是 a=b; 應為 a = b; 而對於邏輯運算子也應該用上. 不知大家都是如何去處理的? 目前都是寫完後再用搜尋取代方式(:%s/=/ = /gc) 但這樣做跟一行一行檢查一樣,而且不方便. 我想這部份可能需要用Regexp 常規表示式. 對於這個Regexp如何表示? (+,-,*,/,+=,-=,/=,*= and ==,!=,<,>,...) 並避開一些command用的(//,/****,*/) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.126.34.194 ※ 編輯: stevenlin08 來自: 59.126.34.194 (10/22 21:22)
fjm31714:try astyle --pad-oper ? 10/22 21:49
stevenlin08:太感謝了,,沒錯,我就是想用這個 10/23 00:46
stevenlin08:Cannot convert to multi-byte string, reverting to 10/23 00:47
stevenlin08:to English...不知是我的有問題,它會出現這個. 10/23 00:48
stevenlin08:http://img31.imageshack.us/i/zj27.png/ 10/23 00:50
stevenlin08:我是直接download astyle後,把bin file放在vim的同一 10/23 00:51
stevenlin08:目錄中, 10/23 00:51
jokester:可惜astyle不能處理c系以外的語言.. 11/01 14:17