goofansu
V2EX  ›  Emacs

emacs的缩进,sublime text2里缩进为4,用emacs打开,缩进变成8了。

  •  
  •   goofansu · Dec 18, 2012 · 4859 views
    This topic created in 4921 days ago, the information mentioned may be changed or developed.
    最近想试试emacs,因为有flymake可以语法检查。

    我原来用sublime text2保存文件的时候,缩进是4,可是用emacs打开,缩进变成了8,请问有遇到过这情况的同学吗?

    ps:用emacs新建保存的文件,缩进是没有问题的。
    Supplement 1  ·  Dec 18, 2012
    谢谢大家的回复,网上搜了下tab width,加入以下设置就正常了

    (setq indent-tabs-mode nil)
    (setq tab-width 4)

    因为是公司项目,所以就没有开启sublime text2的translate_tabs_to_spaces功能,否则svn比较就是一片修改
    4 replies    1970-01-01 08:00:00 +08:00
    reus
        1
    reus  
       Dec 18, 2012
    st2里用的其实是tab不是空格吧。然后你的emacs的tab显示宽度是8
    tioover
        2
    tioover  
       Dec 18, 2012
    在sublime设置里开启tab转成空格
    lightening
        3
    lightening  
       Dec 18, 2012   ❤️ 1
    你也可以在emacs里设置tab宽度
    goofansu
        4
    goofansu  
    OP
       Dec 18, 2012
    @reus
    @tioover
    @lightening 多谢大家,到公司了就试试
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3254 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 13:35 · PVG 21:35 · LAX 06:35 · JFK 09:35
    ♥ Do have faith in what you're doing.