Giter Club home page Giter Club logo

emacs-format-all-the-code's Introduction

format-all for Emacs

NOTE: The package is actively maintained but due to lack of time, complex tasks are done at a slow pace. Simple tasks like adding or fixing formatter definitions are often done immediately. For faster progress, additional maintainers are welcome.

What does it do

Lets you auto-format source code in many languages using the same command for all languages, instead of learning a different Emacs package and formatting command for each language.

Just do M-x format-all-buffer and it will try its best to do the right thing. To auto-format code on save, use the minor mode format-all-mode. Please see the documentation for that function for instructions.

Supported languages

How to install

From MELPA

You will need to install external programs to do the formatting. If format-all-buffer can't find the right program, it will try to tell you how to install it.

If you have installed a formatter but Emacs cannot find it, Emacs may be using a PATH different from your shell. The path searched by Emacs is in the exec-path variable. You can easily make it match your shell's PATH using the exec-path-from-shell package from MELPA.

How to customize

M-x customize-group format-all has a few basic settings.

However, the main thing you probably want to set is format-all-formatters. That variable is buffer-local, and can be made project-local by setting it in a .dir-locals.el file for the project.

Additionally, many of the external formatters support configuration files in the source code directory to control their formatting. Please see the documentation for each formatter.

How to add new languages

New external formatters can be added easily if they can read code from standard input and format it to standard output. Feel free to submit a pull request or ask for help in GitHub issues.

How to report bugs

GitHub issues are preferred. Email is also ok.

Feature requests are welcome. If you are interested in doing anything beyond adding new formatters in the current framework, please discuss in issues before writing code.

Roadmap

atom-beautify sports a very impressive set of formatters. We should aspire to that level of coverage for Emacs.

Unibeautify is a project to provide one shell command to run all beautifiers. atom-beautify will be rewritten to be based on it. Perhaps we should be too, once it stabilizes.

emacs-format-all-the-code's People

Contributors

lassik avatar knu avatar dochang avatar andersk avatar jmorag avatar sideshowcoder avatar smaret avatar tristancacqueray avatar jasonliang-dev avatar edmundmiller avatar egh avatar ellakk avatar tenniscp25 avatar patrl avatar poiscript avatar haozeke avatar seblemaguer avatar sei40kr avatar smsegal avatar sondr3 avatar ztlevi avatar goofansu avatar tobjaw avatar

Watchers

James Cloos avatar  avatar

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.