keyboard shortcut for sublime text new version

2019-08-27 10:54发布

问题:

I have this code to create a shortcut to run current file in sublimeREPL:

{
    "keys": ["ctrl+alt+b"],
    "command": "run_existing_window_command",
    "args": {
        "id": "repl_python_run",
        "file": "config/Python/Main.sublime-menu"
    }
}

But with the sublime's new version, it doesn't work.

What's wrong?

回答1:

This is the code:

{
  "keys": ["ctrl+alt+b"],
  "command": "repl_open",
  "args": {
    "cmd": ["python", "-u", "-i", "$file_basename"],
    "cwd": "$file_path",
    "encoding": "utf8",
    "extend_env": {"PYTHONIOENCODING": "utf-8"},
    "external_id": "python",
    "syntax": "Packages/Python/Python.tmLanguage",
    "type": "subprocess"
  }
}