Skip to content

Instantly share code, notes, and snippets.

@OliverJAsh
Last active December 24, 2015 09:39
Show Gist options
  • Save OliverJAsh/6778557 to your computer and use it in GitHub Desktop.
Save OliverJAsh/6778557 to your computer and use it in GitHub Desktop.
JS Bin Settings

JS Bin Settings

JSBin internally uses the CodeMirror library for it's HTML, JavaScript, and CSS code editors. JSBin exposes the Configuration Settings of CodeMirror and allows you to set them yourself. The settings are stored in localStorage so they are available the next time you use JSBin. CodeMirror supports a whole suite of settings, but the following are the ones that I am most interested in:

  • theme - Color scheme that will be used for the editor. Currently the following themes exist: solarized-light, solarized-dark, monokai, vibrant-ink, cobalt, blackboard, ambiance, & jsbin (default)
  • indentUnit - The number of spaces inside a block of code
  • smartIndent - Automatically indent based on the context of what you are doing
  • tabSize - This defines the width of the tab character
  • indentWithTabs - Determines if you want to use tabs instead of spaces when you intent
  • autoClearEmptyLines - Clears lines that only have whitespace in them when the cursor exits the line
  • lineWrapping - If there is a long line that extends outside of the viewable area this will wrap the contents
  • lineNumbers - This will show lines numbers in the left gutter
  • matchBrackets - When your cursor is on a bracket this will match the other associated bracket
{
"panels": [
"html",
"javascript",
"live"
],
"editor": {
"indentUnit": 2,
"smartIndent": true,
"tabSize": 2,
"indentWithTabs": false,
"autoClearEmptyLines": true,
"lineWrapping": true,
"lineNumbers": true,
"matchBrackets": true
},
"includejs": true,
"font": 14,
"keys": {
"useAlt": false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment