lang/{javascript,web}: add web-beautify plugin
This commit is contained in:
parent
0243229690
commit
495b0d0016
4 changed files with 20 additions and 3 deletions
|
@ -93,6 +93,11 @@
|
|||
:init (setq coffee-indent-like-python-mode t))
|
||||
|
||||
|
||||
(def-package! web-beautify :commands web-beautify-js
|
||||
:init
|
||||
(map! :map* (json-mode js2-mode-map) :n "gQ" 'web-beautify-js))
|
||||
|
||||
|
||||
;;
|
||||
;; Projects
|
||||
;;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
(package! jsx-mode)
|
||||
(package! nodejs-repl)
|
||||
(package! tern)
|
||||
(package! web-beautify)
|
||||
|
||||
(when (featurep! :completion company)
|
||||
(package! company-tern))
|
||||
|
@ -16,7 +17,7 @@
|
|||
|
||||
;;
|
||||
(def-bootstrap! javascript
|
||||
(unless (cl-every 'executable-find '("node" "npm" "tern"))
|
||||
(unless (cl-every 'executable-find '("node" "npm" "tern" "js-beautify"))
|
||||
(pcase (doom-system-os)
|
||||
('arch
|
||||
(let (progs)
|
||||
|
@ -31,6 +32,7 @@
|
|||
(unless (executable-find "node")
|
||||
(error "Failed to install NodeJS"))
|
||||
(unless (executable-find "tern")
|
||||
(funcall (if (file-writable-p (executable-find "npm")) 'sh 'sudo)
|
||||
"npm -g install tern"))
|
||||
(sh "npm -g install tern"))
|
||||
(unless (executable-find "js-beautify")
|
||||
(sh "npm -g install js-beautify"))
|
||||
t))
|
||||
|
|
|
@ -4,6 +4,15 @@
|
|||
(load! +css)
|
||||
|
||||
|
||||
(def-package! web-beautify
|
||||
:commands (web-beautify-html web-beautify-css)
|
||||
:init
|
||||
(map! (:map* (css-mode-map scss-mode-map less-css-mode-map)
|
||||
:n "gQ" 'web-beautify-css)
|
||||
(:map* web-mode-map
|
||||
:n "gQ" 'web-beautify-html)))
|
||||
|
||||
|
||||
;;
|
||||
;; Frameworks
|
||||
;;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
;;; lang/web/packages.el
|
||||
|
||||
(package! rainbow-mode)
|
||||
(package! web-beautify)
|
||||
(when (featurep! :completion ivy)
|
||||
(package! counsel-css :recipe (:fetcher github :repo "hlissner/emacs-counsel-css")))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue