New :editor format module

Centralized code formatting with built-in support for a variety of
languages. Provides the set-formatter! function for defining your own.

Still experimental and needs more testing!
This commit is contained in:
Henrik Lissner 2018-08-22 02:15:44 +02:00
parent c7e6cb981b
commit f51f2948af
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
7 changed files with 194 additions and 6 deletions

View file

@ -12,15 +12,13 @@
:references #'go-guru-referrers
:documentation #'godoc-at-point)
(set-formatter! 'go-mode #'gofmt)
(when-let* ((goimports (executable-find "goimports")))
(setq gofmt-command goimports))
(when (featurep! :feature syntax-checker)
(setq gofmt-show-errors nil)) ; Leave it to flycheck
(add-hook 'go-mode-hook #'go-eldoc-setup)
(add-hook! go-mode
(add-hook 'before-save-hook #'gofmt-before-save nil t))
(def-menu! +go/refactor-menu
"Refactoring commands for `go-mode' buffers."