This is how.
go in:
- sublime text (in the menu on top of the screen)
- preferences
- key binding
and vcopy this
[ {"keys": ["ctrl+alt+b"], "command": "repl_open", "caption": "Python - RUN current file", "id": "repl_python_run", "mnemonic": "d", "args": { "type": "subprocess", "encoding": "utf8", "cmd": ["/Library/Frameworks/Python.framework/Versions/3.9/bin/python3", "-u", "-i", "$file_basename"], "cwd": "$file_path", "syntax": "Packages/Python/Python.tmLanguage", "external_id": "python", "extend_env": {"PYTHONIOENCODING": "utf-8"} }}, // Open cmd.exe Command Prompt when Alt+1 is pressed { // The key press to look out for "keys": ["alt+1"], // Tell terminus to open something "command": "terminus_open", // Tell terminus what to open "args" : { // Open Command Prompt "cmd": "cmd.exe", // Provide Command Prompt with Current Working Directory "cwd": "${file_path:${folder}}", // Tell terminus to put it in the panel at the bottom of the screen "panel_name": "Terminus" } }, ]
you must install the plugins for sublime repl and terminus, of course. the first is to use the python terminal in sublime, the second is to use the mac os terminal in sublime. have fun.
Install package control
After you installed package control, go again in tools, command palette and choose again Install Package, this will appear
Ok, now you are ready for the key binding
Keybinding
Go here
You will get a window like this
[ { "keys": ["alt+1"], "command": "terminus_open", "args" : { "cmd": "cmd.exe", "cwd": "${file_path:${folder}}", // Tell terminus to put it in the panel at the bottom of the screen "panel_name": "Terminus" } }, ]
We’re done.
Now when you press alt+1 will appear something like this below. If it does not, close sublime and reopen it. save the keybinding file too (with control+s)