1. 程式人生 > >sublime text3自定義快捷鍵

sublime text3自定義快捷鍵

我的sublime text 3 快捷鍵配置。

強烈推薦下面標紅的快捷鍵,誰用誰知道,編碼的時候再也不用依賴方向鍵和滑鼠了。

[

//=======================我的快捷鍵=======================//

// 刪除當前行
{ "keys": ["ctrl+d"], "command":"run_macro_file", "args": {"file":"Packages/Default/Delete Line.sublime-macro"} },
// 
複製選中行到行後
{ "keys": ["ctrl+alt+down"], "command":"duplicate_line" },
// 

選詞(按住-繼續選擇下個相同的字串)
{ "keys": ["ctrl+g"], "command":"find_under_expand" },
// gb
一次選中所有的
{ "keys": ["ctrl+g", "ctrl+b"],"command": "find_all_under" },

// 自動提示、補全
{ "keys": ["alt+/"], "command":"auto_complete" },
{ "keys": ["alt+/"], "command":"replace_completion_with_auto_complete", "context":
[
{ "key": "last_command", "operator":"equal", "operand": "insert_best_completion" },
{ "key": "auto_complete_visible", "operator":"equal", "operand": false },
{ "key": "setting.tab_completion", "operator":"equal", "operand": true }
]
},
// 
與上行互換
{ "keys": ["alt+up"], "command":"swap_line_up" },
// 
與下行互換
{ "keys": ["alt+down"], "command":"swap_line_down" },
{ "keys": ["alt+/","alt+/"], "command":"insert_best_completion" },

//tab鍵衝突,秒之
{ "keys": ["shift+tab"], "command":"insert_best_completion", "args": {"default":"\t", "exact": true} },
{ "keys": ["shift+tab"], "command":"insert_best_completion", "args": {"default":"\t", "exact": false},
"context":
[
{ "key": "setting.tab_completion", "operator":"equal", "operand": true }
]
},
{ "keys": ["shift+tab"], "command":"replace_completion_with_next_completion", "context":
[
{ "key": "last_command", "operator":"equal", "operand": "insert_best_completion" },
{ "key": "setting.tab_completion", "operator":"equal", "operand": true }
]
},
{ "keys": ["shift+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 }
]
},
{ "keys": ["shift+tab"], "command":"indent", "context":
[
{ "key": "text", "operator":"regex_contains", "operand": "\n" }
]
},
{ "keys": ["shift+tab"], "command":"next_field", "context":
[
{ "key": "has_next_field", "operator":"equal", "operand": true }
]
},
{ "keys": ["shift+tab"], "command":"commit_completion", "context":
[
{ "key": "auto_complete_visible" },
{ "key": "setting.auto_complete_commit_on_tab" }
]
},

//移動游標
{ "keys": ["alt+l"], "command": "move","args": {"by": "characters", "forward":false} },
{ "keys": ["alt+r"], "command": "move","args": {"by": "characters", "forward":true} },
{ "keys": ["alt+u"], "command": "move","args": {"by": "lines", "forward":false} },
{ "keys": ["alt+d"], "command": "move","args": {"by": "lines", "forward":true} },
{ "keys": ["shift+alt+l" ], "command":"move", "args": {"by": "characters","forward": false, "extend": true} },
{ "keys": ["shift+alt+r"], "command":"move", "args": {"by": "characters","forward": true, "extend": true} },
{ "keys": ["shift+alt+u" ], "command":"move", "args": {"by": "lines","forward": false, "extend": true} },
{ "keys": ["shift+alt+d" ], "command":"move", "args": {"by": "lines","forward": true, "extend": true} },

//移動游標到行首或行末
{ "keys": ["alt+b"], "command":"move_to", "args": {"to": "bol","extend": false} },
{ "keys": ["alt+e"], "command":"move_to", "args": {"to": "eol","extend": false} },
{ "keys": ["shift+alt+b"], "command":"move_to", "args": {"to": "bol","extend": true} },
{ "keys": ["shift+alt+e"], "command":"move_to", "args": {"to": "eol","extend": true} },

//滾屏
{ "keys": ["alt+g"], "command":"scroll_lines", "args": {"amount": 1.0 } },
{ "keys": ["alt+h"], "command":"scroll_lines", "args": {"amount": -1.0 } },

//縮排
{ "keys": ["shift+tab"], "command":"unindent" },

]

//=======================系統自帶快捷鍵=======================//
//=============選擇=============//
// Ctrl+L

// 選擇整行(按住-繼續選擇下行)

//Ctrl+Shift+L
//滑鼠選中多行,按下 同時編輯這些行

//滑鼠中鍵
//拖動,選擇多行

//Ctrl+左鍵點選
//同時選中多個節點進行編輯

//Ctrl+M
// 游標移動至括號內開始或結束的位置

// Ctrl+Shift+M
// 選擇括號內的內容(按住-繼續選擇父括號)

//=============視窗=============//
// SHIFT+ALT+數字
// 分割視窗


//=============行處理=============//
// CTRL+J
// 
合併行JOIN

// Ctrl+KU
// 
改為大寫

// Ctrl+KL
// 
改為小寫

// Ctrl+KK
// 
從游標處刪除至行尾

// Ctrl+Shift+D
// 複製游標所在整行,插入在該行之前

// Ctrl+J
// 合併行(已選擇需要合併的多行時)

// Ctrl+/
// 註釋整行(如已選擇內容,同“Ctrl+Shift+/”效果)

// Ctrl+Shift+/
// 註釋已選擇內容

// Ctrl+Shift+V
// 貼上並自動縮排(其它兄弟寫的,實測win系統自動縮排無效)

// Ctrl+M
// 游標跳至對應的括號

// Alt+.
// 閉合當前標籤

// Ctrl+Shift+A
// 選擇游標位置父標籤對兒

// Ctrl+Shift+[
// 摺疊程式碼

// Ctrl+Shift+]
// 展開程式碼

// Ctrl+KT
// 摺疊屬性

// Ctrl+K0
// 展開所有

// Ctrl+U
// 軟撤銷

// Ctrl+T
// 詞互換

// Ctrl+Enter
// 插入行後

// Ctrl+Shift Enter
// 插入行前

// Ctrl+K Backspace
// 從游標處刪除至行首

// Shift+Tab
// 去除縮排

// Tab
// 縮排

// F9
// 行排序(a-z)