sublime修改默认快捷键类似eclipse

  1. [  
  2.     /**  
  3.      * 常用快捷键(Sublime默认)  
  4.      * --------------  
  5.      *  
  6.      * 光标一个单词一个单词的移动  
  7.      * { "keys": ["ctrl+left"], "command": "move", "args": {"by": "words", "forward": false} },  
  8.      * 按住shift来选文字时, 一个个单词的选而不是一个个字母  
  9.      * { "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "words", "forward": false, "extend": true} },  
  10.      *  
  11.      * 类似光标一个个单词的移动  
  12.      * { "keys": ["alt+left"], "command": "move", "args": {"by": "subwords", "forward": false} },  
  13.      * { "keys": ["alt+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },  
  14.      *  
  15.      * 缩进  
  16.      * { "keys": ["ctrl+]"], "command": "indent" },  
  17.      * { "keys": ["ctrl+["], "command": "unindent" },  
  18.      *  
  19.      * 删除整个单词  
  20.      * { "keys": ["ctrl+backspace"], "command": "delete_word", "args": { "forward": false } },  
  21.      * { "keys": ["ctrl+delete"], "command": "delete_word", "args": { "forward": true } },  
  22.      *  
  23.      * 行排序(例如选中几个JSON字段, 让这些字段名按字母顺序排序)  
  24.      * { "keys": ["f9"], "command": "sort_lines", "args": {"case_sensitive": false} },  
  25.      *  
  26.      * 参考  
  27.      * ----------------------  
  28.      * Using Sublime Text as your IDE  
  29.      * http://www.chromium.org/developers/sublime-text  
  30.      *  
  31.      * Web Development With Sublime Text 2  
  32.      * http://www.paulund.co.uk/web-development-with-sublime-text-2  
  33.      */  
  34.   
  35.     // editor配置  
  36.     {  
  37.         "keys": ["ctrl+v"],  
  38.         "command": "paste_and_indent"  
  39.     }, {  
  40.         "keys": ["ctrl+shift+v"],  
  41.         "command": "paste"  
  42.     },  
  43.   
  44.     /**  
  45.      * 适配eclipse快捷键  
  46.      *  
  47.      * 下面这位仁兄早就有了这个想法  
  48.      * Eclipse shortcuts for Sublime Text 2  
  49.      * http://icoloma.blogspot.com/2011/10/eclipse-shortcuts-for-sublime-text-2.html  
  50.      */  
  51.     {  
  52.         "keys": ["alt+/"],  
  53.         "command": "auto_complete"  
  54.     }, {  
  55.         "keys": ["ctrl+i"],  
  56.         "command": "reindent"  
  57.     },  
  58.     // 当前行和下面一行交互位置  
  59.     {  
  60.         "keys": ["alt+up"],  
  61.         "command": "swap_line_up"  
  62.     }, {  
  63.         "keys": ["alt+down"],  
  64.         "command": "swap_line_down"  
  65.     },  
  66.     // 复制当前行到上一行  
  67.     {  
  68.         "keys": ["ctrl+alt+up"],  
  69.         "command": "duplicate_line"  
  70.     },  
  71.     // 复制当前行到下一行  
  72.     {  
  73.         "keys": ["ctrl+alt+down"],  
  74.         "command": "duplicate_line"  
  75.     },  
  76.     // 删除整行  
  77.     {  
  78.         "keys": ["ctrl+d"],  
  79.         "command": "run_macro_file",  
  80.         "args": {  
  81.             "file": "Packages/Default/Delete Line.sublime-macro"  
  82.         }  
  83.     },  
  84.     // 光标移动到指定行  
  85.     {  
  86.         "keys": ["ctrl+l"],  
  87.         "command": "show_overlay",  
  88.         "args": {  
  89.             "overlay": "goto",  
  90.             "text": ":"  
  91.         }  
  92.     },  
  93.     // 快速定位到选中的文字  
  94.     {  
  95.         "keys": ["ctrl+k"],  
  96.         "command": "find_under_expand_skip"  
  97.     },  
  98.     // { "keys": ["ctrl+shift+x"], "command": "swap_case" },  
  99.     {  
  100.         "keys": ["ctrl+shift+x"],  
  101.         "command": "upper_case"  
  102.     }, {  
  103.         "keys": ["ctrl+shift+y"],  
  104.         "command": "lower_case"  
  105.     },  
  106.     // 在当前行的下一行插入空行(这时鼠标可以在当前行的任一位置, 不一定是最后)  
  107.     {  
  108.         "keys": ["shift+enter"],  
  109.         "command": "run_macro_file",  
  110.         "args": {  
  111.             "file": "Packages/Default/Add Line.sublime-macro"  
  112.         }  
  113.     },  
  114.     // 定位到对于的匹配符(譬如{})(从前面定位后面时,光标要在匹配符里面,后面到前面,则反之)  
  115.     {  
  116.         "keys": ["ctrl+shift+p"],  
  117.         "command": "move_to",  
  118.         "args": {  
  119.             "to": "brackets"  
  120.         }  
  121.     },  
  122.     // 这个命令默认使用的是ctrl+shift+p  
  123.     {  
  124.         "keys": ["ctrl+p"],  
  125.         "command": "show_overlay",  
  126.         "args": {  
  127.             "overlay": "command_palette"  
  128.         }  
  129.     },  
  130.     // outline  
  131.     {  
  132.         "keys": ["ctrl+o"],  
  133.         "command": "show_overlay",  
  134.         "args": {  
  135.             "overlay": "goto",  
  136.             "text": "@"  
  137.         }  
  138.     },  
  139.     // 当前文件中的关键字(方便快速查找内容)  
  140.     {  
  141.         "keys": ["ctrl+alt+o"],  
  142.         "command": "show_overlay",  
  143.         "args": {  
  144.             "overlay": "goto",  
  145.             "text": "#"  
  146.         }  
  147.     },  
  148.     // open resource  
  149.     {  
  150.         "keys": ["ctrl+shift+r"],  
  151.         "command": "show_overlay",  
  152.         "args": {  
  153.             "overlay": "goto",  
  154.             "show_files": true  
  155.         }  
  156.     },  
  157.     // 文件内查找/替换  
  158.     {  
  159.         "keys": ["ctrl+f"],  
  160.         "command": "show_panel",  
  161.         "args": {  
  162.             "panel": "replace"  
  163.         }  
  164.     },  
  165.     // 全局查找/替换, 在查询结果中双击跳转到匹配位置  
  166.     {  
  167.         "keys": ["ctrl+shift+u"],  
  168.         "command": "show_panel",  
  169.         "args": {  
  170.             "panel": "find_in_files"  
  171.         }  
  172.     }, {  
  173.         "keys": ["ctrl+j"],  
  174.         "command": "show_panel",  
  175.         "args": {  
  176.             "panel": "incremental_find",  
  177.             "reverse": false  
  178.         }  
  179.     }, {  
  180.         "keys": ["ctrl+shift+j"],  
  181.         "command": "show_panel",  
  182.         "args": {  
  183.             "panel": "incremental_find",  
  184.             "reverse": true  
  185.         }  
  186.     },  
  187.   
  188.     // Select text between brackets  
  189.     {  
  190.         "keys": ["alt+backspace"],  
  191.         "command": "bh_key",  
  192.         "args": {  
  193.             "lines": true,  
  194.             "plugin": {  
  195.                 "type": ["__all__"],  
  196.                 "command": "bh_modules.bracketselect"  
  197.             }  
  198.         }  
  199.     },  
  200.   
  201.     // // Remove brackets  
  202.     // {  
  203.     //     "keys": ["alt+backspace"],  
  204.     //     "command": "bh_remove_brackets"  
  205.     // },  
  206.   
  207.     // Convert single quote string to double quoted string and vice versa  
  208.     // Will handle escaping or unescaping quotes within the string  
  209.     {  
  210.         "keys": ["alt+'"],  
  211.         "command": "bh_key",  
  212.         "args": {  
  213.             "lines": true,  
  214.             "plugin": {  
  215.                 "type": ["single_quote", "double_quote", "py_single_quote", "py_double_quote"],  
  216.                 "command": "bh_modules.swapquotes"  
  217.             }  
  218.         }  
  219.     },  
  220.     // Swap brackets with another type  
  221.     {  
  222.         "keys": ["alt+["],  
  223.         "command": "swap_brackets"  
  224.     },  
  225.     // Surround selection with brackets from quick panel  
  226.     {  
  227.         "keys": ["alt+]"],  
  228.         "command": "wrap_brackets"  
  229.     },  
  230.   
  231.     // plugin配置  
  232.     {  
  233.         "keys": ["alt+a"],  
  234.         "command": "alignment"  
  235.     }, {  
  236.         "keys": ["ctrl+shift+f"],  
  237.         "command": "js_format"  
  238.     },  
  239.   
  240.     //Andy Edits plugin  
  241.     {  
  242.         "keys": ["ctrl+alt+d"],  
  243.         "command": "delete_edit"  
  244.     }, {  
  245.         "keys": ["ctrl+alt+h"],  
  246.         "command": "toggle_edits"  
  247.     }, {  
  248.         "keys": ["ctrl+alt+j"],  
  249.         "command": "quick_edits"  
  250.     }, {  
  251.         "keys": ["ctrl+alt+k"],  
  252.         "command": "prev_edit_line"  
  253.     }, {  
  254.         "keys": ["ctrl+alt+l"],  
  255.         "command": "next_edit_line"  
  256.     }, {  
  257.         "keys": ["ctrl+alt+m"],  
  258.         "command": "list_all_edits"  
  259.     }, {  
  260.         "keys": ["ctrl+alt+c"],  
  261.         "command": "create_edit"  
  262.     }  
  263.   
  264.   
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值