分享

Sublime Text 中的SublimeREPL的绑定快捷键配置

 OneDayDayUp 2016-01-12

直入正题:

因为在配置python的Sublime Text环境,所以以python为例说明。

“Preference...浏览插件...SublimeREPL文件夹...Configure文件夹...Python文件夹...Default.sublime-commands”文件。

右键编辑此文件,内容如下

  1. [  
  2.     {  
  3.         "caption": "SublimeREPL: Python",  
  4.         "command": "run_existing_window_command", "args":  
  5.         {  
  6.             "id": "repl_python",  
  7.             "file": "config/Python/Main.sublime-menu"  
  8.         }  
  9.     },  
  10.     {  
  11.         "caption": "SublimeREPL: Python - PDB current file",  
  12.         "command": "run_existing_window_command", "args":  
  13.         {  
  14.             "id": "repl_python_pdb",  
  15.             "file": "config/Python/Main.sublime-menu"  
  16.         }  
  17.     },  
  18.     {  
  19.         "caption": "SublimeREPL: Python - RUN current file",  
  20.         "command": "run_existing_window_command", "args":  
  21.         {  
  22.             "id": "repl_python_run",  
  23.             "file": "config/Python/Main.sublime-menu"  
  24.         }  
  25.     },  
  26.     {  
  27.         "command": "python_virtualenv_repl",  
  28.         "caption": "SublimeREPL: Python - virtualenv"  
  29.     },  
  30.     {  
  31.         "caption": "SublimeREPL: Python - IPython",  
  32.         "command": "run_existing_window_command", "args":  
  33.         {  
  34.             "id": "repl_python_ipython",  
  35.             "file": "config/Python/Main.sublime-menu"  
  36.         }  
  37.     }  
  38. ]  

这就分别对应着“工具...SublimeREPL...Python”下的几个命令。

接下来是Sublime Text的按键绑定用法,详情见按键绑定:“http://sublime-undocs-zh./en/latest/reference/key_bindings.html”


“Preference...按键绑定-用户”,全文内容如下:

  1. [  
  2.     {"keys":["f5"],  
  3.     "caption": "SublimeREPL: Python - RUN current file",  
  4.     "command": "run_existing_window_command",  
  5.     "args":  
  6.     {  
  7.         "id": "repl_python_run",  
  8.         "file": "config/Python/Main.sublime-menu"  
  9.     }},  
  10.     {"keys":["f4"],  
  11.      "caption": "SublimeREPL: Python - IPython",  
  12.      "command": "run_existing_window_command", "args":  
  13.      {  
  14.          "id": "repl_python_ipython",  
  15.          "file": "config/Python/Main.sublime-menu"  
  16.      }}  
  17. ]  

分别代表用 F5绑定repl_python_run,即运行当前文件。F6绑定IPython模式,就是command line模式。

但是自动换行似乎不太好用,dir(help),输出不换行的一行。。。点击80个字符串换行,它又连回车换行符都吞了。。。。。。







    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多