All Projects → anildigital → Mix Format.el

anildigital / Mix Format.el

Licence: other
Emacs package to format Elixir code in Emacs with elixir-mode

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Mix Format.el

bcp-47-normalize
Normalize, canonicalize, and format BCP 47 tags
Stars: ✭ 16 (-65.22%)
Mutual labels:  code, format
Elisp Lint
Basic linting for Emacs Lisp
Stars: ✭ 45 (-2.17%)
Mutual labels:  emacs
Organic
Outliner, organizer and notes management app.
Stars: ✭ 34 (-26.09%)
Mutual labels:  emacs
Clink
A developer assistance tool to help with refactoring and keeping related code up to date with changes
Stars: ✭ 40 (-13.04%)
Mutual labels:  code
Jupyterlab black
A JupyterLab extension to apply Black formatter to code within codecell.
Stars: ✭ 35 (-23.91%)
Mutual labels:  code
Tensorflow In Practice
Code based in TensorFlow
Stars: ✭ 43 (-6.52%)
Mutual labels:  code
Renew
Mix task to create mix projects that builds into Docker containers.
Stars: ✭ 33 (-28.26%)
Mutual labels:  code
Bartycrouch
Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.
Stars: ✭ 1,032 (+2143.48%)
Mutual labels:  code
Brazilian Utils
Utils library for specific Brazilian businesses
Stars: ✭ 1,023 (+2123.91%)
Mutual labels:  format
Fix Word
Transform words in Emacs (upcase, downcase, capitalize, etc.)
Stars: ✭ 39 (-15.22%)
Mutual labels:  emacs
Grugru
Rotate text at point in Emacs.
Stars: ✭ 39 (-15.22%)
Mutual labels:  emacs
Atom Stylefmt
Format your CSS using stylefmt.
Stars: ✭ 35 (-23.91%)
Mutual labels:  format
Pretty Time
Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.
Stars: ✭ 44 (-4.35%)
Mutual labels:  format
Simple Modeline
A simple mode-line for Emacs.
Stars: ✭ 35 (-23.91%)
Mutual labels:  emacs
Labs Pentest
Free Labs to Train Your Pentest / CTF Skills
Stars: ✭ 46 (+0%)
Mutual labels:  code
Homebrew Emacs Plus
Emacs Plus formulae for the Homebrew package manager
Stars: ✭ 965 (+1997.83%)
Mutual labels:  emacs
Tinydate
A tiny (349B) reusable date formatter. Extremely fast!
Stars: ✭ 990 (+2052.17%)
Mutual labels:  format
0xc
Easy base conversion in emacs
Stars: ✭ 42 (-8.7%)
Mutual labels:  emacs
Java Sec Code
Java web common vulnerabilities and security code which is base on springboot and spring security
Stars: ✭ 1,033 (+2145.65%)
Mutual labels:  code
Cfrs
Child Frame Read String
Stars: ✭ 46 (+0%)
Mutual labels:  emacs

P.S.

The work from this repository has been merged to officially supporrted elixir-mode. Please update your elixir-mode and you should be okay to use elixir-format. Do check README for more instructions to setup.

elixir-format (INACTIVE - work merged to https://github.com/elixir-editors/emacs-elixir)

Emacs package to format your Elixir code.

Setup

Customize the elixir and mix pathes

In Emacs, run following command to customize option

M-x customize-option

Customize-variable: elixir-format-elixir-path

and set your elixir executable path there. After that run:

M-x customize-option

Customize-variable: elixir-format-mix-path

and set your mix executable path there.

Alternavively you can define variables as below

(setq elixir-format-elixir-path "/usr/local/bin/elixir")
(setq elixir-format-mix-path "/usr/local/bin/mix")

Your machine's elixir and mix executable paths can be found with which command as shown below

$ which mix
/usr/local/bin/mix

Usage

;; require from Emacs
(require 'elixir-format)

;; Use it
M-x elixir-format

Add elixir-mode hook to run mix format on file save

;; Create a buffer-local hook to run elixir-format on save, only when we enable elixir-mode.
(add-hook 'elixir-mode-hook
          (lambda () (add-hook 'before-save-hook 'elixir-format nil t)))

To use a .formatter.exs you can either set elixir-format-arguments globally to a path like this:

(setq elixir-format-arguments (list "--dot-formatter" "/path/to/.formatter.exs"))

or you set elixir-format-arguments in a hook like this:

(add-hook elixir-format-hook '(lambda ()
                                 (if (projectile-project-p)
                                     (setq elixir-format-arguments (list "--dot-formatter" (concat (projectile-project-root) "/.formatter.exs")))
                                   (setq elixir-format-arguments nil))))

In this example we use Projectile to get the project root and set elixir-format-arguments accordingly.

Contribute

Feel free to contribute

Author

([email protected]) ; anil wadghule

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].