Skip to content
This repository was archived by the owner on Jun 27, 2018. It is now read-only.

Repository files navigation

fmt-micro

GitHub tagGitter

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 😄

LanguageSupported Formatter(s)
Cclang-format, uncrustify
C#uncrustify
C++clang-format, uncrustify
CSScsscomb, js-beautify, prettier
Clojurecljfmt
CoffeeScriptcoffee-fmt
Crystalcrystal
Ddfmt, uncrustify
Dartdartfmt
Elmelm-format
Fishfish_indent
Flowprettier
Fortranfprettify
Gogofmt, goimports
GraphQLprettier
HTMLhtmlbeautifier, js-beautify, tidy
Haskellstylish-haskell
JSONprettier
JSXprettier
Javauncrustify
JavaScriptjs-beautify, prettier
LaTeXlatexindent
Lessprettier
Lualuafmt
Markdownprettier
Markomarko-prettyprint
OCamlocp-indent
Objective-Cclang-format, uncrustify
PHPphp-cs-fixer
Pawnuncrustify
Perlperltidy
Pugpug-beautifier-cli
Puppetpuppet-lint
Pythonautopep8, yapf
Rubyrubocop, rufo
Rustrustfmt
Sassprettier
Shellbeautysh, sh
TypeScriptprettier, tsfmt
Valauncrustify
XMLtidy
YAMLalign-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

About

A multi-language formatting plugin for the Micro text-editor. Moved to Gitlab

Topics

Resources

Contributing

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages