Skip to content

Instantly share code, notes, and snippets.

@tangoabcdelta
Last active February 6, 2021 17:35
Show Gist options
  • Save tangoabcdelta/473e81ad200dcecd5f2ce277870d7c4f to your computer and use it in GitHub Desktop.
Save tangoabcdelta/473e81ad200dcecd5f2ce277870d7c4f to your computer and use it in GitHub Desktop.
enabling prettier for sublime

JsPrettier

  1. Command Palette

    "Ctrl/Cmd + Shift + P", then type "JsPrettier Format Code".

  2. Context Menu

    Right-click the file view and select "JsPrettier Format Code".

  3. Key Binding

    There is no default key binding for this plug-in.

    To add a key binding, navigate to "Preferences" -> "Key Bindings...", and add an entry for "js_prettier". For example...

     { "keys": ["shift+alt+f"], "command": "js_prettier" }
    

    Change "shift+alt+f" with your preferred key combination.

node_path (default: empty)

If Sublime Text has problems resolving the absolute path to node, you can set a custom path here.

Examples:

{
    // macOS/Linux:
    "node_path": "/usr/local/bin/node"
    "node_path": "/some/absolute/path/to/node"
    "node_path": "./node"
    "node_path": "~/bin/node"
    "node_path": "$HOME/bin/node"
    "node_path": "${project_path}/bin/node"
    "node_path": "$ENV/bin/node"
    "node_path": "$NVM_BIN/node"

    // Windows:
    "node_path": "C:/path/to/node.exe"
    "node_path": "%USERPROFILE%\\bin\\node.exe"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment