html
head
link(rel="stylesheet", href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.8.0/codemirror.css")
link(rel="stylesheet", href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.8.0/theme/elegant.min.css")
link(rel="stylesheet", href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.8.0/theme/mbo.min.css")
link(href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha/css/bootstrap.min.css", rel="stylesheet" integrity="sha256-GHW2S7IZAQe8+YkyL99LyDj1zdWXSPOG+JZafCtKiSc= sha512-vxM32w6T7zJ83xOQ6FT4CEFnlasqmkcB0+ojgbI0N6ZtSxYvHmT7sX2icN07TqEqr5wdKwoLkmB8sAsGAjCJHg==" crossorigin="anonymous")
body
textarea#input(name="input") Test
script(src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.8.0/codemirror.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.8.0/mode/scheme/scheme.min.js")
script(src="http://elm-lang.org/assets/codemirror-5.0/mode/elm/elm.js")
script(src="https://cdn.rawgit.com/shaunlebron/parinfer/23029f894fbb77b4a57d27437a10884d3be2f9de/codemirror/mode/clojure/clojure.js")
script(src="https://cdn.rawgit.com/shaunlebron/parinfer/23029f894fbb77b4a57d27437a10884d3be2f9de/codemirror/mode/clojure/clojure-parinfer.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.8.0/keymap/sublime.min.js")
script(src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.8.0/addon/edit/matchbrackets.min.js")
script(src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha/js/bootstrap.min.js" integrity="sha256-+h0g0j7qusP72OZaLPCSZ5wjZLnoUUicoxbvrl14WxM= sha512-0z9zJIjxQaDVzlysxlaqkZ8L9jh8jZ2d54F3Dn36Y0a8C6eI/RFOME/tLCFJ42hfOxdclfa29lPSNCmX5ekxnw==" crossorigin="anonymous")
main = ->
editor = CodeMirror.fromTextArea $("#input")[0],
lineNumbers: true
matchBrackets: true
theme: "elegant"
tabMode: "shift"
keyMap: "sublime"
mode: "elm"
$(main)
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |