Sublime Text 3在javascript中仅针对括号输入后缩进一个额外的选项卡

时间:2016-01-17 00:40:24

标签: javascript css reactjs sublimetext2 sublimetext3

现在,我正在使用Sublime Text中的ReactJS开发一个项目。每当我点击括号之间的输入时,它会断开到另一条线并添加一个额外的空间。这是一个例子:

初次启动

光标在中间,然后我点击输入:

enter image description here

当前结果

然后它会在之后添加这个额外的缩进。让我浪费时间并修复它。

enter image description here

期望的结果

点击输入后,这是我想要的结果:

enter image description here

提前谢谢!

1 个答案:

答案 0 :(得分:11)

打开 DECLARE lv_totavail_num NUMBER(8,2) := 100; lv_itemprice_num NUMBER(8,2); lv_totamt_num NUMBER(8,2); lv_loopnum_num NUMBER(8,2) := 0; BEGIN DBMS_OUTPUT.PUT_LINE('Total Starting Amount: ' || lv_totavail_num); SELECT price INTO lv_itemprice_num FROM BB_PRODUCT WHERE IDPRODUCT = 4; DBMS_OUTPUT.PUT_LINE('Price: ' || lv_itemprice_num); WHILE lv_totavail_num >= lv_itemprice_num LOOP lv_totavail_num := lv_itemprice_num * lv_loopnum_num; lv_loopnum_num := lv_loopnum_num + 1; END LOOP; DBMS_OUTPUT.PUT_LINE('Number of Items Purchased that can be purchased: ' || lv_loopnum_num); DBMS_OUTPUT.PUT_LINE('Total Amount: '|| lv_loopnum_num * lv_itemprice_num); END; 并添加以下内容:

Preferences -> Key Bindings-User

如果文件以前是空的,请在键绑定周围添加方括号{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t$0\n"}, "context": [ { "key": "setting.auto_indent", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "\\($", "match_all": true }, { "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true } ] } 并保存。如果文件具有其他自定义键绑定,请将其粘贴到开始括号[ ]后面的开头,并确保在其后添加逗号[以确保文件有效{{3} }。