File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -490,6 +490,35 @@ You can though ask vim to run ``darker`` on file save with the following in your
490
490
491
491
Vim should automatically reload the file.
492
492
493
+ Emacs
494
+ -----
495
+
496
+ You can integrate with Emacs using Steve Purcell's `emacs-reformatter `__ library.
497
+
498
+ Using `use-package `__:
499
+
500
+ .. code-block :: emacs-lisp
501
+
502
+ (use-package reformatter
503
+ :hook ((python-mode . darker-reformat-on-save-mode))
504
+ :config
505
+ (reformatter-define darker-reformat
506
+ :program "darker"
507
+ :stdin nil
508
+ :stdout nil
509
+ :args (list "-q" input-file))
510
+
511
+
512
+ This will automatically reformat the buffer on save.
513
+
514
+ You have multiple functions available to launch it manually:
515
+
516
+ - darker-reformat
517
+ - darker-reformat-region
518
+ - darker-reformat-buffer
519
+
520
+ __ https://github.com/purcell/emacs-reformatter
521
+ __ https://github.com/jwiegley/use-package
493
522
494
523
Using as a pre-commit hook
495
524
==========================
You can’t perform that action at this time.
0 commit comments