All Projects → ionutvmi → Sublime Jsfmt

ionutvmi / Sublime Jsfmt

Licence: mit
jsfmt plugin for Sublime Text

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sublime Jsfmt

Sublime-Pretty-Shell
🐚 Shell Script Formatter / Syntax Checker (Powered by shfmt)
Stars: ✭ 28 (-94.17%)
Mutual labels:  formatter, sublime-text
Golite
Add essential language support for the Go language to Sublime Text 3.
Stars: ✭ 14 (-97.08%)
Mutual labels:  formatter, sublime-text
Verible
Verible is a suite of SystemVerilog developer tools, including a parser, style-linter, and formatter.
Stars: ✭ 384 (-20%)
Mutual labels:  formatter
Processing Sublime
A Sublime Text package for the programming language Processing
Stars: ✭ 447 (-6.87%)
Mutual labels:  sublime-text
Sublime zk
A SublimeText3 package featuring ID based wiki style links, and #tags, intended for zettelkasten method users. Loaded with tons of features like inline image display, sophisticated tag search, note transclusion features, support for note templates, bibliography support, support for multiple panes, etc. to make working in your Zettelkasten a joy 😄.
Stars: ✭ 408 (-15%)
Mutual labels:  sublime-text
Ayu
🎨🖌 Modern Sublime Text theme
Stars: ✭ 3,933 (+719.38%)
Mutual labels:  sublime-text
Latexindent.pl
Perl script to add indentation (leading horizontal space) to LaTeX files. It can modify line breaks before, during and after code blocks; it can perform text wrapping and paragraph line break removal. It can also perform string-based and regex-based substitutions/replacements. The script is customisable through its YAML interface.
Stars: ✭ 415 (-13.54%)
Mutual labels:  formatter
Isort
A Python utility / library to sort imports.
Stars: ✭ 4,377 (+811.88%)
Mutual labels:  formatter
Unibeautify
One Beautifier to rule them all, One Beautifier to clean them, One Beautifier to bring them all and in the darkness sheen them
Stars: ✭ 466 (-2.92%)
Mutual labels:  formatter
Sublime Rails Snippets
Sublime Text snippets for the latest Ruby and Rails versions
Stars: ✭ 406 (-15.42%)
Mutual labels:  sublime-text
Exfmt
🌸 An opinionated Elixir source code formatter
Stars: ✭ 445 (-7.29%)
Mutual labels:  formatter
Gitgutter
A Sublime Text 2/3 plugin to see git diff in gutter
Stars: ✭ 3,888 (+710%)
Mutual labels:  sublime-text
Coolformat
CoolFormat Source Code Formatter
Stars: ✭ 392 (-18.33%)
Mutual labels:  formatter
Themer
themer is inspired by trevordmiller/nova and chriskempson/base16.
Stars: ✭ 4,483 (+833.96%)
Mutual labels:  sublime-text
Prettier Vscode
Visual Studio Code extension for Prettier
Stars: ✭ 4,085 (+751.04%)
Mutual labels:  formatter
Black
The uncompromising Python code formatter
Stars: ✭ 23,973 (+4894.38%)
Mutual labels:  formatter
Swaggen
OpenAPI/Swagger 3.0 Parser and Swift code generator
Stars: ✭ 385 (-19.79%)
Mutual labels:  formatter
Google Java Format
Reformats Java source code to comply with Google Java Style.
Stars: ✭ 4,250 (+785.42%)
Mutual labels:  formatter
Neovintageous
Vim emulation layer for Sublime Text.
Stars: ✭ 411 (-14.37%)
Mutual labels:  sublime-text
Fantomas
FSharp source code formatter
Stars: ✭ 475 (-1.04%)
Mutual labels:  formatter

jsfmt for Sublime Text 2/3

If you want your javascript automatically formatted to abide a particular style, then jsfmt is for you. No need to read warnings and fix things yourself. Just keep it all auto. Boom boom jsfmt is pretty tight. And yeah, if you want it in Sublime Text this is your homeboy.

Enable autoformat then save the file and it gets formatted.

Installation

Via package control
Open your command palette -> Package Control: Install Package -> jsfmt

Manual

## go to your ST packages folder. maybe something like …
cd ~/Library/"Application Support/Sublime Text 2"/Packages

# clone this repo
git clone https://github.com/ionutvmi/sublime-jsfmt jsfmt

On windows open cmd and:

cd %APPDATA%\"Sublime Text 3"\Packages
git clone https://github.com/ionutvmi/sublime-jsfmt jsfmt

Plugins included

Settings

{
    // autoformat on save
    "autoformat": false,

    // array of extensions for autoformat
    "extensions": ["js", "sublime-settings"],

    // options for jsfmt
    "options": {
        "preset": "jquery",
        "indent": {
            "value": "    "
        },
        // plugins included
        "plugins": [
            // "esformatter-quotes",
            // "esformatter-semicolons",
            // "esformatter-braces",
            // "esformatter-dot-notation"
        ]
    },
    "options-JSON": {
        "plugins": [
            "esformatter-quotes"
        ],
        "quotes": {
            "type": "double"
        }
    },
    "alert-errors": true,
    // path to nodejs
    "node-path": "node",
    // if true it will format the whole file even if you have a selection active
    "ignore-selection": false
}

Commands

Command palette:

  • JSFMT: Format the current file
  • JSFMT: Toggle autoformat
  • JSFMT: Settings - Default
  • JSFMT: Settings - User

Menu:
Preferences -> Package Settings -> Sublime JSFMT

Keyboard shortcut
If you want to trigger the formatting on a keyboard shortcut you will need to:

  • Go to Preferences -> Key Bindings - User
  • Insert the configuration to call the format_javascript command
{ "keys": ["ctrl+q"], "command": "format_javascript" },

Formatting rules

You can set global rules via a .jsfmtrc. Be crazy and establish one for all your projects in ~/.jsfmtrc. (like in dotfiles)

Otherwise you're probably pretty levelheaded and will probably provide one in your project root. It'll be read and applied.

Rules you can intuit from these esformatter preset files.

There's a .jsfmtrc-sample in this repo. It's a good start. Rename it and toss it somewhere. Try it out.

Installing plugins

If you want to use a plugin that is not installed by default you will need to follow the next steps:

  1. Go to the packages folder (Preferences -> Browse Packages)
  2. cd into the jsfmt folder.
  3. Install the plugins you need.
  4. Go to your jsfmt settings file and add the name of the plugin in the plugins array.

Compatibility

Should work in both ST2 and ST3.

Contributing

If you find any bugs feel free to report them here
Pull requests are also encouraged.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].