Sublime Tab无法缩进问题

与emmet热键冲突导致无法缩进

解决方案

在“首选项->快捷键设置”中,找到将其删除

[    
    {        
        "keys": [            "tab"       
    ],   
    "args": {            
         "action": "expand_abbreviation"      
         }, 
              "command":"run_emmet_action",     "context": [          
                {                
                "key":"emmet_action_enabled.expand_abbreviation"           
                 }        
           ]    
    }
]

来源:https://blog.csdn.net/weixin_36769175/article/details/75312387

换行无法自动缩进的问题

在“首选项->快捷键设置”中,加入

{ "keys": ["enter"], "command": "auto_indent_tag", "context":
        [
            { "key": "setting.auto_indent", "operator": "equal", "operand": true },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "selector", "operator": "equal", "operand": "punctuation.definition.tag.begin", "match_all": true },
            { "key": "preceding_text", "operator": "regex_contains", "operand": ">$", "match_all": true },
            { "key": "following_text", "operator": "regex_contains", "operand": "^</", "match_all": true },
        ]
    }

按一次tab缩进足够的距离

在“首选项->快捷键设置”中,加入[1]

// Press the tab indent a sufficient distance
    { "keys": ["tab"], "command": "reindent", "context":
        [
            { "key": "setting.auto_indent", "operator": "equal", "operand": true },
            { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
            { "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
            { "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
        ]
    }

来源:
作者:忆秋暝枫
出处:http://www.cnblogs.com/yqmf
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。


  1. 两个设置代码之间,第一个花括号后要记得加“,”

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容