V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
hpyhacking
V2EX  ›  程序员

tabular Vim 排版插件

  •  
  •   hpyhacking ·
    hpyhacking · 2012-09-02 07:11:01 +08:00 · 4593 次点击
    这是一个创建于 4253 天前的主题,其中的信息可能已经有所发展或是发生改变。
    v2ex的编辑功能好恶心,空格自动给缩了

    var foo = 'foo'
    var foo_bar = 'foo_bar'

    :Tabularize \=

    var foo = 'foo'
    var foo_bar = 'foo_bar'

    上面两行的=会自动对齐

    原来我经常手工来做这件事情,现在有了这个简直太爽了。

    https://github.com/godlygeek/tabular
    7 条回复    1970-01-01 08:00:00 +08:00
    test123
        1
    test123  
       2012-09-02 09:59:46 +08:00
    也许你不需要做这件事情。"Python's PEP 8 (which is the "Style Guide for Python Code") requests that you don't use whitespace to align code:"
    http://stackoverflow.com/questions/4001375/is-it-considered-a-good-style-to-use-whitespace-to-align-the-code
    yuelang85
        2
    yuelang85  
       2012-09-02 23:29:17 +08:00
    @test123 虽然pep 8说不要这么做,但是我还是喜欢这样做,这样看着不乱。。。。
    pyKun
        3
    pyKun  
       2012-09-03 10:21:57 +08:00
    自动缩进是html的特点,不是论坛人为加的功能。。。
    chrisyipw
        4
    chrisyipw  
       2012-09-04 13:37:59 +08:00
    @pyKun 会把重复的空格处理成一个空格而已,常见的处理方式是把空格转换成  。

    @livid 考虑一下加强 V2EX 的代码显示吧?
    jerommix
        5
    jerommix  
       2012-09-05 07:03:35 +08:00
    @chrisyipw gist
    duhastmich
        6
    duhastmich  
       2012-09-08 21:45:17 +08:00
    我是这样用的 :Tab/=
    h2ero
        7
    h2ero  
       2012-09-09 10:04:02 +08:00
    没有用过这个,用的Align这个插件。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3281 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:07 · PVG 21:07 · LAX 06:07 · JFK 09:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.