Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/purcell/emacs-dune-format

Reformat dune files from within Emacs
https://github.com/purcell/emacs-dune-format

Last synced: about 2 months ago
JSON representation

Reformat dune files from within Emacs

Awesome Lists containing this project

README

        

[![Melpa Status](http://melpa.org/packages/dune-format-badge.svg)](http://melpa.org/#/dune-format)
[![Melpa Stable Status](http://stable.melpa.org/packages/dune-format-badge.svg)](http://stable.melpa.org/#/dune-format)
[![Build Status](https://github.com/purcell/emacs-dune-format/actions/workflows/test.yml/badge.svg)](https://github.com/purcell/emacs-dune-format/actions/workflows/test.yml)
Support me

dune-format.el
============

This Emacs library provides commands and a minor mode for easily reformatting
dune files using dune's built-in format command.

Installation
=============

If you choose not to use one of the convenient
packages in [MELPA][melpa], you'll need to
add the directory containing `dune-format.el` to your `load-path`, and
then `(require 'dune-format)`.

Usage
=====

Call `dune-format`, `dune-format-buffer` or `dune-format-region` as convenient.

Enable `dune-format-on-save-mode` in `dune-mode` buffers like this:

```el
(add-hook 'dune-mode-hook 'dune-format-on-save-mode)
```

or locally to your project with a form in your .dir-locals.el like
this:

```el
((dune-mode
(mode . dune-format-on-save)))
```

You might like to bind `dune-format` or `dune-format-buffer` to a key,
e.g. with:

```el
(define-key dune-mode-map (kbd "C-c C-f") 'dune-format)
```

[melpa]: http://melpa.org


[💝 Support this project and my other Open Source work](https://www.patreon.com/sanityinc)

[💼 LinkedIn profile](https://uk.linkedin.com/in/stevepurcell)

[✍ sanityinc.com](http://www.sanityinc.com/)