Sublime text 2 / 3 binding eclipse shortcut key

Time:2019-12-2

stayPreferencesMenu selectionKey Bindings, paste the following code intoUsersIn file

[
/**
*Common shortcut keys (sublime default)
* --------------
*
*Cursor a word a word move
* { "keys": ["ctrl+left"], "command": "move", "args": {"by": "words", "forward": false} },
*When you press and hold shift to select text, select words instead of letters
* { "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "words", "forward": false, "extend": true} },
*
*It's similar to the movement of words by cursors
* { "keys": ["alt+left"], "command": "move", "args": {"by": "subwords", "forward": false} },
* { "keys": ["alt+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
*
* indentation
* { "keys": ["ctrl+]"], "command": "indent" },
* { "keys": ["ctrl+["], "command": "unindent" },
*
*Delete entire word
* { "keys": ["ctrl+backspace"], "command": "delete_word", "args": { "forward": false } },
* { "keys": ["ctrl+delete"], "command": "delete_word", "args": { "forward": true } },
*
*Row sort (for example, select several JSON fields and make them alphabetical)
* { "keys": ["f9"], "command": "sort_lines", "args": {"case_sensitive": false} },
*
* reference
* ----------------------
* Using Sublime Text as your IDE
* http://www.chromium.org/developers/sublime-text
*
* Web Development With Sublime Text 2
* http://www.paulund.co.uk/web-development-with-sublime-text-2
*/

//Editor configuration
{ "keys": ["ctrl+v"], "command": "paste_and_indent" },
{ "keys": ["ctrl+shift+v"], "command": "paste" },

/**
*Adapting eclipse shortcuts
*
*Now this guy has this idea for a long time
* Eclipse shortcuts for Sublime Text 2
* http://icoloma.blogspot.com/2011/10/eclipse-shortcuts-for-sublime-text-2.html
*/
{ "keys": ["alt+/"], "command": "auto_complete" },
{ "keys": ["ctrl+i"], "command": "reindent" },
//Where the current line interacts with the next line
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
//Copy current line to previous line
{ "keys": ["ctrl+alt+up"], "command": "duplicate_line" },
//Copy current line to next line
{ "keys": ["ctrl+alt+down"], "command": "duplicate_line" },
//Delete entire row
{ "keys": ["ctrl+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
//Move cursor to specified line
{ "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
//Quickly navigate to selected text
{ "keys": ["ctrl+k"], "command": "find_under_expand_skip" },
// { "keys": ["ctrl+shift+x"], "command": "swap_case" },
{ "keys": ["ctrl+shift+x"], "command": "upper_case" },
{ "keys": ["ctrl+shift+y"], "command": "lower_case" },
//Insert a blank row in the next row of the current row (at this time, the mouse can be in any position of the current row, not necessarily the last)
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} },
//Locate to the matching character of (for example, {}) (when positioning from the front to the back, the cursor should be in the matching character, and when positioning from the back to the front, otherwise)
{ "keys": ["ctrl+shift+p"], "command": "move_to", "args": {"to": "brackets"} },
//This command uses Ctrl + Shift + P by default
{ "keys": ["ctrl+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
// outline
{ "keys": ["ctrl+o"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
//Keywords in the current file (easy to find content quickly)
{ "keys": ["ctrl+alt+o"], "command": "show_overlay", "args": {"overlay": "goto", "text": "#"} },
// open resource
{ "keys": ["ctrl+shift+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
//Find / replace in file
{ "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "replace"} },
//Global find / replace, double-click in the query result to jump to the matching position
{"keys": ["ctrl+h"], "command": "show_panel", "args": {"panel": "find_in_files"} },

//Plugin configuration
{ "keys": ["alt+a"], "command": "alignment" },
{"keys": ["ctrl+shift+f"], "command": "js_format"}
]

or

[
//=======================My shortcuts=======================//
//Delete current row
{ "keys": ["ctrl+d"], "command":"run_macro_file", "args": {"file":"Packages/Default/Delete Line.sublime-macro"} },
//Copy the selected row after row
{ "keys": ["ctrl+alt+down"], "command":"duplicate_line" },
//Select words (press and hold - continue to select the next same string)
{ "keys": ["ctrl+g"], "command":"find_under_expand" },
//GB select all at once
{ "keys": ["ctrl+g", "ctrl+b"],"command": "find_all_under" },
//Automatic prompt and completion
{ "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 }
]
},
//Interchange with uplink
{ "keys": ["alt+up"], "command":"swap_line_up" },
//Swap with downlink
{ "keys": ["alt+down"], "command":"swap_line_down" },
{ "keys": ["alt+/","alt+/"], "command":"insert_best_completion" },
//Conflict with tab key, seconds
{ "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" }
]
},
//Move cursor
{ "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} },
//Move cursor到行首或行末
{ "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} },
// roll screen
{ "keys": ["alt+g"], "command":"scroll_lines", "args": {"amount": 1.0 } },
{ "keys": ["alt+h"], "command":"scroll_lines", "args": {"amount": -1.0 } },
// indent
{ "keys": ["shift+tab"], "command":"unindent" }
]