π» π» π» π» π» π» π» π» π» π» π» SublimeREPL for SML π» π» π» π» π» π» π» π» π» π» π»
This tutorial assumes you already have Sublime text editor with Package Control installed as well as smlnj installed. Complete the installations with the links provided before continuing if you haven't already done so. π
-
Open Sublime and go to Preferences > Browse packages
-
Browse to the folder User inside the packages folder
-
Create a folder called SML
-
Inside the newly created SML folder, create two files π
- Default.sublime-commands
- Main.sublime-menu
-
Past the following code into the file Default.sublime-commands and save it:
[
{
"caption": "SublimeREPL: SML",
"command": "run_existing_window_command", "args":
{
"id": "repl_sml",
"file": "config/SML/Main.sublime-menu"
}
}
]
- Paste the following code into Main.sublime-menu and save it:
[
{
"id": "tools",
"children":
[{
"caption": "SublimeREPL",
"mnemonic": "r",
"id": "SublimeREPL",
"children":
[
{"command": "repl_open",
"id": "repl_sml",
"caption": "SML",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["/usr/local/smlnj/bin/sml"],
"cwd": "$file_path",
"syntax": "Packages/SML (Standard ML)/sml.tmLanguage",
"external_id": "sml",
"extend_env": {"NODE_DISABLE_COLORS": "1"}
}
}
]
}]
}
]
- The nested cmd property should be changed to the location of your smlnj executable
- Restart Sublime text editor
- Go to Tools > SublimeREPL > SML
- You should now be able to create .sml files within Sublimes' text editor and then run them quickly within Sublimes' sml repl ππππ
π [Original Source click here] (https://developerinmotion.wordpress.com/2013/02/07/sublime-text-2-and-sml)