In your Packages/User folder, create SublimeREPL/config/Python/Main.sublime-menu with the following contents:
[
{
"id": "tools",
"children":
[{
"caption": "SublimeREPL",
"mnemonic": "r",
"id": "SublimeREPL",
"children":
[
{
"caption": "Python",
"id": "Python",
"children":[
{
"command": "repl_open",
"caption": "Python - Anaconda",
"id": "repl_python",
"mnemonic": "p",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["/path/to/Anaconda/python", "-i", "-u"],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {"PYTHONIOENCODING": "utf-8"}
}
},
{
"command": "repl_open",
"caption": "IPython - Anaconda",
"id": "repl_python_ipython",
"mnemonic": "p",
"args": {
"type": "subprocess",
"encoding": "utf8",
"autocomplete_server": true,
"cmd": ["/path/to/Anaconda/python", "-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"
}
}
}
]
}
]
}]
}
]
In the "cmd"lines, change /path/to/Anaconda/python with the actual path to your python executable you want to use.
Save
the file, and you should now have Tools -> SublimeREPL -> Python
-> Python - Anacondaand IPython - Anaconda menu options to start
REPLs with the Anaconda interpreter. If you have multiple versions of
Python installed (for example, 2.7 and 3.3) you can just duplicate the
children contents and alter the caption and cmd paths appropriately.
需要注意的是,上述设置中id 最好进行更改,不然会覆盖原来的选项。
完成后再tool->sublimeREPL-python下就会有两个新的选项:
Python - Anaconda
IPython - Anaconda