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:
parent
c7e6cb981b
commit
f51f2948af
7 changed files with 194 additions and 6 deletions
|
@ -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."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue