Sublime Text2 自定义快捷键Eclipse风格

 

[

 

 { "keys": ["ctrl+s"], "command": "save" },

 { "keys": ["ctrl+shift+s"], "command": "prompt_save_as" },

 { "keys": ["f11"], "command": "toggle_full_screen" },

 { "keys": ["shift+f11"], "command": "toggle_distraction_free" },

 

 { "keys": ["ctrl+left"], "command": "move", "args": {"by": "words", "forward": false} },

 { "keys": ["ctrl+right"], "command": "move", "args": {"by": "word_ends", "forward": true} },

 { "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "find"} },

 { "keys": ["ctrl+shift+k"], "command": "find_prev" }, //文件查找

 { "keys": ["ctrl+h"], "command": "show_panel", "args": {"panel": "replace"} },

 { "keys": ["ctrl+k"], "command": "find_next" },

 { "keys": ["ctrl+shift+k"], "command": "find_prev" },

 { "keys": ["ctrl+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },

 { "keys": ["alt+up"], "command": "swap_line_up" },//交换行上移

 { "keys": ["alt+down"], "command": "swap_line_down" }, //交换行下移

 { "keys": ["ctrl+/"], "command": "toggle_comment", "args": { "block": false } }, //注解

 { "keys": ["ctrl+j"], "command": "join_lines" }, //连接行

 { "keys": ["ctrl+alt+down"], "command": "duplicate_line" }, //复制行

 { "keys": ["ctrl+l"], "command": "expand_selection", "args": {"to": "line"} },

 

 

 /** 系统必要快捷键 */

 { "keys": ["backspace"], "command": "left_delete" },

 { "keys": ["shift+backspace"], "command": "left_delete" },

 { "keys": ["ctrl+shift+backspace"], "command": "left_delete" },

 { "keys": ["delete"], "command": "right_delete" },

 { "keys": ["enter"], "command": "insert", "args": {"characters": "\n"} },

 { "keys": ["shift+enter"], "command": "insert", "args": {"characters": "\n"} },

 

 { "keys": ["ctrl+z"], "command": "undo" },

 { "keys": ["ctrl+shift+z"], "command": "redo" },

 { "keys": ["ctrl+y"], "command": "redo_or_repeat" },

 { "keys": ["ctrl+u"], "command": "soft_undo" },

 { "keys": ["ctrl+shift+u"], "command": "soft_redo" },

 

 { "keys": ["ctrl+shift+v"], "command": "paste_and_indent" },

 { "keys": ["shift+delete"], "command": "cut" },

 { "keys": ["ctrl+insert"], "command": "copy" },

 { "keys": ["shift+insert"], "command": "paste" },

 { "keys": ["ctrl+x"], "command": "cut" },

 { "keys": ["ctrl+c"], "command": "copy" },

 { "keys": ["ctrl+v"], "command": "paste" },

 

 { "keys": ["left"], "command": "move", "args": {"by": "characters", "forward": false} },

 { "keys": ["right"], "command": "move", "args": {"by": "characters", "forward": true} },

 { "keys": ["up"], "command": "move", "args": {"by": "lines", "forward": false} },

 { "keys": ["down"], "command": "move", "args": {"by": "lines", "forward": true} },

 { "keys": ["shift+left"], "command": "move", "args": {"by": "characters", "forward": false, "extend": true} },

 { "keys": ["shift+right"], "command": "move", "args": {"by": "characters", "forward": true, "extend": true} },

 { "keys": ["shift+up"], "command": "move", "args": {"by": "lines", "forward": false, "extend": true} },

 { "keys": ["shift+down"], "command": "move", "args": {"by": "lines", "forward": true, "extend": true} },

 

 

 { "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },

 { "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},

  "context":

  [

   { "key": "setting.tab_completion", "operator": "equal", "operand": true }

  ]

 },

 { "keys": ["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": ["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": ["tab"], "command": "indent", "context":

  [

   { "key": "text", "operator": "regex_contains", "operand": "\n" }

  ]

 },

 { "keys": ["tab"], "command": "next_field", "context":

  [

   { "key": "has_next_field", "operator": "equal", "operand": true }

  ]

 },

 { "keys": ["tab"], "command": "commit_completion", "context":

  [

   { "key": "auto_complete_visible" },

   { "key": "setting.auto_complete_commit_on_tab" }

  ]

 },

 

 { "keys": ["shift+tab"], "command": "insert", "args": {"characters": "\t"} },

 { "keys": ["shift+tab"], "command": "unindent", "context":

  [

   { "key": "setting.shift_tab_unindent", "operator": "equal", "operand": true }

  ]

 },

 { "keys": ["shift+tab"], "command": "unindent", "context":

  [

   { "key": "preceding_text", "operator": "regex_match", "operand": "^[\t ]*" }

  ]

 },

 { "keys": ["shift+tab"], "command": "unindent", "context":

  [

   { "key": "text", "operator": "regex_contains", "operand": "\n" }

  ]

 },

 { "keys": ["shift+tab"], "command": "prev_field", "context":

  [

   { "key": "has_prev_field", "operator": "equal", "operand": true }

  ]

 },

 

 

 // Auto-pair quotes

 { "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"$0\""}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },

   { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },

   { "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\"a-zA-Z0-9_]$", "match_all": true },

   { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double", "match_all": true }

  ]

 },

 { "keys": ["\""], "command": "insert_snippet", "args": {"contents": "\"${0:$SELECTION}\""}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }

  ]

 },

 { "keys": ["\""], "command": "move", "args": {"by": "characters", "forward": true}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },

   { "key": "following_text", "operator": "regex_contains", "operand": "^\"", "match_all": true }

  ]

 },

 { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":

  [

   { "key": "setting.auto_match_enabled", "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 }

  ]

 },

 

 // Auto-pair single quotes

 { "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'$0'"}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },

   { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },

   { "key": "preceding_text", "operator": "not_regex_contains", "operand": "['a-zA-Z0-9_]$", "match_all": true },

   { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true } 

  ]

 },

 { "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'${0:$SELECTION}'"}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }

  ]

 },

 { "keys": ["'"], "command": "move", "args": {"by": "characters", "forward": true}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },

   { "key": "following_text", "operator": "regex_contains", "operand": "^'", "match_all": true }

  ]

 },

 { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":

  [

   { "key": "setting.auto_match_enabled", "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 }

  ]

 },

 

 // Auto-pair brackets

 { "keys": ["("], "command": "insert_snippet", "args": {"contents": "($0)"}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },

   { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }

  ]

 },

 { "keys": ["("], "command": "insert_snippet", "args": {"contents": "(${0:$SELECTION})"}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }

  ]

 },

 { "keys": [")"], "command": "move", "args": {"by": "characters", "forward": true}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },

   { "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }

  ]

 },

 { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":

  [

   { "key": "setting.auto_match_enabled", "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 }

  ]

 },

 

 // Auto-pair square brackets

 { "keys": ["["], "command": "insert_snippet", "args": {"contents": "[$0]"}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },

   { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|;|\\}|$)", "match_all": true }

  ]

 },

 { "keys": ["["], "command": "insert_snippet", "args": {"contents": "[${0:$SELECTION}]"}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }

  ]

 },

 { "keys": ["]"], "command": "move", "args": {"by": "characters", "forward": true}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },

   { "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }

  ]

 },

 { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":

  [

   { "key": "setting.auto_match_enabled", "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 }

  ]

 },

 

 // Auto-pair curly brackets

 { "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{$0}"}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },

   { "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }

  ]

 },

 { "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{${0:$SELECTION}}"}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }

  ]

 },

 { "keys": ["}"], "command": "move", "args": {"by": "characters", "forward": true}, "context":

  [

   { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },

   { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },

   { "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }

  ]

 },

 { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context":

  [

   { "key": "setting.auto_match_enabled", "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 }

  ]

 },

 

 { "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line in Braces.sublime-macro"}, "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 }

  ]

 },

 { "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line in Braces.sublime-macro"}, "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 }

  ]

 },

 

 { "keys": ["ctrl+a"], "command": "select_all" }

 

]

转载于:https://my.oschina.net/fanwenqiang/blog/742175

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值