https://github.com/purcell/emacs-dune-format
Reformat dune files from within Emacs
https://github.com/purcell/emacs-dune-format
Last synced: 22 days ago
JSON representation
Reformat dune files from within Emacs
- Host: GitHub
- URL: https://github.com/purcell/emacs-dune-format
- Owner: purcell
- Created: 2021-04-11T23:38:40.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-07T07:21:55.000Z (6 months ago)
- Last Synced: 2025-03-25T03:31:28.297Z (about 1 month ago)
- Language: Emacs Lisp
- Size: 6.84 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
[](http://melpa.org/#/dune-format)
[](http://stable.melpa.org/#/dune-format)
[](https://github.com/purcell/emacs-dune-format/actions/workflows/test.yml)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/)