Sublime Tab键缩进问题

来源:互联网 发布:淘宝看图购在哪里发布 编辑:程序博客网 时间:2024/06/07 15:01

Tab键的缩进

  • 设置默认缩进:preferences -> setting -> setting-User 添加以下代码:
"tab_size": 4,   "translate_tabs_to_spaces": true,"expand_tabs_on_save": true
  • 对于已经创建好的项目,默认设置是不生效的,而且每次修改完文件之后,重启 sublime 并不会生效。
    解决方法:安装 EditorConfig 插件,然后设置 .editorconfig文件,强制设置项目的 tab_size. 在项目的根目录下创建 .editorconfig,然后编辑,以 python 为例:
; -*- conf -*-; EditorConfig is awesome: http://EditorConfig.org; top-most EditorConfig fileroot = true; Unix-style newlines with a newline ending every file[*]end_of_line = lfinsert_final_newline = truetrim_trailing_whitespace = falsecharset = utf-8indent_style = spaceindent_size = 2tab_width = 2[*.py]indent_style = spaceindent_size = 4
原创粉丝点击