Search code examples
pythonkeyboardsublimetextkey-bindings

SublimeREPL does not run


I used SublimeREPL happily, then I wanted "Open with SubilimeText" option to be on right-click. So I installed Sublime Text (without removing) with "Add to explorer context menu" checked. And now when I press F7 SublimeREPL does nothing.

The only way it runs Python files is

Tools > SublimeREPL > Python > RUN Current File

I tried to remove REPL.build-system, re-installing package. Doesn't help. How can I fix it?


Solution

  • I have found the fix faster than you guys but thanks anyways :). If anybody have the same problem this may help:

    Open Sublime Text > Go to Preferences > Key Bindings

    In "Key Bindings - User" tab paste the following code (Note: I set key "F7", but any other free key can be set):

    [
    {
        "keys": ["f7"],
        "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"
                }
    }]