Skip to content

Instantly share code, notes, and snippets.

@passos
Last active October 28, 2022 22:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save passos/471a2ed45b0c4603f43904e0ffb0144f to your computer and use it in GitHub Desktop.
Save passos/471a2ed45b0c4603f43904e0ffb0144f to your computer and use it in GitHub Desktop.
Sublime Keybinding
[
{
"keys": [ "super+f12" ],
"command": "unquote"
},
{
"keys": [ "home" ],
"command": "move_to",
"args": { "to": "bol" }
},
{
"keys": [ "end" ],
"command": "move_to",
"args": { "to": "eol" }
},
{
"keys": [ "shift+end" ],
"command": "move_to",
"args": { "to": "eol", "extend": true }
},
{
"keys": [ "shift+home" ],
"command": "move_to",
"args": { "to": "bol", "extend": true }
},
{
"keys": [ "f8" ],
"caption": "Python - RUN current file",
"command": "repl_open",
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.python"
}
],
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": [ "python3", "-u", "$file_basename" ],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {
"PYTHONIOENCODING": "utf-8"
}
}
},
{
"keys": [ "f8" ],
"caption": "NodeJS - Run current file",
"command": "repl_open",
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.js"
}
],
"id": "repl_node",
"mnemonic": "N",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": [ "node", "$file_basename" ],
"cwd": "$file_path",
"syntax": "Packages/JavaScript/JavaScript.tmLanguage",
"external_id": "js",
"autocomplete_server": true,
"extend_env": {
"NODE_NO_READLINE": 1
}
}
},
{
"keys": [ "f8" ],
"caption": "Go - RUN current file",
"command": "repl_open",
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.go"
}
],
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": [ "go", "run", "$file_basename" ],
"cwd": "$file_path",
"syntax": "Packages/Go/Go.tmLanguage",
"external_id": "go"
}
},
{
"keys": [ "f8" ],
"caption": "Scala - RUN current file",
"command": "repl_open",
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.scala"
}
],
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": [ "scala", "$file_basename" ],
"cwd": "$file_path",
"syntax": "Packages/Scala/Scala.tmLanguage",
"external_id": "scala"
}
},
{
"keys": [ "f8" ],
"caption": "Lua - RUN current file",
"command": "repl_open",
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.lua"
}
],
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": [ "lua", "$file_basename" ],
"cwd": "$file_path",
"syntax": "Packages/Lua/Lua.tmLanguage",
"external_id": "lua"
}
},
{
"keys": [ "f8" ],
"caption": "Perl - Run current file",
"command": "repl_open",
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.perl"
}
],
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": [ "perl", "$file_basename" ],
"cwd": "$file_path",
"syntax": "Packages/Perl/Perl.tmLanguage",
"external_id": "perl"
}
},
{
"keys": [ "f8" ],
"command": "build",
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.Kotlin"
}
],
"args": {
"build_system": "Packages/Kotlin/Kotlin.sublime-build",
"variant": "Compile + run"
}
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment