V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
luoer
V2EX  ›  Vim

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

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