任何人都知道如何在SublimeREPL中评估单行或选择吗?我尝试进行Tools > SublimeREPL > Eval in REPL > Selection
,但它不起作用。既不使用传输也不使用文件。实际上,Eval in REPL
或Transfer to REPL
下的任何内容都不起作用。但是,ctrl+B
有效。
我按照此post设置我的REPL配置。因此,我的Main.sublime菜单已经包含“ -i”。随附用于测试目的:
[
{
"id": "tools",
"children":
[{
"caption": "SublimeREPL",
"mnemonic": "R",
"id": "SublimeREPL",
"children":
[
{"caption": "Python",
"id": "Python",
"children":[
{"command": "repl_open",
"caption": "Python",
"id": "repl_python",
"mnemonic": "P",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["C:\\Miniconda3\\python.exe", "-i", "-u"],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"view_id": "*REPL* [python]",
"external_id": "python",
"extend_env": {"PYTHONIOENCODING": "utf-8"}
}
},
{"command": "python_virtualenv_repl",
"id": "python_virtualenv_repl",
"caption": "Python - virtualenv"},
{"command": "repl_open",
"caption": "Python - PDB current file",
"id": "repl_python_pdb",
"mnemonic": "D",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["C:\\Miniconda3\\python.exe", "-i", "-u", "-m", "pdb", "$file_basename"],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {"PYTHONIOENCODING": "utf-8"}
}
},
{"command": "repl_open",
"caption": "Python - RUN current file",
"id": "repl_python_run",
"mnemonic": "R",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["C:\\Miniconda3\\python.exe","-i", "-u", "$file_basename"],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"view_id": "*REPL* [python]",
"external_id": "python",
"extend_env": {"PYTHONIOENCODING": "utf-8"}
}
},
{"command": "repl_open",
"caption": "Python - IPython",
"id": "repl_python_ipython",
"mnemonic": "I",
"args": {
"type": "subprocess",
"encoding": "utf8",
"autocomplete_server": true,
"cmd": {
"osx": ["C:\\Miniconda3\\python.exe", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"],
"linux": ["C:\\Miniconda3\\python.exe", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"],
"windows": ["C:\\Miniconda3\\python.exe", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"]
},
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {
"PYTHONIOENCODING": "utf-8",
"SUBLIMEREPL_EDITOR": "$editor"
}
}
}
]}
]
}]
}
]
我还进行了编辑,以使所有内容在同一窗口中运行。
Replace : if view.id() == view_id
With : if view.name() == view_id:
构建设置:
{
"target": "run_existing_window_command",
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"
}
请,有人可以让我知道我的配置出了什么问题吗?非常感谢!