sublime text 用enter換行的時候,自動縮進(jìn)如何設(shè)置(以及其他小工具)

稍微查了一下網(wǎng)上的辦法,是把漢化文件刪除,但是會造成菜單欄混亂,簡直無法忍受。。。

那么這里介紹的是另一種解決辦法。在用戶的熱鍵配置文件(preferences-key binding-user)中加入以下代碼:

[
復(fù)制代碼

]

<pre style="margin: 0px; padding: 0px; overflow-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;"> { "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 },
]
} </pre>

[
復(fù)制代碼

]

[圖片上傳失敗...(image-27b7b7-1593539898317)]

保存配置文件之后,換行就能夠正??s進(jìn)了,如圖:

[圖片上傳失敗...(image-6b95b5-1593539898317)]

二、順便把tab鍵的縮進(jìn)也處理一下,按一次tab縮進(jìn)足夠的距離

處理之前,需要這樣按tab。。。如圖:

[圖片上傳失敗...(image-a24c7a-1593539898317)]

處理之后,tab一次到位,如圖:

[圖片上傳失敗...(image-5c126e-1593539898317)]

和上面的一樣,在用戶的熱鍵配置文件(preferences-key binding-user)中加入以下代碼:

[
復(fù)制代碼

](javascript:void(0); "復(fù)制代碼")

<pre style="margin: 0px; padding: 0px; overflow-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;"> // 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 }
]
}</pre>

[
復(fù)制代碼

](javascript:void(0); "復(fù)制代碼")

Tips:小白注意看我的圖,在之前的代碼后面加個逗號

[圖片上傳失敗...(image-9aed46-1593539898317)]

說白了其實就是熱鍵沖突的問題。。。END

種個草莓防止以后再找
原文地址作者:憶秋暝楓
出處:http://www.cnblogs.com/yqmf

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容