Code Monkey home page Code Monkey logo

fmt-micro's Introduction

fmt-micro

GitHub tag Gitter

This is a multi-language formatting plugin for the Micro text-editor.

This plugin does NOT bundle any formatters, so you must install whichever you want to use.

Installation: Just run plugin install fmt and restart Micro ๐Ÿ‘

Language Support

Is your favorite formatter missing? Make a request in the issue tracker, or submit a PR ๐Ÿ˜„

Language Supported Formatter(s)
C clang-format, uncrustify
C# uncrustify
C++ clang-format, uncrustify
CSS csscomb, js-beautify, prettier
Clojure cljfmt
CoffeeScript coffee-fmt
Crystal crystal
D dfmt, uncrustify
Dart dartfmt
Elm elm-format
Fish fish_indent
Flow prettier
Fortran fprettify
Go gofmt, goimports
GraphQL prettier
HTML htmlbeautifier, js-beautify, tidy
Haskell stylish-haskell
JSON prettier
JSX prettier
Java uncrustify
JavaScript js-beautify, prettier
LaTeX latexindent
Less prettier
Lua luafmt
Markdown prettier
Marko marko-prettyprint
OCaml ocp-indent
Objective-C clang-format, uncrustify
PHP php-cs-fixer
Pawn uncrustify
Perl perltidy
Pug pug-beautifier-cli
Puppet puppet-lint
Python autopep8, yapf
Ruby rubocop, rufo
Rust rustfmt
Sass prettier
Shell beautysh, sh
TypeScript prettier, tsfmt
Vala uncrustify
XML tidy
YAML align-yaml

Usage

The formatter will run on-save, unless fmt-onsave is set to false.

Run help fmt to bring up a help file while in Micro.

Commands

  • fmt to run the formatter on the current file.
  • fmt formattername to run the specified formatter on the current file without affecting your settings.
  • fmt list to output the supported formatters to Micro's log.
  • fmt update to force an update of the in-memory formatter settings.
    Useful for after adding a config file, or changing editor settings.
  • fmt setall formattername to set the specified formatter to be used in all the options of its supported language types.
  • fmt unsetall formattername to unset all settings the specified formatter is currently set to.
    This is useful for if you uninstalled a formatter.

Using Custom Formatter/Args

You can add your own formatter, or just use different args, by adding its command (and filetype) into settings.json
The format looks like "fmt|js": "prettier --write" in your settings.json.

Note that you must use the filetype detected by Micro, and if it's Unknown then use it's literal filetype extension (ex: p for Pawn)
You can check a file's type by running show filetype

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.