加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

autocomplete – 修改引号的auto_match,为Sublime Text 2添加一

发布时间:2020-12-14 21:15:12 所属栏目:资源 来源:网络整理
导读:Sublime Text 2非常有用地关闭了我的所有引号. 是否可以修改它使用的字符? 例如,如果我想在列表中添加`backticks`. @skuroda的答案非常有用.在Mac OSX上,转到 Sublime Text 2 Preferences Key Bindings - User 并在那里粘贴文本.确保它最终包裹在[…](方括
Sublime Text 2非常有用地关闭了我的所有引号.
是否可以修改它使用的字符?

例如,如果我想在列表中添加`backticks`.

@skuroda的答案非常有用.在Mac OSX上,转到

Sublime Text 2 > Preferences > Key Bindings - User

并在那里粘贴文本.确保它最终包裹在[…](方括号)中.

解决方法

自动配对只是一些专门的键绑定.这应该允许你自动配对反引号.如果您想创建其他自动配对符号,它也应该作为指南.
{ "keys": ["`"],"command": "insert_snippet","args": {"contents": "`$0`"},"context":
    [
        { "key": "setting.auto_match_enabled","operator": "equal","operand": true },{ "key": "selection_empty","operand": true,"match_all": true },{ "key": "following_text","operator": "regex_contains","operand": "^(?:t| |)|]|;|}|$)","match_all": true }
    ]
},{ "keys": ["`"],"args": {"contents": "`${0:$SELECTION}`"},"operand": false,"command": "move","args": {"by": "characters","forward": true},"operand": "^`",{ "keys": ["backspace"],"command": "run_macro_file","args": {"file": "Packages/Default/Delete Left Right.sublime-macro"},{ "key": "preceding_text","operand": "`$","match_all": true }
    ]
}

只需将该代码块插入用户密钥绑定即可.

我只是使用默认的键绑定作为模板,因此您可能需要进一步修改某些上下文以使其完美地工作.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读