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."
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
(set-repl-handler! 'php-mode #'php-boris)
|
||||
(set-lookup-handlers! 'php-mode :documentation #'php-search-documentation)
|
||||
(set-formatter! 'php-mode #'php-cs-fixer-fix)
|
||||
|
||||
;; `+php-company-backend' uses `company-phpactor', `php-extras-company' or
|
||||
;; `company-dabbrev-code', in that order.
|
||||
|
|
|
@ -67,6 +67,4 @@
|
|||
(def-package! fish-mode
|
||||
:when (featurep! +fish)
|
||||
:defer t
|
||||
:config
|
||||
(add-hook! fish-mode
|
||||
(add-hook 'before-save-hook #'fish_indent-before-save)))
|
||||
:config (set-formatter! 'fish-mode #'fish_indent))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue