feat(lang): enable manual formatting of go-mode buffers with golines

This commit is contained in:
2021-03-15 23:01:51 +00:00
parent bc4328c6d5
commit da5ecfffcd

View File

@@ -37,6 +37,14 @@
company-minimum-prefix-length 1
whitespace-style (delete 'indentation whitespace-style))
;; Enable manually formatting with golines by executing M-x gofmt
(let ((golines (executable-find "golines"))
(gofumports (executable-find "gofumports")))
(when golines
(setq gofmt-command golines)
(setq gofmt-args '("-t" "4" "-m" "80" "--no-reformat-tags"))
(when gofumports
(add-to-list 'gofmt-args "--base-formatter=gofumports"))))
(when (fboundp 'highlight-symbol-mode)
(highlight-symbol-mode -1))