Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jordangarrison/8720cf98126a1a64890b2f18c1bc69f5 to your computer and use it in GitHub Desktop.
Save jordangarrison/8720cf98126a1a64890b2f18c1bc69f5 to your computer and use it in GitHub Desktop.
Python Black Formatter with Emacs Doom
;; Python Black Formatter
;; package.el
(package! python-black)
;; config.el
(use-package! python-black
:demand t
:after python)
(add-hook! 'python-mode-hook #'python-black-on-save-mode)
;; Feel free to throw your own personal keybindings here
(map! :leader :desc "Blacken Buffer" "m b b" #'python-black-buffer)
(map! :leader :desc "Blacken Region" "m b r" #'python-black-region)
(map! :leader :desc "Blacken Statement" "m b s" #'python-black-statement)
@Vanderscycle
Copy link

@roryk @jordangarrison thank you for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment