zoukankan      html  css  js  c++  java
  • (GitHub)为自己的Repository设置默认tabsize

    GitHub默认显示tab为8个空格的大小,若想要改为4个怎么办呢?


     1、别人的Repository

    要么浏览器URL中添加后缀?ts=4,要么安装浏览器扩展或自己配置css。

    2、自己的Repository

    GitHub是支持EditorConfig的。只需在你的Repository根目录下(注意不是.git文件夹下)新建文件

    .editorconfig

    # top-most EditorConfig file
    root = true
    
    # all files
    [*]
    indent_style = tab
    indent_size = 4

    注意,该配置文件不仅仅对浏览有效,在线编辑时也是有效的。

    indent_style: 可以是tabspace。tab是hard tab,space为soft tab(按下的是Tab键,出来的实际是空格)。

    indent_size: 缩进的宽度,即列数,整数。如果indent_style为tab,则此属性默认为tab_width。

    tab_ 设置tab的列数。默认是indent_size。

    注意indent_size和tab_width的区别。后者是文档中tab字符显示出来的宽度,包括已存在的tab字符和编辑中插入的tab字符。如果indent_style是space,那么编辑中按TAB键出来不再是tab字符而是indent_size个空格了。。。别问我如果indent_style是tab,但indent_size/tab_width不同时按TAB键的显示宽度是多少。。。

    当然,.editorconfig的作用绝不仅如此。

    [参考链接]:

    http://stackoverflow.com/questions/8833953/how-to-change-tab-size-on-github

    http://editorconfig.org/

    http://www.cnblogs.com/xiyangbaixue/p/4201490.html

  • 相关阅读:
    052-141
    052-140
    052-139
    052-138
    需要做笔记的页面
    日期总是显示1900/01/01 0:00:00
    延迟加载的树控件
    (简单)关于summary的注释
    江南检测
    fineui动态添加用户控件
  • 原文地址:https://www.cnblogs.com/sfqtsh/p/6650257.html
Copyright © 2011-2022 走看看