refactor(format): replace with apheleia
Initial refactor of format module to replace format-all with apheleia
This commit is contained in:
parent
a44e8d6bfd
commit
4ecd616cd8
9 changed files with 126 additions and 585 deletions
|
@ -17,10 +17,13 @@
|
|||
:config
|
||||
(set-docsets! 'sh-mode "Bash")
|
||||
(set-electric! 'sh-mode :words '("else" "elif" "fi" "done" "then" "do" "esac" ";;"))
|
||||
(set-formatter! 'shfmt
|
||||
'("shfmt" "-ci"
|
||||
("-i" "%d" (unless indent-tabs-mode tab-width))
|
||||
("-ln" "%s" (pcase sh-shell (`bash "bash") (`mksh "mksh") (_ "posix")))))
|
||||
(after! apheleia
|
||||
(setf (alist-get 'shfmt apheleia-formatters)
|
||||
'("shfmt" "-ci"
|
||||
(unless indent-tabs-mode
|
||||
(list "-i" (number-to-string tab-width)))
|
||||
(list "-ln" (pcase sh-shell (`bash "bash") (`mksh "mksh") (_ "posix"))))))
|
||||
|
||||
(set-repl-handler! 'sh-mode #'+sh/open-repl)
|
||||
(set-lookup-handlers! 'sh-mode :documentation #'+sh-lookup-documentation-handler)
|
||||
(set-ligatures! 'sh-mode
|
||||
|
@ -85,10 +88,6 @@
|
|||
;; whatis lookups are exceptionally slow on macOS (#5860)
|
||||
company-shell-dont-fetch-meta IS-MAC))
|
||||
|
||||
(use-package! fish-mode
|
||||
:when (modulep! +fish)
|
||||
:defer t
|
||||
:config (set-formatter! 'fish-mode #'fish_indent))
|
||||
|
||||
(use-package! powershell
|
||||
:when (modulep! +powershell)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue