luoer
V2EX  ›  Vim

vim 上面有那些好用的格式化代码的插件

  •  
  •   luoer · Jul 11, 2016 · 3990 views
    This topic created in 3775 days ago, the information mentioned may be changed or developed.

    最近写 PHP 代码 发现好多格式都有问题 自己又懒得一行一行去改 有那些插件可以格式化代码 比如 if($a=1) 格式化之后变成 if( $a=1 ) 这样

    11 replies  •  2016-07-13 11:00:05 +08:00
    yangtukun1412
    yangtukun1412
    Jul 11, 2016
    1
    phpcbf?
    h2ero
    h2ero
    Jul 11, 2016
    2
    不是应该格式化为这样吗?
    if ($a = 1)
    h2ero
    h2ero
    Jul 11, 2016
    3
    之前写个类似的, 自己改下, 加条规则就行。
    https://github.com/h2ero/phpcr
    luoer
    luoer
    OP
    Jul 11, 2016
    4
    @h2ero 谢谢啊 我去看看
    luoer
    luoer
    OP
    Jul 11, 2016
    5
    @yangtukun1412 好的 我去看看
    hanxiV2EX
    hanxiV2EX
    Jul 11, 2016 via iPhone
    6
    astyle
    lll9p
    lll9p
    Jul 12, 2016
    7
    autoformat
    FrankFang128
    FrankFang128
    Jul 12, 2016
    8
    PHPStorm ,等你来发现。
    xiahei
    xiahei
    Jul 12, 2016
    9
    :%s/if($a=1)/if($a = 1)/g
    luoer
    luoer
    OP
    Jul 13, 2016
    10
    @FrankFang128 一开 phpstorm 机器就卡的我心累...
    luoer
    luoer
    OP
    Jul 13, 2016
    11
    @xiahei ....
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4320 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 08:16 · PVG 16:16 · LAX 00:16 · JFK 03:16
    ♥ Do have faith in what you're doing.